ตัวเปรียบเทียบและตรวจสอบ Semver
เกี่ยวกับ
Semantic Versioning (semver.org) ให้สัญญาแก่หมายเลขเวอร์ชัน: MAJOR สำหรับการเปลี่ยนแปลงที่ทำลายความเข้ากันได้ MINOR สำหรับคุณสมบัติที่เข้ากันได้ย้อนหลัง PATCH สำหรับการแก้ไขที่เข้ากันได้ย้อนหลัง — บวกส่วนต่อท้ายรุ่นก่อนวางจำหน่าย (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.
คำถามที่พบบ่อย
1.0.0-alpha ใหม่กว่า 1.0.0 หรือไม่?
ไม่ — รุ่นก่อนวางจำหน่ายเก่ากว่ารุ่นวางจำหน่ายของมัน: 1.0.0-alpha < 1.0.0 นั่นคือกฎที่ทำให้ตัวจัดการแพ็กเกจเสนอรุ่นเบต้าได้อย่างปลอดภัย
เมทาดาทา +build มีความสำคัญหรือไม่?
ไม่ใช่สำหรับลำดับความสำคัญ: 1.0.0+exp และ 1.0.0 เท่ากันในการเรียงลำดับ แม้ว่าเมทาดาทาจะถูกเก็บไว้เป็นข้อมูล