Git 变更集
Git Changesets

原始链接: https://github.com/changesets/changesets

Changesets 是一款旨在简化版本控制和变更日志管理的工具,尤其适用于多包仓库(monorepo)。它简化了从开发到发布的整个发布流程。贡献者创建“changesets”,声明预期的 semver 版本提升类型并总结特定包的更改。 `@changesets/cli` 工具通过将 changesets 整合到发布版本中来自动化发布流程,处理 monorepo 中的包间依赖关系,更新变更日志并发布新包版本。它支持每个更改都包含一个 changeset 文件的工作流程,然后将这些文件组合起来进行发布。 Changesets 与 CI/CD 管道很好地集成。changeset 机器人和 `yarn changeset status` 可以验证缺少 changesets 的 PR,而专门的 GitHub Action 可以自动执行版本控制 pull request 和包发布。它受到 Bolt、lerna-semantic-release 等工具的启发,并得到 Atlassian 和 Thinkmill 的支持。

一个 Hacker News 的帖子讨论了“Git Changesets”这个工具(github.com/changesets),它用于管理版本控制和变更日志,尤其是在单体仓库中。发帖者质疑该项目声称 Git 不鼓励详细的变更描述的说法,并认为可能是 Github 的 UI 才是罪魁祸首。另一位评论者指出,该项目与 Git 或 Github 并没有官方关联,标题具有误导性。他们建议将标题修改为使用项目的标语:“Changesets——专注于单体仓库的版本控制和变更日志”(或略微修改后的版本)。他们还请求版主考虑更改标题。

原文

A tool to manage versioning and changelogs
with a focus on multi-package repositories

npm package View changelog

The changesets workflow is designed to help when people are making changes, all the way through to publishing. It lets contributors declare how their changes should be released, then we automate updating package versions, and changelogs, and publishing new versions of packages based on the provided information.

Changesets has a focus on solving these problems for multi-package repositories, and keeps packages that rely on each other within the multi-package repository up-to-date, as well as making it easy to make changes to groups of packages.

A changeset is an intent to release a set of packages at particular semver bump types with a summary of the changes made.

The @changesets/cli package allows you to write changeset files as you make changes, then combine any number of changesets into a release, that flattens the bump-types into a single release per package, handles internal dependencies in a multi-package-repository, and updates changelogs, as well as release all updated packages from a mono-repository with one command.

If you just want to jump in to using changesets, the Intro to using changesets and @changesets/cli docs are where you should head.

If you want a detailed explanation of the concepts behind changesets, or to understand how you would build on top of changesets, check out our detailed-explanation.

We also have a dictionary.

While changesets can be an entirely manual process, we recommend integrating it with how your CI works.

To check that PRs contain a changeset, we recommend using the changeset bot, or if you want to fail builds on a changesets failure, run yarn changeset status in CI.

To make releasing easier, you can use this changesets github action to automate creating versioning pull requests, and optionally publishing packages.

Cool Projects already using Changesets for versioning and changelogs

  • bolt - Brought us a strong concept of how packages in a mono-repo should be able to interconnect, and provided the initial infrastructure to get inter-package information.
  • Atlassian - The original idea/sponsor of the changesets code, and where many of the ideas and processes were fermented. It was originally implemented by the team behind atlaskit.
  • lerna-semantic-release - put down many of the initial patterns around updating packages within a multi-package-repository, and started us thinking about how to manage dependent packages.
  • Thinkmill - For sponsoring the focused open sourcing of this project, and the version two rearchitecture.
联系我们 contact @ memedata.com