melos icon indicating copy to clipboard operation
melos copied to clipboard

request: add hook for version command, which runs after versioning but before committing

Open blaugold opened this issue 3 years ago • 1 comments
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

blaugold avatar Jun 13 '22 09:06 blaugold

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 for bootstrap and clean
  • version: runs after versioning but before committing
  • postversion: correspondents to the hook that runs after a command and follows the same naming convention as bootstrap and clean

We should document this and consider bringing version in line with the other commands, though that would require a breaking change.

blaugold avatar Jun 13 '22 10:06 blaugold