加一(+1)在 dart 的依赖版本控制中意味着什么

What does plus one (+1) mean in dart's dependency versioning

我在一些 flutter 依赖项中看到了这个 +1,并且一直想知道它是什么意思,因为这些天我经常看到它。

样本pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  cloud_firestore: ^0.8.1+1
  sqflite: 0.12.2+1
  zoomable_image: ^1.2.1+1  

我查过here但没有找到。

什么意思?也可以是 +n 例如 +2?

+ 表示这是一个常规的发布版本,
- 表示预发布版本。
x.y.z 后没有内部版本号也表示像 + 这样的发布版本)

版本的以下部分是一些内部版本号,没有固定格式。

另见

来自https://semver.org/spec/v2.0.0-rc.1.html

  1. A pre-release version MAY be denoted by appending a dash and a series of dot separated identifiers immediately following the patch version. Identifiers MUST be comprised of only ASCII alphanumerics and dash [0-9A-Za-z-]. Pre-release versions satisfy but have a lower precedence than the associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.

  2. A build version MAY be denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch version or pre-release version. Identifiers MUST be comprised of only ASCII alphanumerics and dash [0-9A-Za-z-]. Build versions satisfy and have a higher precedence than the associated normal version. Examples: 1.0.0+build.1, 1.3.7+build.11.e0f985a.

提示: 预发布版本(带有 -)会被 flutter packages get 忽略,除非 - 明确是版本的一部分pubspec.yaml 中的限制,例如

foo_package: ^1.2.3-beta

在 Dart 约定中,+1 用于发布 补丁 版本,其中版本中的第一个数字是 0。版本 1.2.1+1 不是惯用的。本质上有两种模式在使用,这取决于作者是否认为包足够稳定以达到 1.0.0:

  • 0.major.minor+patch
  • major.minor.patch