@fluid-tools/version-tools

中文文档
0.68.0发布于 2026/10/16MITCommonJS近 30 天下载 9437

Versioning tools for Fluid Framework

原始使用文档
文档目录12 节
  1. internal version scheme
  2. API
  3. virtualPatch version scheme
  4. API
  5. fluv autocomplete [SHELL]
  6. fluv help [COMMAND]
  7. fluv version VERSION
  8. fluv version latest
  9. Developer notes
  10. Contribution Guidelines
  11. Help
  12. Trademark

@fluid-tools/version-tools

The version-tools package provides APIs and a CLI to parse and transform version numbers and ranges that are used by the Fluid Framework.

Version schemes

Fluid Framework packages sometimes use version schemes that diverge from standard semantic versioning. By default, a new package should use standard semantic versioning. However, there are also two other versioning schemes: internal and virtualPatch.

internal version scheme

[!NOTE] Fluid Framework no longer uses the internal version scheme. However, we still want to preserve the information and tooling for the internal version scheme because:

  1. We may still encounter internal versions in compatibility tests.
  2. We may choose to re-implement the internal version scheme in the future.

The Fluid internal version scheme consists of two semver "triplets" of major/minor/patch. The first triplet is called the public version, and is stored in the typical semver positions in the version string.

The second triplet is called the internal version, and is found at the end of the pre-release section of the version string.

Fluid internal version strings always include the string internal in the first position of the pre-release section.

In the following example, the public version is a.b.c, while the internal version is x.y.z.

a.b.c-internal.x.y.z

API

  • isInternalVersionScheme -- Returns true if a string represents an internal version number.
  • isInternalVersionRange -- Returns true if a string represents an internal version range.
  • toInternalScheme -- Converts a standard semver version string to the internal version scheme.
  • fromInternalScheme -- Converts an internal version scheme string into two standard semvers -- one for the public version and one for the internal version.
  • bumpInternalVersion -- Given an internal version and a bump type, returns the bumped version.
  • getVersionRange -- Given an internal version and a constraint type, returns a dependency version range that enforces the constraint.

virtualPatch version scheme

The Fluid virtualPatch version scheme is only used for pre-1.0 packages. Versions are of the form:

0.major.minorpatch

The minor version and patch version are combined by multiplying the minor version by 1000 and then adding the patch version. For example, for the standard semver 1.2.3, the virtualPatch version scheme would yield 0.1.2003.

Minor versions always start at 1 instead of 0. That is, the first release of a major version 3 would be 0.3.1000.

API

  • isVirtualPatch -- Returns true if a string represents an internal version number.

General API

  • detectVersionScheme -- Given a version or a range string, determines what version scheme the string is using.
  • incRange -- Increments a range by the bump type (major, minor, or patch), maintaining the existing constraint.

CLI Usage

version-tools provides a command-line interface (fluv) when installed directly. However, the commands listed here are also available in the Fluid build and release tool (flub). This is accomplished using oclif's plugin system.

$ npm install -g @fluid-tools/version-tools
$ fluv COMMAND
running command...
$ fluv (--version|-V)
@fluid-tools/version-tools/0.0.0
$ fluv --help [COMMAND]
USAGE
  $ fluv COMMAND
...

Commands

fluv autocomplete [SHELL]

Display autocomplete installation instructions.

USAGE
  $ fluv autocomplete [SHELL] [-r]

ARGUMENTS
  [SHELL]  (zsh|bash|powershell) Shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  Display autocomplete installation instructions.

EXAMPLES
  $ fluv autocomplete

  $ fluv autocomplete bash

  $ fluv autocomplete zsh

  $ fluv autocomplete powershell

  $ fluv autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

fluv help [COMMAND]

Display help for fluv.

USAGE
  $ fluv help [COMMAND...] [-n]

ARGUMENTS
  [COMMAND...]  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for fluv.

See code: @oclif/plugin-help

fluv version VERSION

Convert version strings between regular semver and the Fluid internal version scheme.

USAGE
  $ fluv version VERSION [--json] [-t major|minor|patch|current] [--publicVersion <value>]

ARGUMENTS
  VERSION  The version to convert.

FLAGS
  -t, --type=<option>          bump type
                               <options: major|minor|patch|current>
      --publicVersion=<value>  [default: 2.0.0] The public version to use in the Fluid internal version.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Convert version strings between regular semver and the Fluid internal version scheme.

EXAMPLES
  The version can be a Fluid internal version.

    $ fluv version 2.0.0-internal.1.0.0 --type minor

  The version can also be a semver with a bump type.

    $ fluv version 1.0.0 --type minor

  If needed, you can provide a public version to override the default.

    $ fluv version 1.0.0 --type patch --publicVersion 3.1.0

  You can use ^ and ~ as a shorthand.

    $ fluv version ^1.0.0

  You can use the 'current' bump type to calculate ranges without bumping the version.

    $ fluv version 2.0.0-internal.1.0.0 --type current

See code: src/commands/version.ts

fluv version latest

Find the latest version from a list of version strings, accounting for the Fluid internal version scheme.

USAGE
  $ fluv version latest -r <value>... [--json] [--prerelease]

FLAGS
  -r, --versions=<value>...  (required) The versions to evaluate. The argument can be passed multiple times to provide
                             multiple versions, or a space-delimited list of versions can be provided using a single
                             argument.
      --prerelease           Include prerelease versions. By default, prerelease versions are excluded.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Find the latest version from a list of version strings, accounting for the Fluid internal version scheme.

EXAMPLES
  You can use the --versions (-r) flag multiple times.

    $ fluv version latest -r 2.0.0 -r 2.0.0-internal.1.0.0 -r 1.0.0 -r 0.56.1000

  You can omit the repeated --versions (-r) flag and pass a space-delimited list instead.

    $ fluv version latest -r 2.0.0 2.0.0-internal.1.0.0 1.0.0 0.56.1000

See code: src/commands/version/latest.ts

Developer notes

This package outputs its build files to lib/ instead of dist/ like most of our other packages. The reason is that oclif uses the lib folder by convention, and there are oclif bugs that can be avoided by putting stuff in lib. See the PR here for an example: https://github.com/microsoft/FluidFramework/pull/12155

Contribution Guidelines

You can contribute to Fluid Framework in these ways:

For detailed instructions, read the repo documentation.

This project follows the Microsoft Open Source Code of Conduct. For more information, read the Code of Conduct frequently asked questions. For questions or comments, contact [email protected].

This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services. Use of these trademarks or logos must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.

Help

Read the Fluid Framework documentation for information about Fluid Framework concepts and APIs.

To request information that the documentation does not contain, create an issue.

Trademark

This project may contain Microsoft trademarks or logos for Microsoft projects, products, or services.

Use of these trademarks or logos must follow Microsoft's Trademark & Brand Guidelines.

Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.

版本与发布记录

@fluid-tools/version-tools 共发布 185 个版本,首次发布于 2022/07/28;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.68.0latest2026/10/161 个月前
0.67.02026/08/153 个月前
0.66.0rc2026/08/053 个月前
0.65.02026/04/216 个月前
0.64.02026/03/148 个月前
0.63.02026/01/1410 个月前

其他发布通道:next → 0.29.0-227332,dev → 0.56.0-332685,rc → 0.66.0。

关于 @fluid-tools/version-tools 的常见问题

@fluid-tools/version-tools 是什么?

Versioning tools for Fluid Framework

如何安装 @fluid-tools/version-tools?

在项目目录运行 npm install @fluid-tools/version-tools,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 fluv,可以用 npx fluv 直接运行。

@fluid-tools/version-tools 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fluid-tools__version-tools 是否存在。

@fluid-tools/version-tools 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fluid-tools/version-tools 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.22.2。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fluid-tools/version-tools 可以商用吗?

@fluid-tools/version-tools 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fluid-tools/version-tools 的下载量有多少?

根据 npm 官方下载统计,@fluid-tools/version-tools 在 2026/10/15 – 2026/11/13 这 30 天内被下载 9,437 次,日均约 315 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fluid-tools/version-tools 还在维护吗?

最新版本 0.68.0 发布于 2026/10/16(1 个月前);至今共发布 185 个版本,其中过去 12 个月发布了 8 个;首次发布于 2022/07/28。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。