Semver Edge Cases: The Follow-Up Questions Package Authors Ask

You already know the headline rule of Semantic Versioning: MAJOR for breaking changes, MINOR for backwards-compatible features, PATCH for backwards-compatible fixes. The trouble starts when a real release does not fit neatly into one box. These are the harder questions we see from people publishing to npm, PyPI and Go module proxies, with short, opinionated answers.

Questions about the version number itself

Does anything go in 0.x?

The Semantic Versioning 2.0.0 specification says major version zero is for initial development and that anything may change at any time. In practice, tooling is stricter than the spec. npm treats a caret range such as ^0.4.2 as "only 0.4.x", so a bump from 0.4 to 0.5 is already treated like a major change by most installs. Our advice: treat the MINOR digit as your breaking-change signal while you are in 0.x, and say so in the README.

When should I publish 1.0.0?

When people depend on you in production, you are already making a compatibility promise whether or not the number says so. Shipping 1.0.0 simply makes the promise explicit. Staying in 0.x for years mostly confuses users about what is safe to upgrade.

How do pre-release tags sort?

A pre-release such as 2.0.0-beta.3 has lower precedence than 2.0.0. Identifiers are compared dot by dot, numeric parts numerically, so beta.10 comes after beta.9. Use numeric counters rather than dates or words like "final" that do not sort the way you expect.

Is build metadata part of the version?

No. Anything after a plus sign, for example 1.4.0+sha.5114f85, is ignored when determining precedence. Registries may reject it or strip it, so never rely on it to distinguish two releases.

Questions about what counts as breaking

Is dropping an old Node.js or Python version a major change?

It breaks anyone still running that runtime, so the conservative answer is yes. Declare the supported range in engines (package.json) or requires-python (pyproject.toml) and bump MAJOR when you narrow it. Some well-known projects choose otherwise and document the policy; if you do the same, write the policy down before you need it.

I fixed a bug, but someone relied on the buggy behaviour. Patch or major?

If the old behaviour contradicted your documentation, a patch is defensible. If the behaviour was undocumented but widely used, weigh the cost honestly. A short deprecation window with a warning is often kinder than a silent patch.

Does changing a TypeScript type count?

Yes, if a consumer's code that compiled before no longer compiles. Narrowing a parameter type, removing an exported type or making an optional field required are all breaking for typed users, even though the JavaScript runtime output is identical.

What about bumping a peer dependency range?

Requiring a newer major version of a peer, such as a framework, forces your users to upgrade that peer too. Treat it as a MAJOR release of your package.

Quick reference

ChangeSuggested bump
New optional function argumentMINOR
Removed or renamed exportMAJOR
Narrowed supported runtime rangeMAJOR
Internal refactor, same behaviourPATCH
New peer dependency major requiredMAJOR

For the underlying rules, read the specification itself at semver.org, then compare it with how your registry's resolver interprets ranges. Our glossary defines the range operators, and the tools page lists the browser helpers on this site.