Porównywanie i sprawdzanie Semver
O nas
Wersjonowanie semantyczne (semver.org) nadaje numerom wersji kontrakt: MAJOR dla zmian łamiących, MINOR dla funkcji zgodnych wstecznie, PATCH dla poprawek zgodnych wstecznie — plus sufiksy przedpremierowe (1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-beta < 1.0.0) and +build metadata that never affects precedence. The comparator implements the spec's precedence algorithm exactly, including the fiddly pre-release rules (numeric identifiers compare numerically and rank below alphanumeric ones; a version with a pre-release is older than the same version without). It is the check CI pipelines and package managers run millions of times a day.
Często zadawane pytania
Czy 1.0.0-alpha jest nowsze niż 1.0.0?
Nie — wersja wstępna (pre-release) jest starsza niż jej wydanie: 1.0.0-alpha < 1.0.0. To reguła, która pozwala menedżerom pakietów bezpiecznie oferować bety.
Czy metadane +build mają znaczenie?
Nie dla pierwszeństwa: 1.0.0+exp i 1.0.0 są równe w kolejności, choć metadane są zachowywane dla informacji.