Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support page header setting of changelog file #18

Closed
wants to merge 1 commit into from

Conversation

lpreterite
Copy link
Contributor

@lpreterite lpreterite commented Apr 22, 2021

Why this PR

Because I need to add more custom descriptions to the header of the CHANGELOG file .

It is the same as the conventional-changelog-config-spec setting of standard-version.

What this PR fix

Increase in the configuration header is provided, at its head and applied to the document output.

Configuration samples

{
  "plugins": {
    "@release-it/conventional-changelog": {
      "infile": "CHANGELOG.md",
      "header": "# 📋 更新历史 \n\n",
      "preset": {
        "name": "conventionalcommits"
      }
    }
  }
}

It is the same as the conventional-changelog-config-spec setting of standard-version.
@webpro
Copy link
Contributor

webpro commented Jun 6, 2021

The options are sent to the plugin, so I would expect you could use any of those options. You would need to move the header property into the preset.

Please see https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.1.0/README.md

I've just updated the docs with this, so thanks for raising the issue and opening this PR!

@webpro webpro closed this in ad74134 Jun 6, 2021
@lpreterite
Copy link
Contributor Author

Hope to review this PR again

I want to explain two things:

  1. The header set in the preset does not take effect
  2. After passing the header settings to the plug-in during the local debugging process, the results obtained are far from expected.

Expect

The header is only at the top of the page

# Changelog

This document lists breaking changes for each major release.

See the GitHub Releases page for detailed changelogs:
[https://github.com/release-it/release-it/releases](https://github.com/release-it/release-it/releases)

## v14

- Removed `global` property from plugins. Use `this.config[key]` instead.
- Removed deprecated `npm.access` option. Set this in `package.json` instead.

## v13

- Dropped support for Node v8
- Dropped support for GitLab v11.6 and lower.
- Deprecated `scripts` are removed (in favor of [hooks](https://github.com/release-it/release-it#hooks)).
- Removed deprecated `--non-interactive` (`-n`) argument. Use `--ci` instead.
- Removed old `%s` and `[REV_RANGE]` syntax in command substitutions. Use `${version}` and `${latestTag}` instead.

Reality

The header will appear in the top of each version of content changes

# Changelog

This document lists breaking changes for each major release.

See the GitHub Releases page for detailed changelogs:
[https://github.com/release-it/release-it/releases](https://github.com/release-it/release-it/releases)

## v14

- Removed `global` property from plugins. Use `this.config[key]` instead.
- Removed deprecated `npm.access` option. Set this in `package.json` instead.

# Changelog

This document lists breaking changes for each major release.

See the GitHub Releases page for detailed changelogs:
[https://github.com/release-it/release-it/releases](https://github.com/release-it/release-it/releases)

## v13

- Dropped support for Node v8
- Dropped support for GitLab v11.6 and lower.
- Deprecated `scripts` are removed (in favor of [hooks](https://github.com/release-it/release-it#hooks)).
- Removed deprecated `--non-interactive` (`-n`) argument. Use `--ci` instead.
- Removed old `%s` and `[REV_RANGE]` syntax in command substitutions. Use `${version}` and `${latestTag}` instead.

@dangreen
Copy link

@webpro Hi. Why you closed this PR? This feature is very wanted. standard-version also have this logic on its side

https://github.com/conventional-changelog/standard-version/blob/fb3f3fa7b7ea999b5ef714acc780b3c265caac63/lib/lifecycles/changelog.js#L50

@webpro
Copy link
Contributor

webpro commented Jan 15, 2022

My apologies for understanding the issue incorrectly. Can someone please pick up this PR and also fix and add one or more tests please?

GitHub says I can't re-open this PR, so please open a new one. I'll be happy to review and merge this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants