or run

tessl search
Log in

Version

Files

tile.json

task.mdevals/scenario-1/

Release Changelog Generator

Build a command-line tool that generates a changelog for a monorepo project using Nx's release capabilities. The tool should analyze commit history and create formatted changelog entries.

Requirements

Functionality

Your tool should:

  1. Generate a changelog from the current commit history
  2. Create changelog files that follow conventional commit format
  3. Support specifying a version for the changelog
  4. Allow dry-run mode to preview changes without modifying files
  5. Handle both single projects and multiple projects in a monorepo

Command-Line Interface

The tool should accept these command-line arguments:

  • --version <version> - The version to use for the changelog (e.g., "1.2.0")
  • --dry-run - Preview the changelog without creating files
  • --from <ref> - Starting git reference for changelog (default: last tag)
  • --to <ref> - Ending git reference for changelog (default: HEAD)

Output

The tool should:

  • Generate CHANGELOG.md files in the appropriate locations
  • Print a summary of what was generated
  • In dry-run mode, display what would be generated without creating files
  • Exit with code 0 on success, non-zero on error

Test Cases

Your implementation should handle these scenarios:

  • Generate a changelog for version 1.0.0 with conventional commits @test
  • Run in dry-run mode without modifying any files @test
  • Handle projects with no changes since last release @test

Implementation

@generates

API

/**
 * Main entry point for the changelog generator
 */
export function generateChangelog(options: ChangelogOptions): Promise<void>;

/**
 * Options for changelog generation
 */
export interface ChangelogOptions {
  version: string;
  dryRun?: boolean;
  from?: string;
  to?: string;
}

Dependencies { .dependencies }

@nx/devkit { .dependency }

Provides core Nx functionality for workspace and project management.

nx { .dependency }

Provides the Nx CLI and release capabilities for changelog generation.