invertase / melos

๐ŸŒ‹ A tool for managing Dart projects with multiple packages. With IntelliJ and Vscode IDE support. Supports automated versioning, changelogs & publishing via Conventional Commits.
https://melos.invertase.dev/~melos-latest
Apache License 2.0
1.07k stars 193 forks source link

feat: hooks for predefined command #732

Closed ronnnnn closed 2 weeks ago

ronnnnn commented 2 weeks ago

Description

Melos versions 5.0.0 and 5.1.0 introduced built-in commands (format and analyze). While I appreciate the efficiency of these new commands, as noted in this comment, remembering them can be challenging. Therefore, I propose adding a hooks feature that allows users to automatically trigger custom commands alongside the built-in format and analyze commands.

Related issue #661

Type of Change

spydon commented 2 weeks ago

This does not implement any of the suggested solutions in #661, and I don't think we want to add hooks to these built-in commands (you can very easily create a Melos script that invokes the built-in command and then your own command instead).

Solution number two or three in that issue are the preferred ones, where we simply give a warning and/or override the built-in command.

ronnnnn commented 2 weeks ago

You're right, we can add new commands to invoke built-in commands. However, I think adding hooks would make migration easier for v4 users.

I understand your policy regarding these built-in commands, and it doesn't seem to address the issue at hand. Therefore, I'm closing this request. Thank you.