Skip to content

Advanced Topics: Semantic Versioning

Alessandro Barbagallo edited this page Sep 20, 2023 · 4 revisions

Why Semantic Versioning?

Semantic Versioning (SemVer) provides a universal versioning standard that makes it clear when and how breaking changes are introduced, new features are added, or bug fixes occur. This enables developers to understand the effects of updating a package version quickly.

Version Format

A semantic version number is composed of three fields: MAJOR.MINOR.PATCH, each with a specific meaning:

  • MAJOR: Incompatible changes that require the user to change something about their setup.
  • MINOR: Backwards-compatible new features and enhancements.
  • PATCH: Backwards-compatible bug fixes.

Automated Versioning

The error-enhanced package uses automated versioning by integrating with tools like semantic-release. It analyzes commit messages to automatically bump version numbers and generate changelogs. Check out the repository's semantic-release configuration for more details.

Custom Release Rules

We've also set up custom release rules to suit the unique workflow of this package. For instance, documentation updates to the README result in a patch release, while refactoring the core codebase triggers a minor release.

"releaseRules": [
  {
    "type": "docs",
    "scope": "README",
    "release": "patch"
  },
  {
    "type": "refactor",
    "scope": "core-*",
    "release": "minor"
  }
]

Best Practices

  • Always check the release notes and migration guides before updating to a new major version.
  • Use tilde ~ or caret ^ in your package.json file to restrict auto-updates to minor and patch versions only, unless you're prepared for breaking changes.

For further information on versioning, you may refer to the official Semantic Versioning documentation.


Clone this wiki locally