CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-standard-changelog

Generate a changelog from git metadata with Angular commit convention.

Pending
Overview
Eval results
Files

Standard Changelog

Standard Changelog provides an opinionated approach to CHANGELOG generation using Angular commit conventions. It offers both a command-line interface and a JavaScript API for generating changelogs from git metadata, with automatic detection of features, fixes, performance improvements, and breaking changes.

Package Information

  • Package Name: standard-changelog
  • Package Type: npm
  • Language: TypeScript
  • Installation: npm install standard-changelog

Core Imports

import { StandardChangelog } from "standard-changelog";

For CommonJS:

const { StandardChangelog } = require("standard-changelog");

Basic Usage

CLI Usage

# Generate changelog for current release
standard-changelog

# Generate changelog for first release
standard-changelog --first-release

# Output to stdout
standard-changelog --stdout

# Append to existing changelog
standard-changelog -a

API Usage

import { StandardChangelog } from "standard-changelog";

// Basic usage
const generator = new StandardChangelog(process.cwd())
  .readPackage();

// Generate as stream
generator.writeStream().pipe(process.stdout);

// Generate as async iterator
for await (const chunk of generator.write()) {
  console.log(chunk);
}

Architecture

Standard Changelog is built on top of the conventional-changelog ecosystem with these key components:

  • StandardChangelog Class: Extends ConventionalChangelog with Angular preset pre-configured
  • CLI Interface: Command-line tool with comprehensive flag support
  • Re-exported APIs: Full access to underlying conventional-changelog functionality
  • Angular Preset: Pre-configured commit convention parser following Angular guidelines

Capabilities

StandardChangelog Class

Core changelog generation class with Angular commit conventions pre-configured. Extends ConventionalChangelog with all inherited methods available.

class StandardChangelog extends ConventionalChangelog {
  constructor(cwdOrGitClient: string | ConventionalGitClient);
}

StandardChangelog API

CLI Interface

Command-line interface for generating changelogs with extensive configuration options.

function runProgram(
  generator: ConventionalChangelog,
  flags: Flags
): Promise<void>;

interface Flags {
  infile?: string;
  outfile?: string;
  stdout?: boolean;
  preset?: string;
  pkg?: string;
  append?: boolean;
  releaseCount?: number;
  skipUnstable?: boolean;
  outputUnreleased?: boolean;
  verbose?: boolean;
  config?: string;
  context?: string;
  firstRelease?: boolean;
  lernaPackage?: string;
  tagPrefix?: string;
}

CLI Interface

Re-exported Types and Functions

All types and functions from conventional-changelog are re-exported for full ecosystem compatibility.

// Core classes
export { ConventionalChangelog } from "conventional-changelog";

// Core types
export type {
  Commit,
  Package,
  Logger,
  PackageTransform,
  CommitTransformFunction,
  HostType,
  HostedGitInfo,
  HostOptions,
  FinalizedContext,
  Preset,
  Options,
  Params
} from "conventional-changelog";

// Utility functions
export { packagePrefix, flags, runProgram } from "conventional-changelog";

Core Types

interface ConventionalGitClient {
  cwd: string;
  debug?: Logger;
  getSemverTags(params?: GetSemverTagsParams): AsyncGenerator<string>;
  getCommits(params: GetCommitsParams, parserOptions?: ParserStreamOptions): AsyncGenerator<Commit>;
  verify(revision: string): Promise<void>;
  getConfig(key: string): Promise<string>;
}

type Logger = (source: string, messages: string | string[]) => void;

interface Commit extends CommitBase {
  [key: string]: string | null;
}

interface CommitBase {
  merge: string | null;
  revert: CommitMeta | null;
  header: string | null;
  body: string | null;
  footer: string | null;
  notes: CommitNote[];
  mentions: string[];
  references: CommitReference[];
}

interface CommitNote {
  title: string;
  text: string;
}

interface CommitReference {
  raw: string;
  action: string | null;
  owner: string | null;
  repository: string | null;
  issue: string;
  prefix: string;
}

type CommitMeta = Record<string, string | null>;

interface Details<T> {
  log: string;
  keyCommit: T | null;
}

Install with Tessl CLI

npx tessl i tessl/npm-standard-changelog
Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/standard-changelog@7.0.x
Publish Source
CLI
Badge
tessl/npm-standard-changelog badge