lerna-changelog

基于 PR 的变更日志生成器,具有 monorepo 支持。「PR-based changelog generator with monorepo support」

Github星跟蹤圖

lerna-changelog

基于 PR 的变更日志生成器,具有 monorepo 支持。

安装

用 yarn 进行安装

yarn add lerna-changelog --dev
# or globally
yarn global add lerna-changelog

我们用的是 yarn,但如果你喜欢,你也可以用 npm

npm install --save-dev lerna-changelog
# or globally
npm install --global lerna-changelog

用法

$ lerna-changelog
## Unreleased (2018-05-24)
#### :bug: Bug Fix
* [#198](https://github.com/my-org/my-repo/pull/198) Avoid an infinite loop ([@helpful-hacker](https://github.com/helpful-hacker))
#### :house: Internal
* [#183](https://github.com/my-org/my-repo/pull/183) Standardize error messages ([@careful-coder](https://github.com/careful-coder))
#### Commiters: 2
- Helpful Hacker ([@helpful-hacker](https://github.com/helpful-hacker))
- [@careful-coder](https://github.com/careful-coder)

默认情况下,lerna-changelog 将显示存储库中自最新的标记提交以来合并的所有拉请求。然而,这只适用于应用了某些标签的 pull 请求。默认情况下支持的标签是:

  • breaking (boom 突破性变革)
  • enhancement (rocket 增强)
  • bug (bug Bug Fix)
  • documentation (memo 文档)
  • internal (house 内部)

Monorepo 支持

如果您有一个packages文件夹,并且您的项目在该文件夹的子文件夹中,则lerna-changelog将检测到它,并将软件包名称包括在更改日志中以进行相关更改。

GitHub 令牌

由于 lerna-changelog 与 GitHub API 交互,因此您可能会遇到限速问题,可以通过提供“个人访问令牌”来解决该问题:

export GITHUB_AUTH="..."

您将需要 GitHub API 的个人访问令牌,其私有存储库的 repo 范围,或者公共存储库的 public_repo 范围。

设置

您可以通过多种方式配置 lerna-changelog。 最简单的方法是在项目的 package.json 文件中添加一个 changelog 密钥:

{
  // ...
  "changelog": {
    "labels": {
      "feature": "New Feature",
      "bug": "Bug Fix"
    }
  }
}

支持的选项有:

  • repo:您在 GitHub 上的 “org/repo”(从 package.json 文件自动推断)
  • nextVersion:未发布提交的标题(例如,Unreleased)
  • labels:GitHub PR labels 映射到 changelog 部分标题
  • ignoreCommitters:要忽略的提交者列表(完全匹配或部分匹配)。 例如,对于忽略来自机器人的提交很有用。
  • cacheDir:避免限制的 GitHub API 响应缓存的路径(例如.changelog)

许可

lerna-changelog 是根据 MIT 许可证发布的。


(The first version translated by vz on 2020.07.26)

主要指標

概覽
名稱與所有者lerna/lerna-changelog
主編程語言TypeScript
編程語言JavaScript (語言數: 2)
平台Linux, Mac, Windows
許可證MIT License
所有者活动
創建於2016-05-24 19:41:40
推送於2025-09-05 17:40:21
最后一次提交2024-07-01 14:39:29
發布數22
最新版本名稱v2.2.0 (發布於 2021-10-12 01:03:44)
第一版名稱v0.1.0 (發布於 )
用户参与
星數805
關注者數13
派生數95
提交數1.3k
已啟用問題?
問題數97
打開的問題數42
拉請求數946
打開的拉請求數40
關閉的拉請求數212
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

lerna-changelog

TravisCI Build Status
Latest NPM release

PR-based changelog generator with monorepo support

Install

Install with yarn:

yarn add lerna-changelog --dev
# or globally
yarn global add lerna-changelog

We're using yarn but you can use npm if you like:

npm install --save-dev lerna-changelog
# or globally
npm install --global lerna-changelog

Usage

$ lerna-changelog
## Unreleased (2018-05-24)

#### :bug: Bug Fix
* [#198](https://github.com/my-org/my-repo/pull/198) Avoid an infinite loop ([@helpful-hacker](https://github.com/helpful-hacker))

#### :house: Internal
* [#183](https://github.com/my-org/my-repo/pull/183) Standardize error messages ([@careful-coder](https://github.com/careful-coder))

#### Commiters: 2
- Helpful Hacker ([@helpful-hacker](https://github.com/helpful-hacker))
- [@careful-coder](https://github.com/careful-coder)

By default lerna-changelog will show all pull requests that have been merged
since the latest tagged commit in the repository. That is however only true for
pull requests with certain labels applied. The labels that are supported by
default are:

  • breaking (:boom: Breaking Change)
  • enhancement (:rocket: Enhancement)
  • bug (:bug: Bug Fix)
  • documentation (:memo: Documentation)
  • internal (:house: Internal)

You can also use the --from and --to options to view a different
range of pull requests:

lerna-changelog --from=v1.0.0 --to=v2.0.0

Monorepo support

If you have a packages folder and your projects in subfolders of that folder lerna-changelog will detect it and include the package names in the changelog for the relevant changes.

GitHub Token

Since lerna-changelog interacts with the GitHub API you may run into rate
limiting issues which can be resolved by supplying a "personal access token":

export GITHUB_AUTH="..."

You'll need a personal access token
for the GitHub API with the repo scope for private repositories or just
public_repo scope for public repositories.

Configuration

You can configure lerna-changelog in various ways. The easiest way is by
adding a changelog key to the package.json file of your project:

{
  // ...
  "changelog": {
    "labels": {
      "feature": "New Feature",
      "bug": "Bug Fix"
    }
  }
}

The supported options are:

  • repo: Your "org/repo" on GitHub
    (automatically inferred from the package.json file)

  • nextVersion: Title for unreleased commits
    (e.g. Unreleased)

  • labels: GitHub PR labels mapped to changelog section headers

  • ignoreCommitters: List of committers to ignore (exact or partial match).
    Useful for example to ignore commits from bots.

  • cacheDir: Path to a GitHub API response cache to avoid throttling
    (e.g. .changelog)

License

lerna-changelog is released under the MIT License.