aksafan / composer-changelog
用于在通过 composer 更新包后显示变更日志的 composer 插件
2.1.0
2023-05-31 20:23 UTC
Requires
- php: ^8.0
- composer-plugin-api: ^2.3
Requires (Dev)
- composer/composer: ^2.5.0
README
Composer 变更日志
这是用于在通过 composer 更新包后显示变更日志的 composer 插件。
安装
安装此扩展的首选方式是通过 composer。
要安装,可以运行
$ php composer.phar require aksafan/composer-changelog
或者将以下内容添加到您的 composer.json
文件的 require
部分:
"aksafan/composer-changelog": "*"
to the require
section of your composer.json
file.
使用方法
要使用此扩展,您需要在项目的根目录中创建一个名为 UPGRADE.md
的文件,并包含以下文本,为每个您想要显示消息的新版本
Upgrade from ComposerChangelog 1.0.2 ----------------------- * Initial comments for upgrading from v1.0.2 * Initial comments for upgrading from v1.0.2 Upgrade from ComposerChangelog 1.0.1 ----------------------- * Initial comments for upgrading from v1.0.1 * Initial comments for upgrading from v1.0.1 Upgrade from ComposerChangelog 1.0.0 ----------------------- * Initial comments for upgrading from v1.0.0 * Initial comments for upgrading from v1.0.0
每个版本变更日志消息包含三个主要部分(由一个空格分隔)
- 升级自
Upgrade from
; - 包名,一个单词
ComposerChangelog
; - 版本
1.0.0
(根据 semver)您正在从哪个版本更新。
在此主要消息下方,您可以写下所有必要的升级说明。
注意:以下升级说明必须是累积的。换句话说,如果您想从版本 A 升级到版本 C,并且 A 和 C 之间有版本 B,您需要遵循 A 和 B 的说明。
现在,在更新包之后,用户将在控制台中看到类似的消息
composer-changelog$ composer update aksafan/composer-changelog ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Package operations: 0 installs, 1 update, 0 removals - Updating aksafan/composer-changelog (1.0.0 => 1.0.3): Loading from cache Writing lock file Generating autoload files 1 package you are using is looking for funding. Use the `composer fund` command to find out more! Seems you have upgraded aksafan/composer-changelog from version 1.0.0 to 1.0.3. Please check the upgrade notes for possible incompatible changes and adjust your application code accordingly. Upgrade from ComposerChangelog 1.0.2 ----------------------- * Initial comments for upgrading from v1.0.2 * Initial comments for upgrading from v1.0.2 Upgrade from ComposerChangelog 1.0.1 ----------------------- * Initial comments for upgrading from v1.0.1 * Initial comments for upgrading from v1.0.1 Upgrade from ComposerChangelog 1.0.0 ----------------------- * Initial comments for upgrading from v1.0.0 * Initial comments for upgrading from v1.0.0 You can find the upgrade notes for all versions online at: https://github.com/aksafan/composer-changelog.git
完整的示例可以在本包根目录中的 UPGRADE.md
文件中找到。
许可证
版权所有 2020,Anton Khainak。
在 MIT 许可证下提供。
灵感来源于 yii2-composer 插件。