marcocesarato/php-conventional-changelog
Generate changelogs and release notes automatically from git history using Conventional Commits and SemVer. CLI tool (composer-friendly) outputs customizable Markdown changelog files and helps streamline versioning and releases for PHP projects.
For customize settings you just needs to create a file named .changelog on the root of your project/ on the working
dir or use the --config option to specify the location of your configuration file.
Notes:
- When a setting on the configuration file is not necessary just omit it
- To allow all types just keep empty
typesand set emptyignoreTypes
composer.json or package.json if files exists on the root pathcomposer.lock, package.lock, yarn.lock...)['ConventionalChangelog\PackageBump\ComposerJson', 'ConventionalChangelog\PackageBump\PackageJson']--annotate-tag option)--sign-tag option)These are the default settings:
<?php
return [
'root' => getcwd(),
'path' => 'CHANGELOG.md',
'headerTitle' => 'Changelog',
'headerDescription' => 'All notable changes to this project will be documented in this file.',
'sortBy' => 'subject',
'preset' => [
// Breaking changes section
'breaking_changes' => ['label' => '⚠ BREAKING CHANGES', 'description' => 'Code changes that potentially causes other components to fail'],
// Types section
'feat' => ['label' => 'Features', 'description' => 'New features'],
'perf' => ['label' => 'Performance Improvements', 'description' => 'Code changes that improves performance'],
'fix' => ['label' => 'Bug Fixes', 'description' => 'Bugs and issues resolution'],
'refactor' => ['label' => 'Code Refactoring', 'description' => 'A code change that neither fixes a bug nor adds a feature'],
'style' => ['label' => 'Styles', 'description' => 'Changes that do not affect the meaning of the code'],
'test' => ['label' => 'Tests', 'description' => 'Adding missing tests or correcting existing tests'],
'build' => ['label' => 'Builds', 'description' => 'Changes that affect the build system or external dependencies '],
'ci' => ['label' => 'Continuous Integrations', 'description' => 'Changes to CI configuration files and scripts'],
'docs' => ['label' => 'Documentation', 'description' => 'Documentation changes'],
'chore' => ['label' => 'Chores', 'description' => "Other changes that don't modify the source code or test files"],
'revert' => ['label' => 'Reverts', 'description' => 'Reverts a previous commit'],
],
'types' => [],
'packageBump' => true,
'packageBumps' => [],
'packageLockCommit' => true,
'ignoreTypes' => ['build', 'chore', 'ci', 'docs', 'perf', 'refactor', 'revert', 'style', 'test'],
'ignorePatterns' => ['/^chore\(release\):/i'],
'tagPrefix' => 'v',
'tagSuffix' => '',
'skipBump' => false,
'skipTag' => false,
'skipVerify' => false,
'annotateTag' => false,
'signTag' => false,
'disableLinks' => false,
'hiddenHash' => false,
'hiddenAuthor' => true,
'hiddenMentions' => false,
'hiddenReferences' => false,
'prettyScope' => true,
'urlProtocol' => 'https',
'dateFormat' => 'Y-m-d',
'changelogVersionFormat' => '## {{version}} ({{date}})',
'commitUrlFormat' => '{{host}}/{{owner}}/{{repository}}/commit/{{hash}}',
'compareUrlFormat' => '{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}',
'issueUrlFormat' => '{{host}}/{{owner}}/{{repository}}/issues/{{id}}',
'userUrlFormat' => '{{host}}/{{user}}',
'releaseCommitMessageFormat' => 'chore(release): {{currentTag}}',
'hiddenVersionSeparator' => false,
'preRun' => null,
'postRun' => null,
'merged' => false,
];
Configure your preferences with the help of the following examples.
<?php
return [
// Types allowed on changelog
'types' => ['feat', 'fix', 'perf', 'docs', 'chore'],
// Ignore chores with changelogs scope
'ignorePatterns' => [
'/chore\(changelog\)[:].*/i'
],
];
To show author information in your changelog:
<?php
return [
// Show author information in changelog entries (default: true = hidden)
'hiddenAuthor' => false,
// Optionally also show other metadata
'hiddenHash' => false, // Show commit hash
'hiddenMentions' => false, // Show [@mentions](https://github.com/mentions)
'hiddenReferences' => false, // Show issue references
];
To create annotated or GPG-signed tags:
<?php
return [
// Create annotated tags instead of lightweight tags
'annotateTag' => true,
// Create GPG-signed tags (requires GPG setup)
'signTag' => true,
// Note: signTag will also create annotated tags automatically
];
You can also use command-line options:
--annotate-tag or --annotate-tag="Custom message" for annotated tags--sign-tag for GPG-signed tags<?php
return [
'root' => dirname(__DIR__), // (ex. configs/changelog.php using --config option)
// File changelog (relative to the working dir/root)
'path' => 'docs/CHANGELOG.md', // You can specify a different folder
'headerTitle' => 'My changelog',
'headerDescription' => 'This is my changelog file.',
'preset' => [
// Add improvements type (deprecated type)
'improvements' => [
'label' => 'Improvements',
'description' => 'Improvements to existing features'
],
'chore' => [
// Change chore default label
'label' => 'Others'
],
],
// Types allowed on changelog
'types' => ['feat', 'fix', 'pref'], // These could overwrite ignored types
// Exclude not notables types (following types are the default excluded types)
'ignoreTypes' => ['build', 'chore', 'ci', 'docs', 'refactor', 'revert', 'style', 'test'],
'ignorePatterns' => [
// Exclude all commits with this specific description
'chore(deps): update dependencies',
// You can also use regex to exclude all commit like 'chore(changelog): updated'
'/chore\(changelog\)[:].*/i'
],
'tagPrefix' => 'ver',
'tagSuffix' => '',
'skipBump' => false,
'skipTag' => false,
'skipVerify' => true,
];
How can I help you explore Laravel packages today?