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.13k stars 201 forks source link

Allow commands to be disabled #661

Open nielsenko opened 6 months ago

nielsenko commented 6 months ago

Is there an existing feature request for this?

Command

No response

Description

Recently two new commands was added to melos: format and analyze which just wrap dart format and dart analyze.

In my project format script is somewhat more complex than the default command:

  format:
    description: Format code.
    # while we wait for https://github.com/dart-lang/dart_style/issues/864
    run: >-
      find lib test integration_test -name '*.dart' -not -name '*.g.dart' -not -name '*.realm.dart' -not -name 'realm_bindings.dart' 2> /dev/null
      | xargs dart format --fix
    exec: 
      concurrency: 1 # only one project at a time to keep output sane

It would be nice to:

  1. Have the option of disabling a command, to avoid people using it mistakenly.
  2. Get a warning if you have a script that conflict with a command
  3. Perhaps even overwrite the behavior of a command with a script (a bit controversial as it will mess with users expectations).

Reasoning

I got briefly bitten by this as I updated from 4.1.0 to 5.1.0

Additional context and comments

No response

spydon commented 6 months ago

This was the reason that we made it a breaking change even though it technically wasn't one. Having a warning sounds like a good idea, overwriting the built-in commands sounds like it could be error-prone.