melos
melos copied to clipboard
Question: Flutter key commands don't work
When I execute a flutter package with flutter run
, the command inserted in the terminal doesn't work. The classic example for this is to use Hot reload
inserting r
. Exist some workaround?
start:
run: melos exec -c 1 --scope="app" -- "flutter run"
This is not supported at the moment, but can be added
One question though: Would you mind if the command is instead:
start:
run: cd packages/app && flutter run
?
Because melos exec
is potentially executed across multiple packages. So it's a bit unclear how user inputs would work.
When I looked at implementing this a while back I was only going to support it in singular form e.g. it'd only be enabled if either of the following is true:
- if
--concurrency
is equal to1
on exec - if workspace packages length is equal to
1
(e.g. a single package has been filtered)
So in the case of the example above, -c 1
is set therefore it'd work here
I'm not really a fan of such dual behavior. I could see it being misleading, where users would get confused why inputs work in some cases but not others
Especially the "if workspace packages length equals 1"
That could silently fail if a project started with one package but packages were added later.
any updates in this feature request?
@ilyosbekkk Nothing new yet on this issue.
we also have use for this. my project uses a more complex flutter run
that has different flavors for our different environments and we wanted to make it easier for our developers to run any of these.