Write logs based on conventional commits and templates.
85
Build a changelog generation tool that produces formatted changelog output from commit data using customizable templates.
Your tool should accept an array of commit objects and generate a formatted changelog string. Each commit object has the following structure:
{
hash: string, // Full commit hash
type: string, // Commit type (e.g., "feat", "fix", "docs")
scope: string, // Optional scope
subject: string, // Commit subject line
body: string, // Commit body
header: string, // Full header line
notes: Array<{ // Breaking changes and other notes
title: string,
text: string
}>,
references: Array<{ // Issue/PR references
action: string,
issue: string,
prefix: string
}>
}Your solution must support:
The tool should export a function generateChangelog(commits, options) that:
@generates
/**
* Generates a formatted changelog from commit data.
*
* @param {Array<Object>} commits - Array of commit objects
* @param {Object} options - Configuration options
* @param {string} options.mainTemplate - Main template string (optional)
* @param {Object} options.partials - Object containing partial templates (optional)
* @param {string} options.partials.header - Header template (optional)
* @param {string} options.partials.commit - Commit template (optional)
* @param {string} options.partials.footer - Footer template (optional)
* @param {Object} options.context - Context data for templates (optional)
* @returns {string} Formatted changelog
*/
function generateChangelog(commits, options = {});
export { generateChangelog };Provides changelog generation with template-based rendering support.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-conventional-changelog-writerevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10