Coder Social home page Coder Social logo

conventional-changelog's Introduction

Release It! ๐Ÿš€

๐Ÿš€ Generic CLI tool to automate versioning and package publishing-related tasks:

Use release-it for version management and publish to anywhere with its versatile configuration, a powerful plugin system, and hooks to execute any command you need to test, build, and/or publish your project.

Action Status npm version

Are you using release-it at work? Please consider sponsoring me!

Installation

Although release-it is a generic release tool, most projects use it for projects with npm packages. The recommended way to install release-it uses npm and adds some minimal configuration to get started:

npm init release-it

Alternatively, install it manually, and add the release script to package.json:

npm install -D release-it
{
  "name": "my-package",
  "version": "1.0.0",
  "scripts": {
    "release": "release-it"
  },
  "devDependencies": {
    "release-it": "^16.1.0"
  }
}

Usage

Run release-it from the root of the project using either npm run or npx:

npm run release
npx release-it

You will be prompted to select the new version, and more prompts will follow based on your configuration.

Yarn

Using Yarn? Please see the npm section on Yarn.

Monorepos

Using a monorepo? Please see this monorepo recipe.

Global Installation

Per-project installation as shown above is recommended, but global installs are supported as well:

  • From npm: npm install -g release-it
  • From Homebrew: brew install release-it

Containerized

Use Release It! - Containerized to run it in any environment as a standardized container without the need for a Node environment. Thanks Juan Carlos!

Videos, articles & examples

Here's a list of interesting external resources:

Want to add yours to the list? Just open a pull request!

Configuration

Out of the box, release-it has sane defaults, and plenty of options to configure it. Most projects use a .release-it.json file in the project root, or a release-it property in package.json.

Here's a quick example .release-it.json:

{
  "git": {
    "commitMessage": "chore: release v${version}"
  },
  "github": {
    "release": true
  }
}

โ†’ See Configuration for more details.

Interactive vs. CI mode

By default, release-it is interactive and allows you to confirm each task before execution:

By using the --ci option, the process is fully automated without prompts. The configured tasks will be executed as demonstrated in the first animation above. In a Continuous Integration (CI) environment, this non-interactive mode is activated automatically.

Use --only-version to use a prompt only to determine the version, and automate the rest.

Latest version

How does release-it determine the latest version?

  1. For projects with a package.json, its version will be used (see npm to skip this).
  2. Otherwise, release-it uses the latest Git tag to determine which version should be released.
  3. As a last resort, 0.0.0 will be used as the latest version.

Alternatively, a plugin can be used to override this (e.g. to manage a VERSION or composer.json file):

Add the --release-version flag to print the next version without releasing anything.

Git

Git projects are supported well by release-it, automating the tasks to stage, commit, tag and push releases to any Git remote.

โ†’ See Git for more details.

GitHub Releases

GitHub projects can have releases attached to Git tags, containing release notes and assets. There are two ways to add GitHub releases in your release-it flow:

  1. Automated (requires a GITHUB_TOKEN)
  2. Manual (using the GitHub web interface with pre-populated fields)

โ†’ See GitHub Releases for more details.

GitLab Releases

GitLab projects can have releases attached to Git tags, containing release notes and assets. To automate GitLab releases:

โ†’ See GitLab Releases for more details.

Changelog

By default, release-it generates a changelog, to show and help select a version for the new release. Additionally, this changelog serves as the release notes for the GitHub or GitLab release.

The default command is based on git log .... This setting (git.changelog) can be overridden. To further customize the release notes for the GitHub or GitLab release, there's github.releaseNotes or gitlab.releaseNotes. Make sure any of these commands output the changelog to stdout. Note that release-it by default is agnostic to commit message conventions. Plugins are available for:

  • GitHub and GitLab Releases
  • auto-changelog
  • Conventional Changelog
  • Keep A Changelog

To print the changelog without releasing anything, add the --changelog flag.

โ†’ See Changelog for more details.

Publish to npm

With a package.json in the current directory, release-it will let npm bump the version in package.json (and package-lock.json if present), and publish to the npm registry.

โ†’ See Publish to npm for more details.

Manage pre-releases

With release-it, it's easy to create pre-releases: a version of your software that you want to make available, while it's not in the stable semver range yet. Often "alpha", "beta", and "rc" (release candidate) are used as identifiers for pre-releases. An example pre-release version is 2.0.0-beta.0.

โ†’ See Manage pre-releases for more details.

Update or re-run existing releases

Use --no-increment to not increment the last version, but update the last existing tag/version.

This may be helpful in cases where the version was already incremented. Here are a few example scenarios:

  • To update or publish a (draft) GitHub Release for an existing Git tag.
  • Publishing to npm succeeded, but pushing the Git tag to the remote failed. Then use release-it --no-increment --no-npm to skip the npm publish and try pushing the same Git tag again.

Hooks

Use script hooks to run shell commands at any moment during the release process (such as before:init or after:release).

The format is [prefix]:[hook] or [prefix]:[plugin]:[hook]:

part value
prefix before or after
plugin version, git, npm, github, gitlab
hook init, bump, release

Use the optional :plugin part in the middle to hook into a life cycle method exactly before or after any plugin.

The core plugins include version, git, npm, github, gitlab.

Note that hooks like after:git:release will not run when either the git push failed, or when it is configured not to be executed (e.g. git.push: false). See execution order for more details on execution order of plugin lifecycle methods.

All commands can use configuration variables (like template strings). An array of commands can also be provided, they will run one after another. Some example release-it configuration:

{
  "hooks": {
    "before:init": ["npm run lint", "npm test"],
    "after:my-plugin:bump": "./bin/my-script.sh",
    "after:bump": "npm run build",
    "after:git:release": "echo After git push, before github release",
    "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
  }
}

The variables can be found in the default configuration. Additionally, the following variables are exposed:

version
latestVersion
changelog
name
repo.remote, repo.protocol, repo.host, repo.owner, repo.repository, repo.project
branchName
releaseUrl

All variables are available in all hooks. The only exception is that the additional variables listed above are not yet available in the init hook.

Use --verbose to log the output of the commands.

For the sake of verbosity, the full list of hooks is actually: init, beforeBump, bump, beforeRelease, release or afterRelease. However, hooks like before:beforeRelease look weird and are usually not useful in practice.

Note that arguments need to be quoted properly when used from the command line:

release-it --'hooks.after:release="echo Successfully released ${name} v${version} to ${repo.repository}."'

Using Inquirer.js inside custom hook scripts might cause issues (since release-it also uses this itself).

Dry Runs

Use --dry-run to show the interactivity and the commands it would execute.

โ†’ See Dry Runs for more details.

Troubleshooting & debugging

  • With release-it --verbose (or -V), release-it prints the output of every user-defined hook.
  • With release-it -VV, release-it also prints the output of every internal command.
  • Use NODE_DEBUG=release-it:* release-it [...] to print configuration and more error details.

Use verbose: 2 in a configuration file to have the equivalent of -VV on the command line.

Plugins

Since v11, release-it can be extended in many, many ways. Here are some plugins:

Plugin Description
@release-it/bumper Read & write the version from/to any file
@release-it/conventional-changelog Provides recommended bump, conventional-changelog, and updates CHANGELOG.md
@release-it/keep-a-changelog Maintain CHANGELOG.md using the Keep a Changelog standards
@release-it-plugins/lerna-changelog Integrates lerna-changelog into the release-it pipeline
@jcamp-code/release-it-changelogen Use @unjs/changelogen for versioning and changelog
@release-it-plugins/workspaces Releases each of your projects configured workspaces
release-it-calver-plugin Enables Calendar Versioning (calver) with release-it
@grupoboticario/news-fragments An easy way to generate your changelog file
@j-ulrich/release-it-regex-bumper Regular expression based version read/write plugin for release-it
@jcamp-code/release-it-dotnet Use .csproj or .props file for versioning, automate NuGet publishing
release-it-pnpm Add basic support for pnpm workspaces, integrates with bumpp and changelogithub

Internally, release-it uses its own plugin architecture (for Git, GitHub, GitLab, npm).

โ†’ See all release-it plugins on npm.

โ†’ See plugins for documentation to write plugins.

Use release-it programmatically

While mostly used as a CLI tool, release-it can be used as a dependency to integrate in your own scripts. See use release-it programmatically for example code.

Example projects using release-it

Legacy Node.js

The latest major version is v17, supporting Node.js 18 and up (as Node.js v16 is EOL). The previous major version was v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see CHANGELOG.md.

Links

License

MIT

Are you using release-it at work? Please consider sponsoring me!

conventional-changelog's People

Contributors

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

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

conventional-changelog's Issues

Possible to use @release-it/conventional-changelog for only CHANGELOG generation and not automatic version bump?

I have the @release-it/conventional-changelog plugin added which of course handles the version bump automatically as well as CHANGELOG generation. I would still like to select the version manually, as you can without this plugin, but Iโ€™m unsure if there is a way to disable that particular step.

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

Is it possible to disable/skip the conventional-recommended-bump step?

npm audit issue

  • "release-it": "^15.1.1";
  • "@release-it/conventional-changelog": "^5.0.0";
  • npm 8.3.1

Hi, I get this message after running the npm audit fix command
Screenshot 2022-07-06 at 12 55 02
Can someone help please?

`gitRawCommitsOpts` support

By default conventional-changelog doesn't include merge commits, this can be fixed via gitRawCommitsOpts: {merges: true} (tested on the latest version), unfortunately, there is no way to set this option.

image

Should not include release-it as dependency

This package includes release-it as a dependency:

"release-it": "^13.5.6"

I believe it shouldn't do that and instead have it in devDependencies.

The reasoning is that this is a plugin for release-it so release-it must be installed separately anyway and this makes it so that there are two different versions of release-it included in the project.

skipUnstable does nothing

First of all, thanks a lot for this great library! The README.md states (emphasis mine):

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

However, changelog is still produced for pre-releases (tested with rc and alpha). This is the relevant part of my package.json

  "release-it": {
    "git": {
      "commitMessage": "chore: release ${version}",
      "tagName": "v${version}"
    },
    "npm": {
      "publish": true
    },
    "github": {
      "release": true
    },
    "plugins": {
      "@release-it/conventional-changelog": {
        "preset": "angular",
        "infile": "CHANGELOG.MD",
        "skipUnstable": true
      }
    }
  }

The option is documented here. Result:
2020-08-20-150851_652x290_scrot

Please note that release-it is not a global install, but an alias to npx release-it

'Cannot read property 'replace' of undefined'

Get 'Cannot read property 'replace' of undefined' when run programmatically. Setting with 'git: false'.

A little back-searching, it seems to be tagTemplate that is undefined in getChangelogStream.

Rolling back to 3.0.1 works.

Allow to override bump

Since release-it 12, version number or bump given manually, like release-it patch or release-it 1.0.0 is ignored when using conventional changelog.

As said in release-it/release-it#526 this is a feature that can be useful sometimes when for some reasons you want to bypass the auto bump and release a specific version.

I'd love to see that feature back ๐Ÿ™‡

Option to edit the changelog while releasing

Is it possible to do this?

Very often, I like to manually tweak or cleanup the changelog during a release. Especially when the changelog is based on commit messages that cannot be edited and might contain typos or use the wrong prefixes/headers.

A related plugin, @release-it-plugins/lerna-changelog, has an option launchEditor that enables this.

Ignore version bump for non-conventional commits

In most conventions supported with conventional-changelog, there are commit types that should not trigger a version bump.

For example, when using the angular or conventionalcommits preset, version bumps should only be applicable if using commits that begin with fix, feat, or other types that include a ! to signify a BREAKING CHANGE.

For commit messages that either do not conform to the types for the specified preset or are not one of the types listed above that signify a version change, release-it and this plugin should ignore the creation of a new semver release.

Is this achievable by this plug-in, since it overrides the standard version bump logic that happens in release-it?

conventionalcommits types use same heading level as new version

When generating the changelog with the conventionalcommits preset, the generated changelog will look like this:

### [1.0.1](<Url to diff>) (2022-09-06)


### Bug Fixes

* <commit message> ([<commit id>](<link to commit>))

I would expect the heading level of the new version to be 2 (## [1.0.1] ...)

v1.1.1 is a BREAKING change from v1.1.0

Hello,

We currently used [email protected] and @release-it/[email protected]. We release against Node 8.11.4. We also test against Node v10.5.

[email protected] and @release-it/[email protected] are both BREAKING CHANGES in our release process (Node 8).

@release-it/[email protected] requires [email protected], which itself requires Node v10.6 or greater. Therefore, the stated requirement Node > 10 is not accurate.

Fyi, one of the breaking Release-it dependencies is cacheable-lookup, which requires a method introduced in Node v10.6.

@release-it/[email protected] requires release-it@13, which dropped Node 8 support.

@release-it/conventional-changelog - Option for no change log

Hello and thanks for the tool.

I am trying out release-it. In my monorepo, I use conventional commits, so I therefore want release-it to auto-increment the version based on the commit history. Thus, it seems like I need to use the @release-it/conventional-changelog plugin to do this. However, I don't want to generate a changelog. And it seems like this plugin always generates a changelog.

Will you accept a PR for a new option that disables the changelog?

Semver is not declared in dependencies

Hi y'all!

I'm trying to use this with Yarn berry, but I'm running into an issue:

ERROR @release-it/conventional-changelog tried to access semver, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: semver (via "semver/package.json")
Required by: @release-it/conventional-changelog@virtual:f8628a01fc8a0c88efe1afe17f2bd962a545e2644e7bc646f13ee6114785601dea0fc25e5105597cdbff6bdbc249a1f8dc91aaafa859915fd961e5dec7c0ab9f#npm:5.0.0 (via /Users/cravend/src/html/object-access/.yarn/__virtual__/@release-it-conventional-changelog-virtual-9949b6766b/0/cache/@release-it-conventional-changelog-npm-5.0.0-19f49b5e03-205a743018.zip/node_modules/@release-it/conventional-changelog/index.js)

Is there any reason semver shouldn't be included in the dependencies array?

Only last commit made has effect on verison bump and written to changelog

Hello.
In my release-it + @release-it/conventional-changelog setup only last commit made is affecting version bump and written to the changelog.
Also only last commit is taken in to consideration when bumping a version.
So if:

  • v0.1.0
  • commit feat
  • commit fix <= this one used
  • v0.1.1 (not v0.2.0)

Example repo: https://github.com/b12k/gh-action-release-it

This repo uses github action to do an automated release on PR merge to master (using rebase).

I would appreciate some advice on why it may happen.

Thanx in advance.

UPDATE:

Here is git log
  commit af26c4a5effc9caa01d6110741e991e83bdeb0f5 (HEAD -> master, origin/master)
  Author: ci <[email protected]>
  Date:   Wed Feb 10 12:33:08 2021 +0000
  
      ci: release 0.1.2
  
  commit 9fc3e73f36beca6dc351e9bee40cb6f6792e96a7
  Author: Bogdan Kolesnyk <[email protected]>
  Date:   Wed Feb 10 13:31:56 2021 +0100
  
      fix: dummy fix commit
  
  commit 6714424d45175ef420f39e82f88e611489a61fbc
  Author: Bogdan Kolesnyk <[email protected]>
  Date:   Wed Feb 10 13:31:35 2021 +0100
  
      feat: enable debug mode
  
  commit f07d4f5984f1d3388f6fff687bd1a86beb2878f1
  Author: ci <[email protected]>
  Date:   Wed Feb 10 12:19:26 2021 +0000
  
      ci: release 0.1.1
  
  commit 560aa843694f8ec3e23c9194a55203c69e8c55cf
  Author: Bogdan Kolesnyk <[email protected]>
  Date:   Wed Feb 10 13:18:23 2021 +0100
  
      fix: fix 1
  
  commit daddac8be0da536e1b1ce4ccd170392fb76cf3cf
  Author: Bogdan Kolesnyk <[email protected]>
  Date:   Wed Feb 10 13:17:55 2021 +0100
  
      feat: feat 2
  
  commit 48a71f8e81c23ba3efce6fe39cf07a2801221a82
  Author: ci <[email protected]>
  Date:   Wed Feb 10 11:32:27 2021 +0000
  
      ci: release 0.1.0
  
  commit 39f3e39a71b456e206674bc1ad2b17682ec42fef
  Author: Bogdan Kolesnyk <[email protected]>
  Date:   Wed Feb 10 12:31:24 2021 +0100
  
      feat: feat 1
  
  commit df1d2d0457145a4ca79832259c51d4ca6026332c
  Author: Bogdan Kolesnyk <[email protected]>
  Date:   Wed Feb 10 12:29:55 2021 +0100
  
      initial
Debug
  > [email protected] release /home/runner/work/gh-action-release-it/gh-action-release-it
  > DEBUG=release-it:* release-it --git.requireBranch=master
  
  2021-02-10T12:33:07.678Z release-it:config {
    cosmiconfig: {
      config: {
        plugins: [Object],
        git: [Object],
        npm: [Object],
        github: [Object]
      },
      filepath: '/home/runner/work/gh-action-release-it/gh-action-release-it/package.json'
    }
  }
  2021-02-10T12:33:07.682Z release-it:config {
    system: { 'release-it': '14.3.0', node: 'v12.20.1', os: 'Linux 5.4' }
  }
  2021-02-10T12:33:07.682Z release-it:config {
    _: [],
    git: {
      requireBranch: 'master',
      push: true,
      commitMessage: 'ci: release ${version}',
      pushArgs: [ '--follow-tags' ],
      changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
      requireCleanWorkingDir: true,
      requireUpstream: true,
      requireCommits: false,
      addUntrackedFiles: false,
      commit: true,
      commitArgs: [],
      tag: true,
      tagName: null,
      tagAnnotation: 'Release ${version}',
      tagArgs: [],
      pushRepo: ''
    },
    increment: undefined,
    ci: true,
    plugins: {
      '@release-it/conventional-changelog': { infile: 'CHANGELOG.md', preset: [Object] }
    },
    npm: {
      publish: false,
      publishPath: '.',
      tag: null,
      otp: null,
      ignoreVersion: false,
      skipChecks: false,
      timeout: 10
    },
    github: {
      release: true,
      releaseName: 'Release ${version}',
      releaseNotes: null,
      preRelease: false,
      draft: false,
      tokenRef: 'GITHUB_TOKEN',
      assets: null,
      host: null,
      timeout: 0,
      proxy: null,
      skipChecks: false
    },
    hooks: {},
    gitlab: {
      release: false,
      releaseName: 'Release ${version}',
      releaseNotes: null,
      tokenRef: 'GITLAB_TOKEN',
      assets: null,
      origin: null,
      skipChecks: false
    },
    isUpdate: false,
    version: {
      increment: undefined,
      isPreRelease: false,
      preReleaseId: undefined
    }
  }
  2021-02-10T12:33:07.846Z release-it:config {
    'conventional-changelog': {
      infile: 'CHANGELOG.md',
      preset: { name: 'angular', types: [Array] }
    }
  }
  2021-02-10T12:33:07.847Z release-it:plugins {
    namespace: 'conventional-changelog',
    options: {
      infile: 'CHANGELOG.md',
      preset: { name: 'angular', types: [Array] },
      tagName: null
    }
  }
  2021-02-10T12:33:07.857Z release-it:plugins {
    namespace: 'npm',
    options: {
      publish: false,
      publishPath: '.',
      tag: null,
      otp: null,
      ignoreVersion: false,
      skipChecks: false,
      timeout: 10
    }
  }
  2021-02-10T12:33:07.859Z release-it:plugins {
    namespace: 'github',
    options: {
      release: true,
      releaseName: 'Release ${version}',
      releaseNotes: null,
      preRelease: false,
      draft: false,
      tokenRef: 'GITHUB_TOKEN',
      assets: null,
      host: null,
      timeout: 0,
      proxy: null,
      skipChecks: false,
      tagName: null,
      pushRepo: '',
      changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
      isUpdate: false
    }
  }
  2021-02-10T12:33:07.863Z release-it:plugins {
    namespace: 'git',
    options: {
      requireBranch: 'master',
      push: true,
      commitMessage: 'ci: release ${version}',
      pushArgs: [ '--follow-tags' ],
      changelog: 'git log --pretty=format:"* %s (%h)" ${from}...${to}',
      requireCleanWorkingDir: true,
      requireUpstream: true,
      requireCommits: false,
      addUntrackedFiles: false,
      commit: true,
      commitArgs: [],
      tag: true,
    repo: 'gh-action-release-it',
    tag_name: '0.1.2',
    name: 'Release 0.1.2',
    body: '## 0.1.2 (2021-02-10)\n' +
      '\n' +
      '\n' +
      '### Bug Fixes\n' +
      '\n' +
      '* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))',
    draft: false,
    prerelease: false
  }
  POST /repos/b12k/gh-action-release-it/releases - 201 in 407ms
  2021-02-10T12:33:12.044Z release-it:github {
    url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/37858104',
    assets_url: 'https://api.github.com/repos/b12k/gh-action-release-it/releases/37858104/assets',
    upload_url: 'https://uploads.github.com/repos/b12k/gh-action-release-it/releases/37858104/assets{?name,label}',
    html_url: 'https://github.com/b12k/gh-action-release-it/releases/tag/0.1.2',
    id: 37858104,
    author: {
      login: 'b12k',
      id: 10243265,
      node_id: 'MDQ6VXNlcjEwMjQzMjY1',
      avatar_url: 'https://avatars.githubusercontent.com/u/10243265?v=4',
      gravatar_id: '',
      url: 'https://api.github.com/users/b12k',
      html_url: 'https://github.com/b12k',
      followers_url: 'https://api.github.com/users/b12k/followers',
      following_url: 'https://api.github.com/users/b12k/following{/other_user}',
      gists_url: 'https://api.github.com/users/b12k/gists{/gist_id}',
      starred_url: 'https://api.github.com/users/b12k/starred{/owner}{/repo}',
      subscriptions_url: 'https://api.github.com/users/b12k/subscriptions',
      organizations_url: 'https://api.github.com/users/b12k/orgs',
      repos_url: 'https://api.github.com/users/b12k/repos',
      events_url: 'https://api.github.com/users/b12k/events{/privacy}',
      received_events_url: 'https://api.github.com/users/b12k/received_events',
      type: 'User',
      site_admin: false
    },
    node_id: 'MDc6UmVsZWFzZTM3ODU4MTA0',
    tag_name: '0.1.2',
    target_commitish: 'master',
    name: 'Release 0.1.2',
    draft: false,
    prerelease: false,
    created_at: '2021-02-10T12:33:08Z',
    published_at: '2021-02-10T12:33:11Z',
    assets: [],
    tarball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/tarball/0.1.2',
    zipball_url: 'https://api.github.com/repos/b12k/gh-action-release-it/zipball/0.1.2',
    body: '## 0.1.2 (2021-02-10)\n' +
      '\n' +
      '\n' +
      '### Bug Fixes\n' +
      '\n' +
      '* dummy fix commit ([9fc3e73](https://github.com/b12k/gh-action-release-it/commit/9fc3e73f36beca6dc351e9bee40cb6f6792e96a7))'
  }
  ๐Ÿ”— https://github.com/b12k/gh-action-release-it/releases/tag/0.1.2
  2021-02-10T12:33:12.090Z release-it:metrics {
  ๐Ÿ Done (in 4s.)
    url: 'http://www.google-analytics.com/collect',
    statusCode: 200,
    statusMessage: 'OK',
    payload: 't=event&ec=session&ea=end'
  }

Incorrect bump version

Thanks for the amazing lib.

I've created a workflow with release-it that mixes pre-release and official release and I found a bug in the default behavior.

release-it is not bumped correctly pre-releases. As you can see in the examples below.

I've used standard-version lib to compare.

Check this test:

release-it standard-version

As you can see, release-it jumps from official release 1.0.0 to 2.0.1, on the other hand, standard-version does as expected.

Version

  "devDependencies": {
    "@release-it/conventional-changelog": "5.1.1",
    "release-it": "15.6.0"
  },

Config

{
  "git": {
    "commitMessage": "chore(release): ${version}",
    "push": false
  },
  "github": {
    "release": false
  },
  "npm": {
    "publish": false
  },
  "gitlab": {
    "release": false
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "conventionalcommits",
      "strictSemVer": true,
      "context": {
        "linkCompare": true
      },
      "infile": "CHANGELOG.md"
    }
  }
}

I have used only the commands :

  • release-it --ci for official release
  • release-it --ci --preRelease=alpha for pre-release

Similar command in standard-version

  • standard-version for official release
  • standard-version --prerelease alpha for pre-release

ConventionalChangelog fails after release-it 14.11.5

ConventionalChangelog fails after release-it 14.11.5

Using @release-it/conventional-changelog under the latest version of release-it (14.11.7) found that the CHANGELOG record lost the version information, like this:

Changelog:
* build: update @release-it/conventional-changelog (a31d21f)
* build: Update all package versions (4087cbe)

Comparing the two versions, it is found that the plug-in cannot get the version number.

It is shown in release-it/lib/tasks.js and release- it/conventional-changelog/index.js

Overriding preset's default configuration

Hello.
First of all thank you for a great tool! ๐Ÿ‘Œ

I'm trying to pass some properties to override conventinalcommits default config.
I've found this closed issue: #8
But unfortunately that solution doesn't works incorrectly for me. Am I doing something wrong?

package.json:

"devDependencies": {
  "@release-it/conventional-changelog": "^2.0.0",
  "release-it": "^14.3.0"
  ...
},
"release-it": {
    "plugins": {
      "@release-it/conventional-changelog": {
        "infile": "CHANGELOG.md",
        "preset": {
          "name": "conventionalcommits",
          "types": [
            {
              "type": "feat",
              "section": "Features"
            },
            {
              "type": "fix",
              "section": "Bug Fixes"
            },
            {
              "type": "docs",
              "section": "Documentation"
            },
            {
              "type": "style",
              "section": "Styles"
            },
            {
              "type": "refactor",
              "section": "Refactoring"
            },
            {
              "type": "perf",
              "section": "Performance"
            },
            {
              "type": "test",
              "section": "Tests"
            },
            {
              "type": "build",
              "section": "Build System"
            },
            {
              "type": "ci",
              "hidden": true
            },
            {
              "type": "chore",
              "section": "Miscellaneous Chores"
            },
            {
              "type": "revert",
              "section": "Reverted"
            }
          ]
        }
      }
    }
  ...
  }

UPDATE:
I created multiple commits;

  • Feature commit
  • Chore commit
  • Docs commit
  • Build commit

But only "Build" got into change log.

Thank you in advance!

Problem with changelog generation and version bumping

Hello.
I'm facing some problems with release Changelog generation and sometime version bumping.
I'm using release-it in multiple projects and have some problems, which I think are related to conventional-changelog plug-in.

Problem #1:

Every time we do a release - commits from all previous releases are mentioned in new release.
It affects version bumping.

v0.3.0 => expected 0.1.2
  fix: some fix 2
  fix: some fix 1
  feat: some feature 1
v0.2.0 => expected 0.1.0
  fix: some fix 1
  feat: some feature 1
v0.1.0
  feat: some feature 1

Problem #2:

Example repo: https://github.com/b12k/release-test

Changelog is badly generated (Sorry for bad description ^_^ ). You can compare change log of example repo with releases.

Release-it is configured the same way in both projects with

"preset": "conventionalcommits"

I assume the problem is not in the conventional-changelog or conventional-recommended-bump but either with this plug-in or my hands =)

Thanx in advance!

Preset's `header` option not being passed through?

Thanks for this helpful plugin :-). I think I've set the header option for the preset in the correct place, but no (<h1>) header is written to the changelog file. This happens regardless of whether this is the first release (with no changelog already) or whether there has already been a release.

๏ปฟ{
  "git": {
    "commitMessage": "chore(release): ${version}"
  },
  "github": {
    "release": true
  },
  "npm": {
    "publish": false
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "infile": "CHANGELOG.md",
      "preset": {
        "header": "Changelog",
        "name": "conventionalcommits",
        "types": [
          {
            "section": "Features",
            "type": "feat"
          },
          {
            "section": "Bug fixes",
            "type": "fix"
          },
          {
            "section": "Documentation",
            "type": "docs"
          },
          {
            "section": "Styles",
            "type": "style"
          },
          {
            "section": "Code refactoring",
            "type": "refactor"
          },
          {
            "section": "Performance improvements",
            "type": "perf"
          },
          {
            "section": "Tests",
            "type": "test"
          },
          {
            "section": "Builds",
            "type": "build"
          },
          {
            "section": "Continuous integrations",
            "type": "ci"
          },
          {
            "section": "Chores",
            "type": "chore"
          },
          {
            "section": "Reverts",
            "type": "revert"
          }
        ]
      },
      "writerOpts": {
        "headerPartial": "## {{#if @root.linkCompare~}} [{{version}}]({{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}) {{~else}} {{~version}} {{~/if}} {{~#if title}} \"{{title}}\" {{~/if}} {{~#if date}} ({{date}}) {{/if}}\n"
      }
    }
  }
}

Cannot read property 'ignoreRecommendedBump' of undefined

I am trying to use this plugin with release-it to auto-generate the change-logs but when I tried to run the release-it patch script, I am getting:

> release-it "patch"

ERROR Cannot read property 'ignoreRecommendedBump' of undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! <package_name>@0.1.7 release: `release-it "patch"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the <package_name>@0.1.7 release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

.release-it.json file content:

{
  "git": {
    "commitMessage": "chore: release v${version}"
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "angular",
      "infile": "CHANGELOG.md"
    }
  }    
}

Dependencies versions:
"@release-it/conventional-changelog": "^3.0.1",
"release-it": "^14.6.2"

Unacceptable kind of an object to dump [object Undefined]

When attempting to use the conventional-changelog plugin in a newly created repo with no existing versions in git tags, conventional-changelog fails to properly set an initial version of 0.0.1 that should be provided by the release-it core bump module.

๐Ÿš€ Let's release cics (currently at null)

Changelog:
##  (2021-06-28)

### Features
* foo
* bar

### Fixes
* foo

### Doc Updates
* foo

### CI Changes
* foo
* bar

ERROR unacceptable kind of an object to dump [object Undefined]

To get around this error, an initial version must be pushed with release-it -i. Then all following conventional-changelog versioning works as expected.

Full history not being added without infile

In the readme it says that Set a filename as infile to write the changelog to. If this file does not exist yet, it's created with the full history. However for me that does not happen. I'm not sure if I'm doing something wrong.

After running the release-it command, I can see in the log that the changelog file is created:

โžœ  testing-repo git:(main) โœ— npm run release

> [email protected] release
> release-it


๐Ÿš€ Let's release testing-repo (1.1.0...1.2.0)


Changelog:
## [1.2.0](...../testing-repo/compare/v1.1.0...v1.2.0) (2022-10-16)

### Features
....

### Bug Fixes
....

Changeset:
M  .release-it.json
A  CHANGELOG.md
 M package-lock.json
 M package.json

However I'm only getting the changelog since the latest tag, not the full history.

Here is my .release-it.json config:


{
  "git": {
    "commitMessage": "release v${version}",
    "requireCleanWorkingDir": false
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "conventionalcommits",
      "infile": "CHANGELOG.md"
    }
  },
  "npm": {
    "publish": false
  }
}

Am I missing something super obvious, or is this a bug?

parserOpts not always passed to conventional-commits-parser

My config for the conventionalcommits preset includes a commit type "breaking" which will then write a "Breaking Changes".
I was wondering why the recommended bump wasn't a major version with commits with that type.
Then I found out that a major level release is recommended when the commit contains a note (See: https://github.com/conventional-changelog/conventional-changelog/blob/840d139c40a2c4e773794d794c34bc4dbfde27c2/packages/conventional-changelog-conventionalcommits/conventional-recommended-bump.js#L20 ). A note is detected via the noteKeywords config option for conventional-commits-parser (See: https://github.com/conventional-changelog/conventional-changelog/blob/840d139c40a2c4e773794d794c34bc4dbfde27c2/packages/conventional-commits-parser/lib/regex.js#L21 ).
The parser can be configured, as @release-it/conventional-changelogs points out: https://github.com/release-it/conventional-changelog#parseropts

But it didn't work. I added some console messages to getNotesRegex in conventional-commits-parser/lib/regex.js:

  console.trace();
  console.log(noteKeywords);

That gave me the following output:

thet@then:/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns$ release-it patch --dry-run
$ npm ping
$ npm whoami
$ npm show @patternslib/patternslib@latest version
$ npm access ls-collaborators @patternslib/patternslib
WARNING Latest version in registry (5.5.1) does not match package.json (5.5.0).
$ git rev-parse --abbrev-ref HEAD
$ git diff --quiet HEAD
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git config --get branch.master.remote
$ git remote get-url origin
! git fetch
$ git describe --tags --match=* --abbrev=0
$ git symbolic-ref HEAD
$ git for-each-ref --format="%(upstream:short)" refs/heads/master
$ git rev-parse --abbrev-ref HEAD  [cached]
$ git config --get branch.master.remote  [cached]
$ git remote get-url origin  [cached]
! git fetch
$ git describe --tags --match=* --abbrev=0  [cached]
WARNING Environment variable "GITHUB_TOKEN" is required for automated GitHub Releases.
WARNING Falling back to web-based GitHub Release.
Trace
    at getNotesRegex (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:22:11)
    at module.exports (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:54:19)
    at conventionalCommitsParser (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/index.js:74:15)
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-recommended-bump/index.js:78:15
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/git-semver-tags/index.js:66:5
    at ChildProcess.exithandler (child_process.js:374:7)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Socket.<anonymous> (internal/child_process.js:443:11)
    at Socket.emit (events.js:400:28)
[ 'BREAKING CHANGE' ]
/^[\s|*]*(BREAKING CHANGE)[:\s]+(.*)/i
WARNING The recommended bump is "patch", but is overridden with "patch".
Trace
    at getNotesRegex (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:22:11)
    at module.exports (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:54:19)
    at conventionalCommitsParser (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/index.js:74:15)
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-changelog-core/index.js:93:15
    at _fulfilled (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:854:54)
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:883:30
    at Promise.promise.promiseDispatch (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:816:13)
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:624:44
    at runSingle (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:137:13)
    at flush (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/q/q.js:125:13)
[ 'breaking' ]
/^[\s|*]*(breaking)[:\s]+(.*)/i
$ git log --pretty=format:"* %s (%h)" 5.5.0...HEAD
Trace
    at getNotesRegex (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:22:11)
    at module.exports (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/lib/regex.js:54:19)
    at conventionalCommitsParser (/home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-commits-parser/index.js:74:15)
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/conventional-recommended-bump/index.js:78:15
    at /home/_thet/data/dev/syslab/REPOS/patternslib/Patterns/node_modules/git-semver-tags/index.js:66:5
    at ChildProcess.exithandler (child_process.js:374:7)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
[ 'BREAKING CHANGE' ]
/^[\s|*]*(BREAKING CHANGE)[:\s]+(.*)/i

๐Ÿš€ Let's release @patternslib/patternslib (5.5.0...5.5.1)

[...]

Apparently the config is only applied once in three times.

This is my .release-it.js config:

const fs = require("fs");
const path = require("path");

const commits_template = fs
    .readFileSync(path.resolve(".release-it", "conventional-changelog-commit.hbs"))
    .toString();

module.exports = {
    npm: {
        publish: true,
    },
    git: {
        requireBranch: "master",
        commitMessage: "Release new version.",
        commitArgs: ["-n"],
    },
    github: {
        release: true,
    },
    plugins: {
        "@release-it/conventional-changelog": {
            infile: "CHANGES.md",
            preset: {
                name: "conventionalcommits",
                types: [
                    {
                        type: "breaking",
                        section: "Breaking Changes",
                    },
                    {
                        type: "feat",
                        section: "Features",
                    },
                    {
                        type: "fix",
                        section: "Bug Fixes",
                    },
                    {
                        type: "maint",
                        section: "Maintenance",
                    },
                ],
            },
            parserOpts: {
                noteKeywords: ["breaking"],
            },
            writerOpts: {
                commitPartial: commits_template,
            },
        },
    },
};

How to run a command after the changelog is generated?

I recently upgraded from version 10 and I got an issue with the order in which things are done. Hereโ€™s my config:

{
  "scripts": {
    "afterRelease": "npm run deploy",
    "afterBump": "npm run build"
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "angular",
      "infile": "CHANGELOG.md"
    }
  }
}

In previous release-it versions, the bump and the changelog used to be done before my npm run build command was run. It was perfect for me as I use the changelog in this command. Now the changelog gets written after the build, which cause the changelog of the previous version to be used.

I tried to change the afterBump to beforeStage or beforeRelease like it is in the conventional-changelog plugin but the changelog still gets written after.

I think there was a safeBump option previously to avoid that but I saw it got deprecated and removed from the docs. What would be the new way of running a command after the changelog is written but before stage?

(Sorry if this is more a question for the main repository)

For reference, hereโ€™s how I used to do it with previous versions:

{
  "increment": "conventional:angular",
  "scripts": {
    "changelog": "conventional-changelog -p angular | tail -n +3",
    "beforeStage": "conventional-changelog -p angular -i CHANGELOG.md -s",
    "afterRelease": "npm run deploy",
    "afterBump": "npm run build"
  }
}

origin vs upstream changelog

Hello! By default when I run release-it it will create changelogs based on my origin remote. I want to change that behaviour and use upstream remote to generate the changelog. Is there a way to do it? I used git.pushRepo setting but it didn't work. Thank you

Missing separator (newline) when prepending content in changelog file

Hello !

Since v4.2.0, there is no more newline between the newly prepended changelog and the previous changelog, resulting to something like this:

* last line ([1a2b3c](https://gitlab.com/.../commit/1a2b3c))## [1.4.0](https://gitlab.com/.../compare/1.3.1...1.4.0) (2022-04-05)

Here is my plugins config in .release-it.json:

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "ignoreRecommendedBump": true,
      "infile": "CHANGELOG.md",
      "preset": {
        "name": "conventionalcommits",
        "issueUrlFormat": "https://gitlab.com/{{id}}",
        "types": [
          { "type": "feat", "section": "Features" },
          { "type": "fix", "section": "Bug Fixes" },
          { "type": "chore", "section": "Chore" },
          { "type": "build", "hidden": true },
          {}
        ]
      }
    }
  }
}

changelog does not update properly when using CalVer scheme

I'm using the following configuration:

{
  "git": {
    "tagName": "v${version}",
    "commitMessage": "release: v${version}",
    "pushArgs": ["--follow-tags", "-o ci.skip"]
  },
  "plugins": {
    "@csmith/release-it-calver-plugin": {
      "format": "YY.MM.DD.MICRO"
    },
    "@release-it/conventional-changelog": {
      "preset": "conventionalcommits",
      "infile": "CHANGELOG.md"
    }
  },
  "npm": false
}

However my CHANGELOG is not updated as expected. Here is the relevant output from my pipeline:

๐Ÿš€ Let's release xxx (20.11.20.0...20.11.30.0)
Changelog:
## [](xxx/v20.11.20.0...vnull) (2020-11-30)
### Features
* List of items that are already found in a previous release

Since it doesn't resolve the diff name, it seems that is simply copies all the features from the previous release. Notice that the feature list is populated correctly with commit hash references.

I have boostrapped the CHANGELOG.md file to have the following entries:

### [v20.11.20.0](xxx/compare/v20.11.19.1...v20.11.20.0) (2020-11-20)


## [v20.11.19.1](xxx/compare/v20.11.19.0...v20.11.19.1) (2020-11-19)


### Features

* List of features

## [v20.11.19.0](xxx/compare/vnull...v20.11.19.0) (2020-11-19)

### Features

* List of features

I am under the impression that the CalVer Plugin should be able to work with conventional-changelog, unless that is not the case ?

Aggregate all the pre releases

Hi,

is there any way how to aggregate pre releases in changelog and create single (minor version) entry?

Using release-it minor --git.tagExclude='*[-]*' generates changelog with each pre release.

Ideal flow:

release-it minor // e.g. 1.1.0
release-it minor --preRelease=beta // 1.2.0-beta.0 => commit, tag, gitlab release but skip changelog?
release-it --preRelease // 1.2.0-beta.1 => commit, tag, gitlab release but skip changelog?
release-it minor // 1.2.0 => commit,tag,release and create aggregated changelog from 1.1.0 to 1.2.0 (do not show pre releases)

or update changelog on pre releases, and ideally remove those entries on minor release and create aggregated changelog?

Thanks

Behavior re. GitHub release update with conventional-changelog

@webpro strange behavior now, that didn't exist before:

  • The changelog includes the previous version
  • The GitHub release plugin updates the previous release with the current release notes, and the new release version, and does not create a new release, effectively destroying release history

Using --no-increment with --github.release is deprecated. Add --github.update in release-it v15.
๐Ÿš€ Let's update release-it (currently at 0.6.1)
Changelog:

0.6.1 (2021-08-13)

0.6.0 (2021-08-07)

Features

  • fail if required inputs are not set (a003cf1)

Bug Fixes

  • imports (7c25850)
  • properly handle error (42e50d4)
  • remote branch not detected (94e47bb)
  • remote branch not detected (9de163d)
  • set property requiredUpstream of undefined (7f18842)
  • unhandled promise rejection (45812c9)

Originally posted by @TheRealWaldo in #26 (comment)

Allow overriding gitRawCommitOps

As part of the arguments passed to conventional-changelog -> https://github.com/release-it/conventional-changelog/blob/master/index.js

const { version, previousTag, currentTag } = this.getContext();
    return conventionalChangelog(
      Object.assign(options, this.options),
      { version, previousTag, currentTag },
      {
        debug: this.config.isDebug ? this.debug : null
      }
    );

it doesn't let us override things like from in the 3rd argument for gitRawCommitOps https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-core#gitrawcommitsopts

The use-case would be in order to specify the changelog between two pre-releases. given a set of pre-releases like:

1.0.0-alpha.0
1.0.0-alpha.1
1.0.0-beta.0
1.0.0-beta.1

^ I can generate a changelog between 1.0.0-alpha.0..1.0.0-beta.1 by passing from and to arguments.

would it be possible to get a feature request that allows something like overriding these from the commandline?

release-it --plugin.conventional-changelog.gitRawCommitOps.from=1.0.0-alpha.0 --plugin.conventional-changelog.gitRawCommitOps.to=1.0.0-beta.1

or is there no way to pass plugin options via the command line?

npm install creates a big package.json and node_modules directory

My context is to use the conventional-changelog in a non-npm project (actually a bash project). Running the command to install the module creates a 127Kb package.json file, and a node_modules directory with 327 sub-directories. Is this expected?

npm install --save-dev @release-it/conventional-changelog
npm WARN saveError ENOENT: no such file or directory, open '/Users/testuser/git_projects/pi/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/testuser/git_projects/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

Duplicated `# Changelog` header in the updated `infile`

relase-it config

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

The generated infile(e.g. Changelog.md) would have multiple # Changelog headers like this:

# Changelog

## v1.2.3 (2021-11-21)
...

# Changelog

## v1.2.2 (2021-11-16)
...

Generally, we want only one h1 in a document but this behavior cannot be achieved through configuration because writeChangelog() would always prepend new changelog to the infile:

async writeChangelog() {
    ...
    let { changelog } = this.config.getContext();
    ...
    await prependFile(infile, changelog + EOL + EOL);

Wheninfile already has # Changelog and changelog has another # Changelog. We'll get several # Changelog header after several version bumps.

I also figure out that there's a relational rejected PR #18 resolves this problem.

Error when using conventional-changelog in existing project

I am able to make a release without a conventional-changelog but when I add conventional changelog to a git repo, I get the below error. This error goes away if I remove .git folder and create a new repository.

ฮป npm run release

> [email protected] release D:\work\temp3
> dotenv release-it --

events.js:353
      throw er; // Unhandled 'error' event
      ^

Error: fatal: ambiguous argument 'v4.0.1..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

    at Transform._transform (D:\work\temp3\node_modules\git-raw-commits\index.js:83:30)
    at Transform._read (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:177:10)
    at Transform._write (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:164:83)
    at doWrite (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:409:139)
    at writeOrBuffer (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:398:5)
    at Transform.Writable.write (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:307:11)
    at Socket.ondata (internal/streams/readable.js:745:22)
    at Socket.emit (events.js:388:22)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:280:11)
Emitted 'error' event on Readable instance at:
    at Transform._transform (D:\work\temp3\node_modules\git-raw-commits\index.js:83:16)
    at Transform._read (D:\work\temp3\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:177:10)
    [... lines matching original stack trace ...]
    at readableAddChunk (internal/streams/readable.js:280:11)

In release-it.js I have written the following code:

        '@release-it/conventional-changelog': {
            'preset': 'angular',
            'infile': 'CHANGELOG.md',
            'ignoreRecommendedBump': true,
        },
    }

How to pass config for presets

Hi,

I'm using conventionalcommits preset, and I want to pass config.types for it, how can I do that?

How I tried:

"plugins": {
    "@release-it/conventional-changelog": {
        "preset": "conventionalcommits",
        "types": [{ "type": "feat", "section": "Bug Fixes" }]
    }
}
"plugins": {
    "@release-it/conventional-changelog": {
        "preset": "conventionalcommits",
        "config": {
            "types": [{ "type": "feat", "section": "Bug Fixes" }]
        }
    }
}

None of this puts feat commits under bug fixes (I know it doesn't make any sense, it's just for trying)

Thanks!

Inform parseOpts and writerOpts

Hi, this is not an issue itself. It is more like a question.

How can I inform both parseOpts and writerOpts.
I see that conventional-changelog-core have an API like conventionalChangelogCore([options, [context, [gitRawCommitsOpts, [parserOpts, [writerOpts]]]]]), and I would like to pass some parameters to writerOpts like:

writerOpts: {
  groupBy: 'scope'
}

so I can group commits by scope instead of type by default.

Thank in advance.

Update conventional-changelog Dependency to Support Changelog Section Sort Order

Goal

Support sorting / ordering changelog sections i.e.

conventional-changelog-conventionalcommits: sort groups based on config types (#702) (#1002) (0e59f0c)
โ€” v6.1.0

Idea

In https://github.com/release-it/conventional-changelog, update dependency https://github.com/conventional-changelog/conventional-changelog (from 3.1.25) to v4.0.0, so it will include conventional-changelog-conventionalcommits v6.1.0.

Possibly Related Issues

Chagelog format conflicts with Prettier

I'm having issues where conventional-changelog adds extra space in the markdown file and when I run a build command before a release, Prettier modifies this file and I end up being unable to do the release:

โœ” npm run build
ERROR Working dir must be clean.
Please stage and commit your changes.
Documentation: https://git.io/release-it-git

I was thinking of adding the following hook in release-it.json to fix it but I don't know if this is the best solution?

{
  "hooks": {
    "after:conventional-changelog:bump": ["npx prettier --write ./CHANGELOG.md"]
  }
}

I'm not even sure the syntax is correct?

angular preset ignores Url formats

When generating the changelog with the angular preset, it ignores compareUrlFormat and commitUrlFormat presets and instead uses the default format

The "hidden" property doesn't work

The hidden property doesn't work for me. If I have this release-it config:

{
  "git": {
    "commit": true,
    "commitMessage": "chore(release): v${version}",
    "commitArgs": "",
    "tag": true,
    "tagName": "v${version}",
    "tagAnnotation": "v${version}",
    "push": true,
    "requireCommits": true,
    "requireUpstream": false
  },
  "npm": {
    "publish": false
  },
  "plugins": {
    "@release-it/conventional-changelog": {
      "preset": "angular",
      "infile": "CHANGELOG.md",
      "types": [
        { "type": "feat", "section": "Features", "hidden": false },
        { "type": "fix", "section": "Bug Fixes", "hidden": false },
        {
          "type": "perf",
          "section": "Performance Improvements",
          "hidden": false
        },
        { "type": "revert", "section": "Reverts", "hidden": false },
        { "type": "docs", "section": "Documentation", "hidden": false },
        { "type": "style", "section": "Styles", "hidden": false },
        { "type": "chore", "section": "Miscellaneous Chores", "hidden": false },
        { "type": "refactor", "section": "Code Refactoring", "hidden": false },
        { "type": "test", "section": "Tests", "hidden": false },
        { "type": "ci", "section": "Continuous Integration", "hidden": false }
      ]
    }
  }
}

...so I have hidden: false everywhere, despite of that only the Features and Bug Fixes section is visible in my CHANGELOG.md. It seems, that the hidden property doesn't have effect at all.
The command used to generating the changelog: release-it --ci. My release-it config file is called .release-it.json.

release-it version installed: 15.0.0
@release-it/conventional-changelog version installed: 5.0.0

Update peer deps to `release-it` v16

Even though release-it was released as v16, the conventional package still refers to v15 as peer deps, I think it should be updated. The main reason I'm asking is because of the latest security advisory shown by Dependabot, I'm not sure the normalize-package-data can be updated but still updating release-it to v16 in a step forward. Thanks

@release-it/[email protected] requires semver@2 || 3 || 4 || 5 via a transitive dependency on [email protected]
@release-it/[email protected] requires semver@^6.3.0 via a transitive dependency on [email protected]
@release-it/[email protected] requires semver@^6.3.0 via a transitive dependency on [email protected]
@release-it/[email protected] requires [email protected]

writerOpts: Cannot use readFile to pass a hbs template to writerOpts.

Insead of just passing a string containg the whole template to writerOpts.commitPartial I would like to read a template file and pass it's contents to it.

I tried with node's async fs.promises.readFile method, but failed.
I did a top-level await and did set the whole package.json of my project as { "type": "module" } which failed.
And I tried the code below, also failing because the commits_template is promise is actuallt not being resolved:

this is my .release-it.js config:

const fs = require("fs");
const path = require("path");

const commits_template = (async function () {
    return await fs.promises.readFile(
        path.resolve(".release-it-conventional-changelog-commit.hbs")
    ).data;
})();

module.exports = {
    [...]
    plugins: {
        "@release-it/conventional-changelog": {
            [...]
            writerOpts: {
                commitPartial: commits_template,
            },
        },
    },
};

Maybe release-it needs to await the import of the .release-it.js file?
Or maybe trying to interpret the commitPartial as a path and trying to read it?

Build error in react-native projects

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

Today I used patch-package to patch @release-it/[email protected] for the project I'm working on.

On react-native, I have the following error while building my project

Invalid Podfile unexpected token at 'Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports" in /Users/expo/workingdir/build/node_modules/@release-it/conventional-changelog/package.json

Here is the diff that solved my problem:

diff --git a/node_modules/@release-it/conventional-changelog/package.json b/node_modules/@release-it/conventional-changelog/package.json
index 004a8b5..f37dc9b 100644
--- a/node_modules/@release-it/conventional-changelog/package.json
+++ b/node_modules/@release-it/conventional-changelog/package.json
@@ -3,7 +3,9 @@
   "version": "5.0.0",
   "description": "Conventional changelog plugin for release-it",
   "type": "module",
-  "exports": "./index.js",
+  "exports": {
+    ".": "./index.js",
+    "./package.json": "./package.json"},
   "scripts": {
     "test": "bron test.js --serial",
     "release": "release-it"

This issue body was partially generated by patch-package.

If you agree with theses changes, I will make a PR

The recommended bump is "undefined"

I am trying to use this plugin but somehow get a The recommended bump is "undefined".

$ npm run release patch

> [email protected] release
> release-it patch

WARNING Environment variable "GITHUB_TOKEN" is required for automated GitHub Releases.
WARNING Falling back to web-based GitHub Release.
WARNING The recommended bump is "undefined", but is overridden with "patch".

๐Ÿš€ Let's release vega-embed (6.21.1...6.21.2)


Changelog:
## <small>6.21.2 (2023-02-13)</small>
* fix: upgrade deps including themes and tooltips, fixes version issues ([ba8ba18](https://github.com/vega/vega-embed/commit/ba8ba18))

Shouldn't the fix trigger a patch release?

High Severity Security Alert CVE-2021-33623

@webpro just came across a high severity vulnerability notice from my Dependabot instance:

Dependabot cannot update trim-newlines to a non-vulnerable version
The latest possible version that can be installed is 1.0.0 because of the following conflicting dependency:

@release-it/[email protected] requires trim-newlines@^1.0.0 via a transitive dependency on [email protected]
The earliest fixed version is 3.0.1.
CVE-2021-33623
high severity
Vulnerable versions: < 3.0.1
Patched version: 3.0.1
The trim-newlines package before 3.0.1 and 4.x before 4.0.1 for Node.js has an issue related to regular expression denial-of-service (ReDoS) for the .end() method.

See https://github.com/TheRealWaldo/release-it/security/dependabot/package-lock.json/trim-newlines/open

How to use --commit-path

Hi,

I am trying to use the flag --commit-path as described in conventional-changelog:
image

How should I use this flag? The docs say to pass it verbatim but doing so in my .release-it.json doesn't seem to work since it adds entries in the changelog from other folders than the ./src-folder:
image

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.