buddy-bot
Version:
The Stacks CLI.
56 lines • 2.3 kB
TypeScript
import type { Logger } from './logger';
import type { PackageFile, PackageUpdate, UpdateGroup } from '../types';
/**
* Parse package file content based on file type
*/
export declare function parsePackageFile(content: string, filePath: string): Promise<PackageFile | null>;
/**
* Detect package manager based on lock files and configuration
*/
export declare function detectPackageManager(_projectPath: string): 'bun' | 'npm' | 'yarn' | 'pnpm';
/**
* Format commit message for dependency updates
*/
export declare function formatCommitMessage(updates: PackageUpdate[], template?: string): string;
/**
* Format pull request title
*/
export declare function formatPRTitle(updates: PackageUpdate[], template?: string): string;
/**
* Format pull request body with update details
*/
export declare function formatPRBody(updates: PackageUpdate[], template?: string): string;
/**
* Generate branch name for dependency updates
*/
export declare function generateBranchName(updates: PackageUpdate[], prefix?: any): string;
/**
* Group updates based on configuration and type
*/
export declare function groupUpdates(updates: PackageUpdate[]): UpdateGroup[];
/**
* Sort updates by priority (major > minor > patch)
*/
export declare function sortUpdatesByPriority(updates: PackageUpdate[]): PackageUpdate[];
/**
* Parse version string and determine update type using Bun's semver
*/
export declare function getUpdateType(currentVersion: string, newVersion: string): 'major' | 'minor' | 'patch';
/**
* Check if version satisfies semver range
*/
export declare function satisfiesRange(version: string, range: string): boolean;
/**
* Check for PRs that have the rebase checkbox checked
*/
export declare function checkForRebaseRequests(token: string, owner: string, repo: string): Promise<Array<{ number: number, branchName: string }>>;
/**
* Extract package names from PR body
*/
export declare function extractPackageNamesFromPRBody(body: string): string[];
/**
* Check if a PR should be auto-closed due to respectLatest config changes
* This handles cases where old PRs were created with respectLatest: false
* but now the config is respectLatest: true, making those updates invalid
*/
export declare function checkForAutoClose(pr: any, config: any, logger: Logger): Promise<boolean>;