Template processing and file generation using Vento.
Handles template compilation and rendering with enhanced data preparation. Supports built-in templates (TypeScript, JSON, YAML) and custom templates.
TemplateProcessor(config: NagareConfig)
Initialize template processor with Vento environment.
generateVersionFile(data: TemplateData): Promise<string>
Generate version file content using built-in templates
Uses the configured template format to generate version file content. Supports extending templates with additional exports and custom content.
processTemplate(template: string,data: TemplateData): Promise<string>
Process a template string with data using Vento
Compiles and renders a template with enhanced data preparation. Throws descriptive errors for template compilation or rendering failures.
validateTemplate(template: string): Promise<{ valid: boolean; error?: string; }>
Test template compilation (useful for validation)
Validates template syntax without rendering data. Useful for configuration validation and debugging.