melos
melos copied to clipboard
request: add hook for version command, which runs after versioning but before committing
trafficstars
Is there an existing feature request for this?
- [X] I have searched the existing issues.
Command
No response
Description
The hook should run as part of melos version after versions have been updated but before committing changes, as compared to postversion, which runs after committing changes.
Reasoning
This allows a hook to generate/update files that should be committed, based on the new versions.
Additional context and comments
No response
Just realized that melos version already supports this, but its hooks are a bit confusing:
preversion: correspondents to the hook that runs before a command and has the same name as the command forbootstrapandcleanversion: runs after versioning but before committingpostversion: correspondents to the hook that runs after a command and follows the same naming convention asbootstrapandclean
We should document this and consider bringing version in line with the other commands, though that would require a breaking change.