UNPKG

@reliverse/rse-sdk

Version:

@reliverse/rse-sdk allows you to create new plugins for @reliverse/rse CLI, interact with reliverse.org, and even extend your own CLI functionality (you may also try @reliverse/dler-sdk for this case).

36 lines (35 loc) 1.44 kB
/** * 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>;