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

request: Filter by category #726

Closed tilucasoli closed 3 weeks ago

tilucasoli commented 3 weeks ago

Is there an existing feature request for this?

Command

No response

Description

As a developer, I want to run specific commands in specific projects based on the category that they are added to.

Reasoning

This feature can be useful in contexts where you have specific scripts to run only in a few packages. For Instance, looking at the following structure, if I'd like to run a script in a and b, I need to use melos exec --scope="a" --scope="b" or other filters, but actually, I cannot run it based on a category, like packages part of lint feature.

Additional context and comments

In my opinion, it could be added to the melos.yml file, such as:

# ...

categories:
  category_a:
    - packages/a
    - packages/c

# ...

Because of this, the filter --category can be created.

tilucasoli commented 3 weeks ago

@spydon What is the best in your opinion? Apply the path, like:

# ...

categories:
  category_a:
    - packages/a
    - packages/c

# ...

or use the package's name?

# ...

categories:
  category_a:
    - a
    - c

# ...
spydon commented 3 weeks ago

@tilucasoli if we'd want to apply globs here in the future I'd say the first alternative