Running composer run-script post-root-package-install for example gives the following error:
composer run-script post-root-package-install
Script "post-root-package-install" cannot be run with this command
Is there any reason why only certain script events are allowed here https://github.com/composer/composer/blob/5b042943e3ae069599db748227df9851cd91421c/src/Composer/Command/RunScriptCommand.php#L49-L54
Or is it just out of date? I'd be happy to add the missing ones if it's just an oversight.
I guess this one is just missing. Maybe a few others are. The point is though that some like post-package-install can't be executed like this because we would be missing a package argument to call the script.
So what would be the fix? I see that all (PRE | POST)PACKAGE(INSTALL | UPDATE | UNINSTALL) events are never fired? (if i grep for them I only find them in the ScriptEvents file). But this are PackageEvents, so they can't be used with the run script (right?). Same for the POST_ROOT_PACKAGE_INSTALL and POST_CREATE_PROJECT_CMD.
So this means only PRE_ARCHIVE_CMD, POST_ARCHIVE_CMD, PRE_AUTOLOAD_DUMP and POST_AUTOLOAD_DUMP are missing in the RunScriptCommand?
I think if you grep for dispatch(CommandEvent|Script) you find all those that can be safely dispatched by run-script. Others require a package arg and hence can not be dispatched properly.
So I'd say the following are missing:
As for the *_PACKAGE_* event ones, just for reference they're dispatched in the Installer class (search for dispatchPackageEvent) but as I said they can't be included in run-script.
Fix for #2557, added missing run-scripts
run-script has been updated to support all events that make sense.