or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

index.md
tile.json

tessl/npm-conventional-changelog-ember

Ember preset for conventional-changelog that parses commit messages and generates standardized changelog entries.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/conventional-changelog-ember@5.0.x

To install, run

npx @tessl/cli install tessl/npm-conventional-changelog-ember@5.0.0

index.mddocs/

conventional-changelog-ember

conventional-changelog-ember is a preset configuration for the conventional-changelog system that implements Ember.js commit message conventions. It parses Ember-style commit messages with tags like [BUGFIX beta], [FEATURE name], and [DOC release] to generate standardized changelog entries with proper categorization and semantic version bumping.

Package Information

  • Package Name: conventional-changelog-ember
  • Package Type: npm
  • Language: JavaScript (ES Modules)
  • Installation: npm install conventional-changelog-ember

Core Imports

import createPreset from "conventional-changelog-ember";

For older Node.js versions or bundlers without full ESM support:

const createPreset = (await import("conventional-changelog-ember")).default;

Basic Usage

import createPreset from "conventional-changelog-ember";
import conventionalChangelogCore from "conventional-changelog-core";

// Create the preset configuration
const preset = await createPreset();

// Use with conventional-changelog-core
for await (const chunk of conventionalChangelogCore({
  config: preset
})) {
  console.log(chunk.toString());
}

Architecture

The package is organized around three core modules that work together to implement the Ember commit convention:

  • Parser: Extracts structured data from Ember-formatted commit messages using regex patterns
  • Writer: Transforms parsed commits into formatted changelog entries using Handlebars templates
  • WhatBump: Analyzes commits to determine appropriate semantic version increments
  • Templates: Handlebars templates for consistent changelog formatting

Capabilities

Preset Creation

Creates a complete preset configuration for conventional-changelog with Ember-specific parsing, writing, and version bump rules.

/**
 * Creates a preset configuration for conventional-changelog with Ember.js commit conventions
 * @returns Promise<PresetConfig> Complete preset configuration object
 */
export default async function createPreset(): Promise<PresetConfig>;

interface PresetConfig {
  commits: {
    merges: false;
  };
  parser: ParserOptions;
  writer: WriterOptions;
  whatBump: WhatBumpFunction;
}

Usage Example:

import createPreset from "conventional-changelog-ember";

const preset = await createPreset();
// Use preset with conventional-changelog tools

Commit Message Parsing

The preset includes parsing capabilities for Ember commit message formats. This functionality is built into the preset configuration and not directly exposed as a separate API.

Supported Commit Formats:

[BUGFIX beta] Fix authentication issue
[FEATURE query-params-new] Add new query parameter handling
[DOC release] Update API documentation
[CLEANUP beta] Remove deprecated methods
[SECURITY CVE-2023-001] Address security vulnerability

The parser recognizes:

  • Merge commits: Merge pull request #123 from branch/name
  • Tagged commits: [TAG target] commit message

Changelog Writing

The preset includes writing capabilities that transform parsed commits into formatted changelog entries. The writer handles template rendering and commit categorization automatically within the preset.

Tag Transformations:

  • BUGFIX → "Bug Fixes"
  • CLEANUP → "Cleanup"
  • FEATURE → "Features"
  • DOC → "Documentation"
  • SECURITY → "Security"

Version Bump Analysis

Analyzes commit messages to determine appropriate semantic version increments. This function is not exported directly but is available through the preset configuration.

Bump Logic:

  • Major (0): When commits contain breaking change notes
  • Minor (1): When commits contain features (type === 'feat')
  • Patch (2): Default for other changes

Types

interface PresetConfig {
  /** Configuration for commit handling */
  commits: {
    /** Whether to include merge commits (always false) */
    merges: false;
  };
  /** Parser options for extracting commit information */
  parser: ParserOptions;
  /** Writer options for formatting changelog entries */
  writer: WriterOptions;
  /** Function to determine version bump level */
  whatBump: (commits: Commit[]) => BumpResult;
}

interface ParserOptions {
  /** Regex pattern to match merge commit format */
  mergePattern: RegExp;
  /** Field names for merge commit capture groups */
  mergeCorrespondence: string[];
  /** Regex pattern to match Ember commit tag format */
  headerPattern: RegExp;
  /** Field names for header capture groups */
  headerCorrespondence: string[];
}

interface WriterOptions {
  /** Main Handlebars template for changelog structure */
  mainTemplate: string;
  /** Header partial template for version headers */
  headerPartial: string;
  /** Commit partial template for individual commit entries */
  commitPartial: string;
  /** Transform function to convert commits to changelog format */
  transform: (commit: ParsedCommit) => ChangelogCommit | undefined;
  /** Group commits by this field */
  groupBy: string;
  /** Sort commit groups by this criteria */
  commitGroupsSort: string;
  /** Sort individual commits by these criteria */
  commitsSort: string[];
}

interface ParsedCommit {
  /** Commit tag from Ember format (BUGFIX, FEATURE, etc.) */
  tag: string;
  /** Target branch or feature flag */
  taggedAs: string;
  /** Commit message text */
  message: string;
  /** Pull request number (if merge commit) */
  pr?: string;
  /** Full commit hash */
  hash?: string;
  /** Short commit hash */
  shortHash?: string;
}

interface ChangelogCommit {
  /** Display tag for changelog section */
  tag: string;
  /** Short commit hash for linking */
  shortHash: string;
}

interface Commit {
  /** Commit type for semantic analysis */
  type?: string;
  /** Breaking change notes */
  notes: BreakingChangeNote[];
}

interface BreakingChangeNote {
  /** Breaking change note content */
  [key: string]: any;
}

interface BumpResult {
  /** Version bump level: 0 (major), 1 (minor), 2 (patch) */
  level: number;
  /** Explanation of the bump decision */
  reason: string;
}