← 返回
开发者工具 中文

Semver Helper

Semantic Versioning 2.0.0 reference guide. Quick decision trees and examples for choosing MAJOR, MINOR, or PATCH version bumps.
语义化版本 2.0.0 参考指南,包含选择主版本、次版本或补丁版本升级的快速决策树与示例。
avegancafe avegancafe 来源
开发者工具 clawhub v1.0.1 1 版本 99884.9 Key: 无需
★ 0
Stars
📥 868
下载
💾 10
安装
1
版本
#latest

概述

Semver Helper

Quick reference for Semantic Versioning 2.0.0 decisions.

The Golden Rule

Given version MAJOR.MINOR.PATCH, increment:

LevelBump WhenReset Lower?
--------------------------------
MAJOR (X.0.0)Breaking changes (incompatible API changes)Yes, MINOR and PATCH → 0
MINOR (0.X.0)New features (backwards compatible)Yes, PATCH → 0
PATCH (0.0.X)Bug fixes (backwards compatible)No

Quick Decision Tree

Did you change anything users depend on?
├─ No (internal only) → PATCH
└─ Yes
   └─ Did you remove/change existing behavior?
      ├─ Yes → MAJOR
      └─ No (only added new stuff)
         └─ Is the new stuff visible to users?
            ├─ Yes → MINOR
            └─ No → PATCH

Real Examples

🔴 MAJOR (Breaking)

  • Remove a function, endpoint, or CLI flag
  • Change the return type of a function
  • Require a new mandatory parameter
  • Change default behavior significantly
  • Rename something users depend on
  • Upgrade a dependency that forces downstream changes

Examples:

  • removeUser()deleteUser() rename
  • API response format changed from {id: 1} to {data: {id: 1}}
  • Dropping support for Node 16 (if users must upgrade)

🟡 MINOR (Feature)

  • Add new functionality
  • Add optional parameters
  • Add new exports/exports
  • Deprecate old features (warn, don't remove)
  • Performance improvements (no API change)

Examples:

  • Add createUser() alongside existing user functions
  • Add --format json flag to CLI
  • Add new event listeners/hooks
  • Mark old method as deprecated (still works)

🟢 PATCH (Fix)

  • Fix bugs without changing intended behavior
  • Documentation updates
  • Internal refactoring (no visible change)
  • Dependency updates (no API change)
  • Test additions

Examples:

  • Fix null pointer exception
  • Correct typo in error message
  • Fix race condition
  • Update README

Version Progression Examples

ChangesVersion Bump
-----------------------
fix: null pointer1.2.31.2.4
feat: add auth1.2.31.3.0
breaking: remove old API1.2.32.0.0
fix: bug + feat: new thing1.2.31.3.0 (MINOR wins)
fix: bug + breaking: remove API1.2.32.0.0 (MAJOR wins)

Pre-releases

Use suffixes for testing before stable:

  • 2.0.0-alpha.1 — Very early, unstable
  • 2.0.0-beta.2 — Feature complete, testing
  • 2.0.0-rc.1 — Release candidate, final testing

Pre-releases sort before their stable version:

1.0.0-alpha < 1.0.0-beta < 1.0.0-rc < 1.0.0

Common Edge Cases

SituationBumpWhy
----------------------
Fix a bug that was introduced this versionPATCHStill a fix
Deprecate a feature (but keep it working)MINORNew "deprecated" state is info
Change undocumented/internal behaviorPATCHUsers shouldn't depend on it
Security fix that requires API changeMAJORBreaking for security
Rewriting internals, same behaviorPATCHInvisible to users
Adding tests/docs onlyPATCHNo code change

Anti-Patterns

Don't bump MAJOR for big new features (unless breaking)

Don't bump MINOR for bug fixes

Don't bump PATCH for new functionality

Don't keep old numbers when bumping: 1.2.3 → 2.2.3 is wrong

Cheat Sheet

Users' code breaks? → MAJOR
Users get new toys? → MINOR
Users get fixes? → PATCH

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 10:20 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,470
dev-programming

Docker Essentials

arnarsson
核心 Docker 命令和工作流程,包括容器管理、镜像操作和调试。
★ 38 📥 32,241
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,911