Show Package Changelog On Composer Install/update
MIT License
usually when a package gets updated, the package owner could possibly add/change/remove something from the configuration file, or could add a new feature that he/she didn't have time to add to the read me yet, or for whatever reason that could potentially effect how the user consume the package.
Therefor PackageChangeLog was made, to help developers keep their packages as user friendly as possible and keep the users up-to-date with new changes as releases gets published.
composer require ctf0/package-changelog
after installation, package will auto-register the below to composer.json
"scripts": {
"post-install-cmd": [
"@php artisan pcl:post-install"
],
"post-update-cmd": [
"@php artisan pcl:post-update"
]
}
remove 'App\\Providers\\EventServiceProvider::postAutoloadDump'
from composer.json
remove
/**
* "ctf0/package-changelog".
*/
public static function postAutoloadDump(\Composer\Script\Event $event)
{
if (class_exists('ctf0\PackageChangeLog\Ops')) {
return \ctf0\PackageChangeLog\Ops::postAutoloadDump($event);
}
}
from app\Providers\EventServiceProvider
clear the cache php artisan cache:clear
inside your "package" composer.json
"changeLog": "log_folder_name"
to extra"require": {
// ...
"ctf0/package-changelog": "^2.0"
},
"extra": {
// ...
"changeLog": "logs"
}
inside that folder add the log files
post-install-cmd
if you want to show a log on installation only, then add a file name
install.txt
and we will display it only when the package gets installed for the first time.
release tag | log file name |
---|---|
* | install.txt |
post-update-cmd
the version have to be equal "==" to the release tag because we check against that version b4 showing the log.
this is useful in-case you didn't add a changeLog for the current published version.
release tag | log file name |
---|---|
v1.0.0 | v1.0.0.txt |
composer.json
before uninstall"scripts": {
"post-install-cmd": [
"@php artisan pcl:post-install"
],
"post-update-cmd": [
"@php artisan pcl:post-update"
]
}
If you discover any security-related issues, please email [email protected].