Follow Along: slides.com/proloser/semver-v0/live
- Dean Sofer -
Github.com/ProLoser
Versions are broken down by MAJOR.MINOR.PATCH
MAJOR: Backwards-incompatible changes / major refactor
MINOR: Backwards-compatible changes + new features
PATCH: Backwards-compatible fixes
Common dependency syntax
"*": any version
"^1.2.3": Any MINOR equal-to or greater than 1.2.3
"~1.2.3": Any PATCH equal-to or greater than 1.2.3
// package1.json:
{
"peerDependencies": {
"mylib": "^1.2.3"
}
}
// package2.json:
{
"peerDependencies": {
"mylib": "^1.4.5"
}
}
// package3.json:
{
"peerDependencies": {
"mylib": "~1.6.7"
}
}
// resolution:
{
"dependencies": {
"mylib": "1.6.14"
}
}
So how do I version my project?
Backwards incompatible change: 0.1.0 => 1.0.0
Semver rapidly approaches: 42.0.0
// package1.json:
{
"peerDependencies": {
"mylib": "^0.2.3"
}
}
// package2.json:
{
"peerDependencies": {
"mylib": "^0.4.5"
}
}
// package3.json:
{
"peerDependencies": {
"mylib": "~0.6.7"
}
}
// resolution:
{
"dependencies": {
"mylib": "ERROR"
}
}
Versions are broken down by MAJOR.MINOR.PATCH
MAJOR: 1.0.0 when API stabilizes
MINOR: Backwards-INcompatible changes + refactors
PATCH: Backwards-compatible features + fixes
Use MINOR for backwards incompatibility
Use PATCH for everything else
NPM dependencies behave differently for 0.x.x
"*": any version
"^0.2.3": Any PATCH equal-to or greater than 0.2.3
"~0.2.3": I've got no idea what this does
// package1.json:
{
"peerDependencies": {
"mylib": "^0.2.3"
}
}
// package2.json:
{
"peerDependencies": {
"mylib": "^0.2.5"
}
}
// resolution:
{
"dependencies": {
"mylib": "0.2.14"
}
}