@fluid-tools/build-cli

中文文档
0.68.0发布于 2026/10/16MITES Module近 30 天下载 5659

Build tools for the Fluid Framework

原始使用文档
文档目录6 节
  1. Developer notes
  2. Testing
  3. Manual Integration Testing and Debugging
  4. Contribution Guidelines
  5. Help
  6. Trademark

@fluid-tools/build-cli

flub is a build and release tool for the Fluid Framework GitHub repositories. flub is intended to replace the existing fluid build-tools, primarily by reusing existing build-tools functionality and wrapping it in a more consistent, maintainable CLI using oclif.

Usage

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

Command Topics

  • flub ai - AI-powered assistant for launching the right AI agent.
  • flub autocomplete - Display autocomplete installation instructions.
  • flub build-perf - Build performance observability commands for collecting, processing, and analyzing build metrics.
  • flub bump - Bump the version of packages, release groups, and their dependencies.
  • flub check - Check commands are used to verify repo state, apply policy, etc.
  • flub commands - List all flub commands.
  • flub exec - Run a shell command in the context of a package or release group.
  • flub generate - Generate commands are used to create/update code, docs, readmes, etc.
  • flub help - Display help for flub.
  • flub info - Get info about the repo, release groups, and packages.
  • flub list - List packages in a release group in topological order.
  • flub merge - Sync branches depending on the batch size passed
  • flub modify - Modify commands are used to modify projects to add or remove dependencies, update Fluid imports, etc.
  • flub promote - Promote commands are used to promote packages published to an npm registry.
  • flub publish - Publish commands are used to publish packages to an npm registry.
  • flub release - Release commands are used to manage the Fluid release process.
  • flub rename-types - Renames type declaration files from .d.ts to .d.mts.
  • flub report - Report analysis about the codebase, like code coverage and bundle size measurements.
  • flub transform - Transform commands are used to transform code, docs, etc. into alternative forms.
  • flub typetests - Updates configuration for type tests in package.json files. If the previous version changes after running preparation, then npm install must be run before building.
  • flub vnext - Vnext commands are new implementations of standard flub commands using new infrastructure.

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

Testing

The release command provides a testMode flag, which subclasses are expected to check when handling states. If in test mode, all handled states should immediately return true. This enables tests to verify that new states are handled in some way. Other commands could adopt this, but only the release command uses it today.

The release command also provides a state flag that can be used to initialize the state machine to a specific state. This is intended for testing.

Manual Integration Testing and Debugging

There are some VS Code launch targets like flub generate typetests that may work in some cases.

To run a locally built version of flub in contexts where the invocation of flub is done via package.json scripts, use a pnpm override. For client that is:

            "@fluid-tools/build-cli": "file:./build-tools/packages/build-cli",
            "@fluidframework/build-tools": "file:./build-tools/packages/build-tools",
            "@fluid-tools/version-tools": "file:./build-tools/packages/version-tools"

This approach can be used with flub generate typetests to ensure that the --entrypoint configuration, if any, from the scripts is included, and can be done from a JavaScript Debug console to debug, though breakpoints will need to be set in the .js files in node_modules (for example in node_modules/.pnpm/file+build-tools+packages+build-cli_@[email protected]/node_modules/@fluid-tools/build-cli/lib/commands/generate/typetests.js).

Alternatively, link: overrides give similar results and are known to support setting breakpoints directly in .ts files. When using link: be sure dependencies in build-tools are installed. See pnpm.ic documentation for more information.

            "@fluid-tools/build-cli": "link:./build-tools/packages/build-cli",
            "@fluidframework/build-tools": "link:./build-tools/packages/build-tools",
            "@fluid-tools/version-tools": "link:./build-tools/packages/version-tools"

Either pattern requires pnpm i --no-frozen-lockfile after setting overrides. If any build-tools package dependencies are updated when using file:, be sure to rerun for both workspaces.

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/build-cli 共发布 181 个版本,首次发布于 2022/08/26;过去 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/build-cli 的常见问题

@fluid-tools/build-cli 是什么?

Build tools for the Fluid Framework

如何安装 @fluid-tools/build-cli?

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

@fluid-tools/build-cli 支持 TypeScript 吗?

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

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

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

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

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

@fluid-tools/build-cli 可以商用吗?

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

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

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

@fluid-tools/build-cli 还在维护吗?

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