Search by

fast-forward / changelog

coisa

Standalone changelog domain and CLI runtime for Fast Forward PHP packages.

dev-main / 1.x-dev 2026-10-03 20:48 UTC

This package is auto-updated.

Last update: 2026-10-03 20:56:55 UTC


README

Standalone changelog domain and CLI runtime for Fast Forward PHP packages.

PHP Version Composer Package License GitHub Sponsors

✨ Features

  • 📘 Parse and render Keep a Changelog 1.1.0 documents deterministically
  • 🛠️ Manage changelog entries and promote Unreleased into published releases
  • 🚀 Expose reusable Symfony Console commands for release automation
  • ✅ Check whether Unreleased contains a change relative to a Git baseline
  • 🔌 Compose services through fast-forward/container and load commands lazily

📦 Installation

composer require fast-forward/changelog

Requirements:

  • PHP ^8.5
  • Symfony Console, Filesystem, and Process ^8.1
  • fast-forward/container and a PSR-20 clock supplied by fast-forward/clock

🛠️ Usage

Run the standalone CLI:

vendor/bin/changelog list
vendor/bin/changelog changelog:entry "Add release automation"
vendor/bin/changelog changelog:check --against=origin/main
vendor/bin/changelog changelog:resolve-version
vendor/bin/changelog changelog:promote 1.2.0
vendor/bin/changelog changelog:render-release-notes 1.2.0

The compatibility aliases changelog:next-version, changelog:show, and changelog:release-notes resolve to the same lazy commands.

Register the package command loader inside another Symfony Console application:

use FastForward\Changelog\Container\ServiceProvider\ChangelogServiceProvider;
use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
use Symfony\Component\Console\Application;
use function FastForward\Container\container;

$container = container(new ChangelogServiceProvider(workingDirectory: '/path/to/project'));
$application = new Application('My Tooling');
$application->setCommandLoader($container->get(CommandLoaderInterface::class));

The loader exposes command metadata without constructing command services. A misconfigured dependency therefore fails only when its command is executed and does not prevent the CLI from listing or running unrelated commands.

🧰 API Summary

Class Responsibility
ChangelogManager Load, mutate, promote, infer, and render changelog releases
ChangelogParser Parse Markdown into the managed changelog document model
MarkdownRenderer Render deterministic changelog Markdown and release-note bodies
ChangelogDocument / ChangelogRelease Immutable document model for release sections
UnreleasedEntryChecker Compare current entries with an optional Git baseline
ChangelogServiceProvider Register interfaces, factories, the clock, and lazy commands

🔌 Integration

This package is designed to be shared by:

  • fast-forward/dev-tools as an aggregator of reusable CLI domains
  • fast-forward/github-actions as a source of changelog-aware workflow commands
  • standalone package repositories that want deterministic changelog automation

📁 Directory Structure

bin/
docs/
src/
  Console/
  Container/
  Checker/
  Document/
  Entry/
  Filesystem/
  Git/
  Manager/
  Parser/
  Renderer/
  Version/
tests/

🛡 License

MIT © 2026 Felipe Sayao Lobato Abreu

🤝 Contributing

See contribution instructions for the independent local and CI quality checks. Run composer check before opening a PR. The unit suite requires 100% source-line coverage and replaces filesystem, process, clock, and container collaborators with test doubles.

The foundation extraction map explains what to copy and adapt for a new PHP library and which dependencies belong to this package.

Coverage uses PHPUnit's native Cobertura report in .build/coverage.xml, with Clover in .build/clover.xml, per-class text and HTML in .build/coverage. composer coverage:check regenerates the unit report and enforces 100% line coverage for the production source and every executable class.

Community

🔗 Links