NagareConfig Reference
Overview
Section titled “Overview”The NagareConfig interface defines all configuration options for Nagare. Configuration is typically provided via a
nagare.config.ts file in your project root.
Synopsis
Section titled “Synopsis”import type { NagareConfig } from "@rick/nagare";
export default { project: {/* required */}, versionFile: {/* required */}, // ... optional configurations} as NagareConfig;Description
Section titled “Description”NagareConfig is the main configuration interface that controls all aspects of Nagare’s behavior, from version file generation to release workflows. It requires minimal configuration (project info and version file) but supports extensive customization through optional properties.
Configuration Properties
Section titled “Configuration Properties”project {#project}
Section titled “project {#project}”Type: object
Required: Yes
Properties:
name(string, required) - Project namedescription(string, optional) - Project descriptionrepository(string, required) - Repository URLhomepage(string, optional) - Project homepage URLlicense(string, optional) - Project license (e.g., “MIT”)author(string, optional) - Author information
Project metadata used in version files and release documentation.
Example:
project: { name: 'My App', description: 'A fantastic Deno application', repository: 'https://github.com/user/my-app', homepage: 'https://my-app.deno.dev', license: 'MIT', author: 'Your Name'}versionFile {#versionFile}
Section titled “versionFile {#versionFile}”Type: VersionFile
Required: Yes
Properties:
path(string, required) - Path to version file relative to project roottemplate(TemplateFormat, required) - Template format:"typescript","json","yaml", or"custom"customTemplate(string, optional) - Custom Vento template (required when template is"custom")additionalExports(AdditionalExport[], optional) - Additional exports to includeextend(object, optional) - Content to prepend/append to generated filepatterns(object, deprecated) - Legacy regex patterns for version extraction
Configures how version files are generated.
Example with built-in template:
versionFile: { path: './version.ts', template: 'typescript'}Example with custom template:
versionFile: { path: './version.js', template: 'custom', customTemplate: ` export const VERSION = "{{ version }}"; export const BUILD_DATE = "{{ buildDate }}"; `}releaseNotes {#releaseNotes}
Section titled “releaseNotes {#releaseNotes}”Type: ReleaseNotesConfig
Required: No
Default: { includeCommitHashes: true, maxDescriptionLength: 100 }
Properties:
template(string, optional) - Custom Vento template for release notes sectionmetadata(Record<string, unknown>, optional) - App-specific metadata to includeincludeCommitHashes(boolean, optional) - Include git commit hashes (default: true)maxDescriptionLength(number, optional) - Max commit description length (default: 100)
Controls release notes generation and formatting.
Example:
releaseNotes: { includeCommitHashes: true, maxDescriptionLength: 80, metadata: { features: ['Authentication', 'API'], endpoints: ['/api/v1', '/health'] }}github {#GitHub}
Section titled “github {#GitHub}”Type: GitHubConfig
Required: No
Properties:
owner(string, required) - Repository owner/organizationrepo(string, required) - Repository namecreateRelease(boolean, optional) - Create GitHub releases (default: true)releaseTemplate(string, optional) - Custom release templatetokenEnvVar(string, optional) - Environment variable for token (default: “GitHub_TOKEN”)
GitHub integration settings for creating releases.
Example:
github: { owner: 'myorg', repo: 'my-app', createRelease: true, tokenEnvVar: 'GH_TOKEN'}updateFiles {#updateFiles}
Section titled “updateFiles {#updateFiles}”Type: FileUpdatePattern[]
Required: No
Properties per pattern:
path(string, required) - File path relative to project rootpatterns(object, optional) - Key-value regex patterns for find/replaceupdateFn(function, optional) - Custom update function
Additional files to update during release (beyond the version file).
Example with safe patterns:
updateFiles: [ { path: "./deno.json", patterns: { // Line-anchored pattern prevents corruption version: /^(\s*)"version":\s*"([^"]+)"/m, }, }, { path: "./README.md", updateFn: (content, data) => { return content.replace( /Version: \d+\.\d+\.\d+/, `Version: ${data.version}`, ); }, },];commitTypes {#commitTypes}
Section titled “commitTypes {#commitTypes}”Type: CommitTypeMapping
Required: No
Default: Standard conventional commit mappings
Properties: Maps commit types to changelog sections
Custom mappings from conventional commit types to changelog sections.
Example:
commitTypes: { feat: 'added', fix: 'fixed', perf: 'changed', security: 'security', breaking: 'removed'}templates {#templates}
Section titled “templates {#templates}”Type: TemplateConfig
Required: No
Properties:
templatesDir(string, optional) - Directory for external template filesdataProviders(Record<string, () => Promise>, optional) - Dynamic data providers
Advanced template configuration.
Example:
templates: { templatesDir: './templates', dataProviders: { buildMetrics: async () => ({ size: await getBundleSize(), tests: await getTestCount() }) }}docs {#docs}
Section titled “docs {#docs}”Type: DocsConfig
Required: No
Properties:
enabled(boolean, required) - Enable documentation generationoutputDir(string, optional) - Output directory (default: ”./docs”)includePrivate(boolean, optional) - Include private API (default: false)denoDocOptions(string[], optional) - Additional deno doc options
Documentation generation settings.
Example:
docs: { enabled: true, outputDir: './docs/api', includePrivate: false, denoDocOptions: ['--html']}options {#options}
Section titled “options {#options}”Type: ReleaseOptions
Required: No
Properties:
dryRun(boolean, optional) - Preview changes without applyingskipConfirmation(boolean, optional) - Skip confirmation promptsgitRemote(string, optional) - Git remote name (default: “origin”)tagPrefix(string, optional) - Git tag prefix (default: “v”)logLevel(LogLevel, optional) - Log verbosity: DEBUG, INFO, WARN, ERROR
General release options.
Example:
options: { tagPrefix: 'release-', gitRemote: 'upstream', logLevel: 'DEBUG'}security {#security}
Section titled “security {#security}”Type: SecurityConfig
Required: No
Since: 1.6.0
Properties:
templateSandbox(“strict” | “moderate” | “disabled”, optional) - Template sandboxing level (default: “strict”)validateFilePaths(boolean, optional) - Enable path validation (default: true)auditLog(boolean, optional) - Enable security audit logging (default: false)allowedFunctions(string[], optional) - Functions allowed in moderate modemaxTemplateSize(number, optional) - Max template size in bytes (default: 1MB)
Security configuration for template processing and file operations.
Example:
security: { templateSandbox: 'strict', validateFilePaths: true, auditLog: true, maxTemplateSize: 524288 // 512KB}release {#release}
Section titled “release {#release}”Type: ReleaseConfig
Required: No
Since: 3.0.0
Properties:
verifyJsrPublish(boolean | JsrVerificationConfig, optional) - JSR publish verificationautoFix(AutoFixConfig, optional) - Automatic error fixingprogress(ProgressConfig, optional) - Progress visualizationmonitoring(MonitoringConfig, optional) - GitHub Actions monitoringpreflightChecks(PreflightChecksConfig, optional) - Pre-release validation
Advanced release workflow configuration.
Example:
release: { verifyJsrPublish: { enabled: true, maxAttempts: 30, pollInterval: 10000 }, autoFix: { basic: true, ai: { enabled: true, provider: 'claude-code', thinkingLevel: 'think' } }, preflightChecks: { runTests: true, custom: [{ name: 'Security Scan', command: ['deno', 'task', 'security'], fixable: false }] }}hooks {#hooks}
Section titled “hooks {#hooks}”Type: object
Required: No
Since: 1.1.0
Properties:
preRelease(Array<() => Promise>, optional) - Functions to run before release postRelease(Array<() => Promise>, optional) - Functions to run after release
Lifecycle hooks for custom operations.
Example:
hooks: { preRelease: [ async () => { const result = await runTests(); if (!result.success) throw new Error("Tests failed"); } ], postRelease: [ async () => { await formatGeneratedFiles(); await notifyTeam(); } ]}locale {#locale}
Section titled “locale {#locale}”Type: string
Required: No
Since: 2.1.0
Default: Auto-detected from environment
Language for CLI output and messages (e.g., “en”, “ja”).
Example:
locale: "ja"; // Use Japanese translationsComplete Configuration Examples
Section titled “Complete Configuration Examples”Minimal Configuration
Section titled “Minimal Configuration”import type { NagareConfig } from "@rick/nagare";
export default { project: { name: "My App", repository: "https://github.com/user/my-app", }, versionFile: { path: "./version.ts", template: "typescript", },} as NagareConfig;Advanced Configuration with AI Features
Section titled “Advanced Configuration with AI Features”import type { NagareConfig } from "@rick/nagare";
export default { project: { name: "Enterprise App", description: "Production-grade application", repository: "https://github.com/company/app", homepage: "https://app.company.com", license: "MIT", author: "Company Inc.", },
versionFile: { path: "./src/version.ts", template: "typescript", additionalExports: [{ name: "API_VERSION", type: "const", value: "v1", description: "API version identifier", }], },
releaseNotes: { includeCommitHashes: true, metadata: { apiEndpoints: ["/api/v1", "/health"], features: ["Auth", "API", "Websocket"], }, },
github: { owner: "company", repo: "app", createRelease: true, },
updateFiles: [{ path: "./deno.json", patterns: { version: /^(\s*)"version":\s*"([^"]+)"/m, }, }],
release: { verifyJsrPublish: true, autoFix: { basic: true, ai: { enabled: true, provider: "claude-code", thinkingLevel: "megathink", maxAttempts: 3, }, }, preflightChecks: { runTests: true, }, },
security: { templateSandbox: "strict", auditLog: true, },
hooks: { postRelease: [ async () => { console.log("Release completed!"); }, ], },} as NagareConfig;Configuration Validation
Section titled “Configuration Validation”Nagare validates configuration at startup. Common validation errors:
- Missing required fields:
project.nameandproject.repositoryare required - Invalid template format: Must be one of: TypeScript, json, yaml, custom
- Missing custom template: When using
template: 'custom',customTemplateis required - Invalid regex patterns: Patterns that could cause file corruption are rejected
- Invalid export names: Additional export names must be valid JavaScript identifiers
Environment Variables
Section titled “Environment Variables”Some configuration options can be overridden by environment variables:
NAGARE_DEBUG: Enable debug loggingNAGARE_LOCALEorNAGARE_LANG: Set language (overridden by CLI--lang)GITHUB_TOKEN(or custom viatokenEnvVar): GitHub authenticationCI: Affects test behavior in CI environments
See also
Section titled “See also”- CLI Commands Reference - Command line usage
- Template Reference - Template syntax and variables
- Configuration Guide - How to configure Nagare