@front-ops/domino

中文文档
2.2.1发布于 2026/11/08MITTypeScriptCommonJS零依赖构建来源已验证近 30 天下载 22.7万

True Affected - Semantic change detection for monorepos

原始使用文档
文档目录21 节
  1. Overview
  2. Features
  3. Quick Start
  4. Installation
  5. Using npx (Recommended)
  6. Binary Installation
  7. Usage
  8. Using npx
  9. Using the Binary
  10. Options
  11. Lockfile Change Detection
  12. How It Works
  13. Performance
  14. Comparison with TypeScript Version
  15. Architecture
  16. Core Components
  17. Key Technologies
  18. Development
  19. Quick Reference
  20. License
  21. Credits

domino logo

domino

A high-performance Rust implementation of True Affected — semantic change detection for monorepos using the Oxc parser.


Overview

domino is a drop-in replacement for the TypeScript version of traf, providing the same semantic analysis capabilities with significantly better performance thanks to Rust and the Oxc parser.

Features

  • Semantic Change Detection: Analyzes actual code changes at the AST level, not just file changes
  • Cross-File Reference Tracking: Follows symbol references across your entire workspace
  • Lockfile Change Detection: Detects dependency version changes in npm, yarn, pnpm, and bun lockfiles and traces affected projects
  • Fast Oxc Parser: 3-5x faster than TypeScript's compiler API
  • Workspace Support: Works with Nx, Turborepo, and generic npm/yarn/pnpm/bun workspaces
  • Global Invalidation: Honors Nx namedInputs workspace-root patterns (e.g. sharedGlobals) and Turborepo globalDependencies from turbo.json / turbo.jsonc, so a change to a shared root file marks every project affected
  • Root tsconfig changes: A change to the workspace-root tsconfig.base.json is handled in every workspace type by --root-tsconfig-strategy (Node: rootTsconfigStrategy). The default, aliases, narrows a change to compilerOptions.paths alone: files using an added, removed or re-targeted alias are affected, whether they import it, require it, import() it, side-effect-import it or re-export it (config and other non-source files in a project root count too; .git, node_modules and files whose first 8 KiB are not UTF-8 are skipped, and a project rooted at the workspace root is checked through its sourceRoot only), and what uses them is traced. An import that binds a name is traced like a changed symbol, through the code using it; a named re-export by its name; an export * by every name importers take from the barrel, except names the barrel exports itself; and a file that reaches the alias without a binding has every export traced (as does one that only mentions it in a comment, jest.mock() or declare module, an accepted over-selection). Any other change (another compiler option, baseUrl, extends, a child paths appearing or vanishing under extends, an unparseable file, or an alias key with a * other than a trailing /*) affects every project. all always affects every project; none treats the file like any other root file. A namedInputs entry that lists the file still invalidates globally whatever the strategy
  • Module Resolution: Uses oxc_resolver (same as Rolldown and Nova) for accurate module resolution

Quick Start

# 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

Installation

No installation required! Just run:

npx @front-ops/domino@latest affected

Binary Installation

If you prefer to use the standalone binary:

# Clone and build from source
git clone [email protected]: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

Usage

Using npx

# 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

Using the Binary

If you've built the binary from source:

# 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

Options

  • --base <BRANCH>: Base branch to compare against (default: origin/main)
  • --head <COMMIT>: Head commit to compare (defaults to working tree)
  • --all: Show all projects regardless of changes
  • --json: Output results as JSON
  • --report <PATH>: Generate a detailed analysis report
  • --debug: Enable debug logging
  • --cwd <PATH>: Set the current working directory
  • --lockfile-strategy <STRATEGY>: Lockfile change detection strategy (default: direct)
  • --root-tsconfig-strategy <STRATEGY>: How a tsconfig.base.json change affects projects: aliases, all or none (default: aliases)

Lockfile Change Detection

domino automatically detects when your lockfile changes and identifies which projects are affected by dependency version updates. This works with all major package managers:

Package ManagerLockfile
npmpackage-lock.json
yarnyarn.lock
pnpmpnpm-lock.yaml
bunbun.lock

Three strategies are available via --lockfile-strategy:

  • none — Ignore lockfile changes entirely
  • direct (default) — Mark projects that directly import an affected dependency
  • full — Like direct, but also traces the full reference chain (e.g. if lib-a changed and ProjectA imports it, full follows all re-exports of lib-a symbols to find additional affected projects)

The detection is transitive: if a deeply nested dependency changes, domino walks the reverse dependency graph to find which direct dependency was affected, then finds all projects importing that dependency.

# 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

How It Works

  1. Git Diff Analysis: Detects which files and specific lines have changed
  2. Semantic Parsing: Parses all TypeScript/JavaScript files using Oxc
  3. Symbol Resolution: Identifies which symbols (functions, classes, constants) were modified
  4. Reference Finding: Recursively finds all cross-file references to those symbols
  5. Lockfile Analysis: Detects dependency version changes and traces affected imports
  6. Project Mapping: Maps affected files to their owning projects
  7. Implicit Dependencies: Expands Nx implicitDependencies against known project names, including glob patterns (app-*, integration-*-module) and ! exclusions — same idea as Nx/minimatch, not path globs
  8. Target Config Links: Follows projects named in a project.json target's inputs ({ "input": "production", "projects": ["shared-config"] }) and dependsOn ({ "projects": ["api"], "target": "build" }, or the "api:build" string form), which create no project-graph edge of their own. nx.json targetDefaults supply those fields for targets a project declares without setting them, with Nx's key precedence (executor, then target name, then target-name glob, matched minimatch-style); a project's own field wins. The self and dependencies keywords add no link, tag selectors (tag:x) and extglob keys (@(a|b)) are not supported, and filters on array-form targetDefaults entries are not evaluated (their links always apply, and a fully filtered key does not hide the next one). Target config declared in package.json#nx, and targets inferred by Nx plugins, are not read.

Performance

Thanks to Rust and Oxc, domino is significantly faster than the TypeScript version:

  • Parsing: 3-5x faster using Oxc
  • Memory: Lower memory footprint
  • Startup: Near-instant startup time

Comparison with TypeScript Version

FeatureTypeScriptRust
Parserts-morph (TypeScript compiler)Oxc parser
SpeedBaseline3-5x faster
MemoryBaseline~50% less
Binary SizeRequires Node.js + depsSingle standalone binary
Startup Time~1-2s<100ms

Architecture

Core Components

  • Git Integration (src/git.rs): Parses git diffs to identify changed files and lines
  • Workspace Discovery (src/workspace/): Discovers projects in Nx, Turbo, and generic npm/yarn/pnpm/bun workspaces
  • Semantic Analyzer (src/semantic/analyzer.rs): Uses Oxc to parse and analyze TypeScript/JavaScript
  • Reference Finder (src/semantic/reference_finder.rs): Tracks cross-file symbol references
  • Lockfile Analyzer (src/lockfile.rs): Parses lockfiles, builds reverse dependency graphs, and detects affected packages
  • Core Algorithm (src/core.rs): Orchestrates the affected detection logic

Key Technologies

  • Oxc: High-performance JavaScript/TypeScript parser and toolchain
  • oxc_resolver: Module resolution (used by Rolldown, Nova, knip)
  • clap: CLI argument parsing
  • git2: Git integration
  • serde: JSON/YAML parsing

Development

Quick Reference

# 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

License

MIT - see LICENSE.

Credits

This is a Rust port of the original traf TypeScript implementation.

Built with:

  • Oxc - The JavaScript Oxidation Compiler
  • oxc_resolver - Fast module resolution

版本与发布记录

@front-ops/domino 共发布 53 个版本,首次发布于 2025/12/08;过去 12 个月发布了 53 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.2.1latest2026/11/087 天前
2.2.02026/11/0213 天前
2.1.02026/10/2126 天前
2.0.62026/10/2126 天前
2.0.52026/10/1828 天前
2.0.42026/10/111 个月前

关于 @front-ops/domino 的常见问题

@front-ops/domino 是什么?

True Affected - Semantic change detection for monorepos

如何安装 @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 和提交记录判断。