一般版本表示方式為: [major, minor, patch]
例如:1.2.4
~ 允許更新(path)版本更新 allow patch-level changes
~1.2.3
:=>=1.2.3 <1.(2+1).0
:=>=1.2.3 <1.3.0
~1.2
:=>=1.2.0 <1.(2+1).0
:=>=1.2.0 <1.3.0
(Same as1.2.x
)~1
:=>=1.0.0 <(1+1).0.0
:=>=1.0.0 <2.0.0
(Same as1.x
)~0.2.3
:=>=0.2.3 <0.(2+1).0
:=>=0.2.3 <0.3.0
~0.2
:=>=0.2.0 <0.(2+1).0
:=>=0.2.0 <0.3.0
(Same as0.2.x
)~0
:=>=0.0.0 <(0+1).0.0
:=>=0.0.0 <1.0.0
(Same as0.x
)~1.2.3-beta.2
:=>=1.2.3-beta.2 <1.3.0
Note that prereleases in the1.2.3
version will be allowed, if they are greater than or equal tobeta.2
. So,1.2.3-beta.4
would be allowed, but1.2.4-beta.2
would not, because it is a prerelease of a different[major, minor, patch]
tuple.
^ 允許不修到到最左方非0版本情況下,允許更新。
Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch]
tuple.^1.2.3
:=>=1.2.3 <2.0.0
^0.2.3
:=>=0.2.3 <0.3.0
^0.0.3
:=>=0.0.3 <0.0.4
^1.2.3-beta.2
:=>=1.2.3-beta.2 <2.0.0
Note that prereleases in the1.2.3
version will be allowed, if they are greater than or equal tobeta.2
. So,1.2.3-beta.4
would be allowed, but1.2.4-beta.2
would not, because it is a prerelease of a different[major, minor, patch]
tuple.^0.0.3-beta
:=>=0.0.3-beta <0.0.4
Note that prereleases in the0.0.3
version only will be allowed, if they are greater than or equal tobeta
. So,0.0.3-pr.2
would be allowed.
沒有留言:
張貼留言