# @front-ops/domino 中文文档

规范地址：https://npmcn.com/package/%40front-ops/domino/

版本：2\.2\.1
npm 元数据更新时间：2026-11-08T09:26:24.739Z
中文译文更新时间：2026-11-15T14:42:41.344Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40front-ops/domino
原文对照：https://npmcn.com/package/%40front-ops/domino/?lang=original
项目主页：https://github.com/frontops-dev/domino#readme
源码仓库：https://github.com/frontops-dev/domino

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：42.7 kB，6 个文件
- 模块格式：CommonJS
- TypeScript 类型：包内自带
- Node.js 要求：\>= 12\.22\.0 \< 13 \|\| \>= 14\.17\.0 \< 15 \|\| \>= 15\.12\.0 \< 16 \|\| \>= 
- 运行依赖：0 个
- 首次发布：2025-12-07T19:12:07.525Z
- 最新版本发布：2026-11-08T09:26:24.367Z
- 近 30 天下载量：226701（2026-10-16 至 2026-11-14，npm 官方下载统计）
- 已发布版本数：53（近 12 个月 53 个）

## 中文简介

True 受影响 - 单体语义变化检测

## 安装

```sh
npm install @front-ops/domino
```

也可以使用：`pnpm add @front-ops/domino`、`yarn add @front-ops/domino`、`bun add @front-ops/domino`

## README

![domino logo](https://github.com/user-attachments/assets/012a005f-04e4-480e-8d50-5314bdd04a6d)

# 多米诺

高性能的粗口执行 **真实受影响** ——用Oxc解析器对单体进行语义变化检测.

  

## 概览

多米诺是TypeScript版本的倒置替换 [贸易](https://github.com/lemonade-hq/traf),为同样的语义分析能力提供了显著更好的性能,这要归功于Rust和Oxc parser.

## 特征

-   **语义变化检测**:分析 AST 级别上的实际代码更改,而不仅仅是文件更改
-   **交叉参考追踪**: 在整个工作空间跟踪符号引用
-   **锁定文件更改检测**: 检测 npm 、 纱线 、 pnpm 和 bun 锁文件和被影响的痕迹的依赖性版本变化
-   **快速氧化解析器**: 3-5x 速度快于 TypeScript 的编译器 API
-   **工作空间支持**:与Nx、Turborepo和通用npm/yarn/pnpm/bun工作空间有关的工程
-   **全局无效**: 荣誉Nx `namedInputs` 工作空间根图案(例如. `sharedGlobals`)和涡轮风波 `globalDependencies` 从 `turbo.json` 编号 : `turbo.jsonc`,因此更改为共享根文件标记每个受影响的工程
-   **根 tsconfig 变化**: 更改工作空间根 `tsconfig.base.json` 由每个工作空间类型处理 `--root-tsconfig-strategy` (节点: `rootTsconfigStrategy`) (中文(简体) ). 默认, `aliases`,将更改缩小为 `compilerOptions.paths` 单是:使用添加、去除或重新瞄准别名的文件受到影响,无论它们是否导入, `require` 这, `import()` 它、副作用进口或再出口(项目根数中的配置文件和其他非源文件); `.git`, (中文(简体) ), `node_modules` 并跳过前8个 KiB 不为 UTF-8 的文件,并检查植入工作空间根的工程 `sourceRoot` 他们的用法,是可追踪的。 绑定名称的导入像被更改的符号一样被追踪,通过使用该符号的代码;以名称命名的再出口 `export *` 进口商从桶中取出每个名称,但桶出口本身的名称除外;如果一个文件到达了别名而无约束力,则可以追踪每一份出口(一个文件只在评论中提及, `jest.mock()` 或者说 `declare module`,被接受的超选). 任何其他更改(另一个编译器选项, `baseUrl`, (中文(简体) ), `extends`,一个孩子 `paths` 出现或消失 `extends`,不可解析的文件,或带有 `*` 而不是跟踪 `/*`影响每个项目. `all` 总是影响每个项目; `none` 将文件与其他根文件一样对待。 A 类 `namedInputs` 输入列出文件的条目,无论策略如何,仍然在全球无效
-   **模块分辨率**: 精确模块分辨率使用oxc resolver(同滚落和Nova)

## 快速启动

```bash
# Run directly with npx (no installation required)
npx @front-ops/domino@latest affected

# Show all projects in the workspace
npx @front-ops/domino@latest affected --all
```

## 安装

### 使用 npx( 建议)

不需要安装! 运行:

```bash
npx @front-ops/domino@latest affected
```

### 二进制安装

如果您喜欢使用独立的二进制 :

```bash
# Clone and build from source
git clone git@github.com:frontops-dev/domino.git
cd domino
cargo build --release

# The binary will be available at ./target/release/domino
# You can then run it from anywhere:
/path/to/domino/target/release/domino affected
```

## 使用量

### 使用 npx

```bash
# Show all projects in the workspace
npx @front-ops/domino affected --all

# Find affected projects (compared to origin/main)
npx @front-ops/domino affected

# Use a different base branch
npx @front-ops/domino affected --base origin/develop

# Compare specific commits (useful in CI patch pipelines)
npx @front-ops/domino affected --base abc123 --head def456

# Output as JSON
npx @front-ops/domino affected --json

# Enable debug logging
npx @front-ops/domino affected --debug

# Generate a detailed report
npx @front-ops/domino affected --report report.html
```

### 使用二进制

如果你从源头建了二进制:

```bash
# Show all projects in the workspace
domino affected --all

# Find affected projects (compared to origin/main)
domino affected

# Use a different base branch
domino affected --base origin/develop

# Compare specific commits (useful in CI patch pipelines)
domino affected --base abc123 --head def456

# Output as JSON
domino affected --json

# Enable debug logging
domino affected --debug

# Generate a detailed report
domino affected --report report.html
```

### 选项

-   `--base <BRANCH>`: 基准分支比较(默认值: `origin/main`(中文(简体) )
-   `--head <COMMIT>`: 头部承诺比较( 默认为工作树)
-   `--all`: 显示所有工程,不论修改
-   `--json`: 作为 JSON 的产出结果
-   `--report <PATH>`: 生成详细的分析报告
-   `--debug`: 启用调试记录
-   `--cwd <PATH>`: 设置当前工作目录
-   `--lockfile-strategy <STRATEGY>`: Lockfile 更改检测策略( 默认 ): `direct`(中文(简体) )
-   `--root-tsconfig-strategy <STRATEGY>`: 怎么样 `tsconfig.base.json` 变化影响项目: `aliases`, (中文(简体) ), `all` 或者说 `none` (默认 : `aliases`(中文(简体) )

### 锁定文件更改检测

多米诺自动检测您的锁文件更改时, 并识别哪些项目受到依赖性版本更新的影响 。 与所有主要软件包管理者合作:

| 软件包管理器 | 锁定文件 |
| --- | --- |
| 无 | `package-lock.json` |
| 线条 | `yarn.lock` |
| 小时 | `pnpm-lock.yaml` |
| 包头 | `bun.lock` |

有三个战略是通过下列途径提供的: `--lockfile-strategy`数字 :

-   **`none`** ——完全忽略锁文件更改
-   **`direct`** (默认)——标记直接导入受影响的依赖的项目
-   **`full`** - 喜欢 `direct`,但也追踪到全部参考链(例如如果 `lib-a` 已更改和 `ProjectA` 进口, `full` 跟踪所有再出口 `lib-a` 符号以查找其他受影响的项目)

检测是过渡性的:如果一个深深地嵌入的依赖性变化,多米诺走出反向依赖性图来找出哪些直接依赖性受到影响,然后发现所有项目都导入了这种依赖性.

```bash
# Default: detect lockfile changes with "direct" strategy
domino affected

# Disable lockfile detection
domino affected --lockfile-strategy none

# Full reference chain tracing
domino affected --lockfile-strategy full
```

## 如何运作

1.  **Git Diff 分析**: 检测哪些文件和特定行已经改变
2.  **语义解析**: 使用 Oxc 解析所有类型脚本/ JavaScript 文件
3.  **文号 决议**: 确定修改了哪些符号(功能、类、常数)
4.  **参考查找**: 递归查找这些符号的所有交叉文件引用
5.  **锁定文件分析**: 检测到依赖性版本的变化和所受影响的进口痕迹
6.  **项目绘图**: 将受影响的文件映射到自己的项目
7.  **隐性依赖**: 展开 Nx `implicitDependencies` 针对已知项目 **名称**,包括词汇图案`app-*`, (中文(简体) ), `integration-*-module`和 `!` 排除 – 与 Nx/ minmatch 相同的想法, 而不是路径阴影
8.  **目标配置链接**: 跟踪在 a 中命名的项目 `project.json` 目标 `inputs` (单位:千美元)`{ "input": "production", "projects": ["shared-config"] }`和 `dependsOn` (单位:千美元)`{ "projects": ["api"], "target": "build" }`,或 `"api:build"` string form),它不会创建自己的工程图边缘. `nx.json` `targetDefaults` 为项目宣布的目标提供这些字段,而不设置这些字段,以 Nx 的关键优先(执行者,然后是目标名称,然后是目标名称 glob, 匹配小型匹配样式); 项目本身的字段获胜 。 这个 `self` 财务报告和审定财务报表 `dependencies` 关键字没有添加链接, 标记选择器( n)`tag:x`)和外接键(`@(a|b)`不支持,以及 `filter`s 在数组形式上 `targetDefaults` 不评价条目(它们的链接总是适用的,完全过滤的密钥不会隐藏下一个密钥)。 目标配置已声明 `package.json#nx`,和 Nx 插件推断的目标,不读取.

## 业绩

多亏了Rust和Oxc,多米诺显著快于TypeScript版本:

-   **分析**: 使用 Oxc 的3-5x 速度更快
-   **内存**: 降低内存足迹
-   **启动**: 近起步时间

## 与类型脚本版本的比较

| 特性 | 类型脚本 | 锈 |
| --- | --- | --- |
| 解析器 | ts-形态( TypeScript 编译器) | 氧化解析器 |
| 速度 | 基线 | 3 - 5 转快 |
| 内存 | 基线 | 减-50% |
| 二进制大小 | 需要节点.js + 道克 | 单个独立二进制 |
| 启动时间 | ~1-2s 宽度 | < 100 分钟 |

## 建筑

### 核心组成部分

-   **Git 整合** (单位:千美元)`src/git.rs`: 支持 git diffs 以识别已更改的文件和行
-   **工作空间发现** (单位:千美元)`src/workspace/`:发现Nx,Turbo,以及通用npm/yarn/pnpm/bun工作空间的项目
-   **语义分析器** (单位:千美元)`src/semantic/analyzer.rs`: 使用Oxc来解析和分析类型Script/JavaScript
-   **参考查找器** (单位:千美元)`src/semantic/reference_finder.rs`: 音轨交叉文件符号引用
-   **锁定文件分析器** (单位:千美元)`src/lockfile.rs`: 解析锁文件,构建反向依赖图,并检测受影响的包
-   **核心算法** (单位:千美元)`src/core.rs`: 管弦乐 受影响的探测逻辑

### 主要技术

-   **[氧化物](https://github.com/oxc-project/oxc)**: 高性能 JavaScript/ TypeScript 解析器和工具链
-   **oxc 解析器**: 模块分辨率(由Rolldown, Nova, knip所使用)
-   **掌声**: CLI 参数解析
-   **gi2**: 基特整合
-   **塞尔维亚**JSON/YAML 解析

## 发展

### 快速引用

```bash
# Build (debug)
cargo build

# Build (release)
cargo build --release

# Run tests
cargo test

# Run integration tests (must be serial)
cargo test --test integration_test -- --test-threads=1

# Run from source
cargo run -- affected --all

# Format code
cargo fmt

# Lint code
cargo clippy

# Enable debug logging
RUST_LOG=domino=debug cargo run -- affected
```

## 许可证

麻省理工学院 - 看 [自由主义](https://npmcn.com/package/%40front-ops/domino/LICENSE)。 。 。 .

## 贷项

这是原版的Rust端口 [贸易](https://github.com/lemonade-hq/traf) TypeScript 执行.

以下列方式建造:

-   [氧化物](https://github.com/oxc-project/oxc) - JavaScript Oxidation 编译器
-   [oxc 解析器](https://github.com/oxc-project/oxc-resolver) - 快速模块分辨率

## 常见问题

### @front-ops/domino 是什么？

True 受影响 - 单体语义变化检测

### 如何安装 @front-ops/domino？

在项目目录运行 npm install @front-ops/domino，或使用 pnpm add / yarn add / bun add。它还提供命令行工具 domino，可以用 npx domino 直接运行。

### @front-ops/domino 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @front-ops/domino 支持 ESM 还是 CommonJS？

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

### @front-ops/domino 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>= 12\.22\.0 \< 13 \|\| \>= 14\.17\.0 \< 15 \|\| \>= 15\.12\.0 \< 16 \|\| \>= 。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @front-ops/domino 可以商用吗？

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

### @front-ops/domino 的下载量有多少？

根据 npm 官方下载统计，@front-ops/domino 在 2026/10/16 – 2026/11/14 这 30 天内被下载 226,701 次，日均约 7,557 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @front-ops/domino 还在维护吗？

最新版本 2\.2\.1 发布于 2026/11/08（7 天前）；至今共发布 53 个版本，其中过去 12 个月发布了 53 个；首次发布于 2025/12/08。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

