docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A command-line tool that selects workspace packages based on Git changes between commits or branches, similar to how pnpm filters packages when using Git diff filtering.
[origin/main] to select packages changed since the origin/main branch @test[HEAD~2] to select packages changed in the last 2 commits @test[abc123] to select packages changed since commit abc123 @test[HEAD~1] returns only package A @test[main] returns both packages A and B @test[HEAD~1] returns an empty list @test/**
* Represents a workspace package with its location
*/
export interface WorkspacePackage {
name: string;
path: string;
}
/**
* Parses a Git filter expression like [origin/main] or [HEAD~2]
* and returns the Git reference to compare against.
*
* @param filterExpression - The filter expression in format [gitref]
* @returns The Git reference (e.g., "origin/main", "HEAD~2")
* @throws Error if the expression format is invalid
*/
export function parseGitFilter(filterExpression: string): string;
/**
* Gets the list of files that changed between the current state
* and the specified Git reference.
*
* @param gitRef - The Git reference to compare against
* @returns Array of file paths that have changed
* @throws Error if Git reference doesn't exist or not in a Git repository
*/
export function getChangedFiles(gitRef: string): Promise<string[]>;
/**
* Selects workspace packages that have changes based on Git diff.
*
* @param packages - Array of workspace packages to filter
* @param gitRef - The Git reference to compare against
* @returns Array of packages that contain changed files
* @throws Error if Git reference doesn't exist or not in a Git repository
*/
export function selectChangedPackages(
packages: WorkspacePackage[],
gitRef: string
): Promise<WorkspacePackage[]>;Provides the Git integration for filtering functionality that this tool is based on.