@reliverse/rse
Version:
@reliverse/rse is your all-in-one companion for bootstrapping and improving any kind of projects (especially web apps built with frameworks like Next.js) — whether you're kicking off something new or upgrading an existing app. It is also a little AI-power
36 lines (35 loc) • 1.44 kB
TypeScript
/**
* Utility to extract author and project name from template URL
*/
export declare function extractRepoInfo(templateUrl: string): {
inputRepoAuthor: string;
inputRepoName: string;
};
export interface ReplaceConfig {
fileExtensions?: string[];
excludedDirs?: string[];
stringExclusions?: string[];
verbose?: boolean;
dryRun?: boolean;
skipBinaryFiles?: boolean;
maxConcurrency?: number;
stopOnError?: boolean;
}
/**
* Replaces specified strings in files under a target directory.
* Supports concurrent processing, binary file detection, and dry runs.
*
* @param projectPath - Root directory to process files in
* @param oldValues - Map of strings to replace (key) with their replacements (value)
* @param config - Optional configuration for file processing:
* - fileExtensions: File types to process (e.g., [".js", ".ts"])
* - excludedDirs: Directories to skip (e.g., ["node_modules"])
* - stringExclusions: Strings to never replace
* - verbose: Enable detailed logging
* - dryRun: Preview changes without writing
* - skipBinaryFiles: Skip processing of binary files
* - maxConcurrency: Limit parallel processing
* - stopOnError: Stop on first error
* @throws Error if target directory doesn't exist or processing fails
*/
export declare function replaceStringsInFiles(projectPath: string, oldValues: Record<string, string>, config?: ReplaceConfig): Promise<void>;