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.19k stars 206 forks source link

Whether the usecase information for run and exec is necessary? #206

Open huang12zheng opened 2 years ago

huang12zheng commented 2 years ago

Description

  1. Commands exec and run it look like as follow
    melos run tag:pubspec
    └> melos list -l
       └> RUNNING
    ...

    or

ref: #205

melos run tag
   └> melos run tag:git && melos run tag:pubspec
       └> RUNNING

melos run tag:git
   └> melos exec "git tag -l"
       └> RUNNING

[masonx]: masonx-v0.0.8
[romantic_common]: romantic_common-v0.0.4

melos run tag:git
   └> melos exec "git tag -l"
       └> SUCCESS
melos run tag:pubspec
   └> melos list -l
       └> RUNNING

masonx            0.0.9       packages/masonx
romantic_analysis 0.0.1-dev.2 packages/romantic_analysis
romantic_common   0.0.3       packages/romantic_common

melos run tag:pubspec
   └> melos list -l
       └> SUCCESS

melos run tag
   └> melos run tag:git && melos run tag:pubspec
       └> SUCCESS

Requirements

Addation My expect sample:

[A]: A-v0.0.8
[C]: C-v0.0.4

A            0.0.9       packages/A
B 0.0.1-dev.2 packages/B
C   0.0.3       packages/C

[A]: On branch main
[A]: Your branch is ahead of 'origin/main' by 2 commits.
[A]:   (use "git push" to publish your local commits)
[A]: 
[A]: Changes not staged for commit:
[A]:   (use "git add <file>..." to update what will be committed)
[A]:   (use "git restore <file>..." to discard changes in working directory)
[A]:       modified:   CHANGELOG.md
[A]:       modified:   pubspec.yaml
[A]: 
[A]: no changes added to commit (use "git add" and/or "git commit -a")
[B]: On branch main
[B]: Your branch is up to date with 'origin/main'.
[B]: 
[B]: nothing to commit, working tree clean
[C]: On branch main
[C]: Your branch is ahead of 'origin/main' by 1 commit.
[C]:   (use "git push" to publish your local commits)
[C]: 
[C]: nothing to commit, working tree clean
[B_example]: On branch main
[B_example]: Your branch is up to date with 'origin/main'.
[B_example]: 
[B_example]: nothing to commit, working tree clean
huang12zheng commented 2 years ago

413c376 , It's just a sample

Salakar commented 2 years ago

I'm happy to move this to trace if you'd like to send up a PR

huang12zheng commented 2 years ago

but I'm having some problems, I use --verbose, but the command inside doesn't get this --verbose.

info about --verbose happen only one time , it should do it many time.

melos --verbose run tag
[     0.004s] melos run tag
[     0.015s]    └> melos run tag:git && melos run tag:pubspec && melos run tag:gitstatus
[     0.015s]        └> RUNNING
>>>
### loss verbose
>>>
[    29.919s] 
[    29.919s] melos run tag
[    29.919s]    └> melos run tag:git && melos run tag:pubspec && melos run tag:gitstatus
[    29.919s]        └> SUCCESS

So I might have to think how do I handle this.

Salakar commented 2 years ago

Maybe add a MELOS_VERBOSE env that gets set (if top level melos has --verbose) and passed to child processes (process exec in utils), like we did to pass terminal width detection down to child processes:

https://github.com/invertase/melos/blob/c3b13c0286dc833da3fb27d74ef68fec453836ae/packages/melos/lib/src/common/utils.dart#L89-L95 https://github.com/invertase/melos/blob/c3b13c0286dc833da3fb27d74ef68fec453836ae/packages/melos/lib/src/common/utils.dart#L266

We also did this for MELOS_PACKAGES

ibrahim-mubarak commented 2 years ago

Any progress on this?