Sovra is a high-performance, Rust-based utility for monorepos designed to identify affected test files by analyzing code changes and their import graphs. It leverages Oxc for its underlying dependency resolution, ensuring fast execution. The library provides a Node.js API to determine which tests should be run in a given CI pipeline, significantly speeding up large repository workflows. It ships with comprehensive TypeScript support, including path aliases, and offers configurable resolver options that align with `oxc-resolver`. Currently at version 0.2.0, it is in active development, focusing on performance and accuracy for JavaScript and TypeScript projects. Its primary differentiator is its Rust-powered speed and its direct integration for test selection based on file changes.
npm install sovraVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `getAffected` to find test files impacted by recent Git changes, leveraging `glob` for file discovery and `tsconfig.json` for path resolution.
Refactor your codebase to use static import paths that can be resolved during static analysis. Avoid dynamic import or require patterns where possible for files that need to be tracked by Sovra.
Monitor the project's GitHub repository and release notes for upcoming breaking changes. Consider pinning to exact patch versions or reviewing changes when updating minor versions in production environments.
Modify the source code to use only static import paths that can be resolved at build time. Sovra's Rust-based analysis requires fixed import declarations.
Ensure you check `affected.files` and `affected.errors` for existence before attempting to access them, as shown in the quickstart example. Always wrap calls to `getAffected` in a `try...catch` block if not awaiting a Promise directly.
Install `glob` as a development dependency (`npm install -D glob` or `yarn add -D glob`). `node:child_process` is a built-in Node.js module and does not require installation; ensure your Node.js version is compatible and correctly referenced.