返回介绍

如何使用语义化版本

发布于 2019-05-30 13:06:25 字数 1402 浏览 1187 评论 0 收藏 0

It's important to communicate the extent of changes in a new release of code, because sometimes updates can break code that a package needs (called dependencies).Semantic versioning (semver) is a standard that was designed to solve this problem.

Semver for Publishers

If a project is going to be shared with others, it should start at 1.0.0, (though some projects on npm don't follow this rule).

After this, changes should be handled as follows:

SemVerTable

Semver for Consumers

针对使用者的语义化版本

If you were starting with a package 1.0.4, this is how you would specify the ranges:

  • Patch releases: 1.0 or 1.0.x or ~1.0.4
  • Minor releases: 1 or 1.x or ^1.0.4
  • Major releases: * or x

Learn More

For more about using semantic versioning with package.json files, see Chapter 5.

For another way to label releases, learn about npm dist tags, and how they relate to semantic versioning.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文