interface VersionFile

Defines how version files are generated using either built-in templates (TypeScript, JSON, YAML) or custom Vento templates.

Examples

Built-in template:

const versionFile: VersionFile = {
  path: "./version.ts",
  template: TemplateFormat.TYPESCRIPT
};

Custom Vento template:

const versionFile: VersionFile = {
  path: "./version.js",
  template: TemplateFormat.CUSTOM,
  customTemplate: `export const VERSION = "{{ version }}";`
};

Properties

path: string

Path to the version file relative to project root

Template format (typescript, json, yaml, custom)

optional
customTemplate: string

When using TemplateFormat.CUSTOM, provide a Vento template string. Template has access to all TemplateData properties and custom filters.

deprecated
optional
patterns: { [key: string]: RegExp | undefined; version?: RegExp; buildDate?: RegExp; gitCommit?: RegExp; }

Legacy patterns for extracting/updating version info

Define additional constants, classes, functions, or types to be included in the generated version file. This allows extending the built-in templates with project-specific exports without writing a full custom template.

optional
extend: { prepend?: string; append?: string; }

Advanced option to prepend or append raw content to the generated file. Useful for adding imports, comments, or complex code that doesn't fit the additionalExports structure.