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.

Home Page:https://melos.invertase.dev/~melos-latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

request: Filter by category

tilucasoli opened this issue · comments

Is there an existing feature request for this?

  • I have searched the existing issues.

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.

  • packages
    • a
    • b
    • c

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.

@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

# ...

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