xrelease
Version:
xrelease (pronounced cross-release) helps you setup automated releases for your project for any language
34 lines (33 loc) • 1.31 kB
TypeScript
import type { ComponentConfig, TemplateConfig } from '../types/index.js';
export declare const TEMPLATE_DIR: string;
export declare const TEMPLATES: Record<string, Record<string, TemplateConfig[]>>;
export declare function setupTemplates(components: ComponentConfig, templates: typeof TEMPLATES, destDir?: string): Promise<void>;
export declare function setupPackageJson(dir?: string, language?: string): Promise<string>;
export declare function processTemplates(templates: TemplateConfig[], baseDestDir?: string): Promise<void>;
/**
* Updates version strings in a file using regex pattern and template.
* Supports both ${version} for new version and ${N} for regex capture groups.
*
* @example
* // Update go.mod module path while preserving the path
* await updateVersionInFile({
* path: 'go.mod',
* pattern: '^module\\s+([^\\s]+)',
* template: 'module ${1}',
* version: '1.0.0'
* });
*
* // Update package.json version
* await updateVersionInFile({
* path: 'package.json',
* pattern: '"version":\\s*"([^"]+)"',
* template: '"version": "${version}"',
* version: '1.0.0'
* });
*/
export declare function updateVersionInFile({ path: filePath, pattern, template, version, }: {
path: string;
pattern: string;
template: string;
version: string;
}): Promise<void>;