shorebirdtech / shorebird

Code Push for Flutter and other tools for Flutter businesses.
https://shorebird.dev
Other
2.24k stars 133 forks source link

feat: support fvm #1385

Open eseidel opened 11 months ago

eseidel commented 11 months ago

Some users don't install Flutter directly, rather they use fvm. So flutter isn't even on their path, just fvm is and they might then use a shell alias to map flutter in the shell to fvm flutter.

One such user noted that this setup does not work with shorebird and is asking for potential fixes to shorebird to auto-detect/support fvm, and/or at least docs on how they're supposed to work together: https://github.com/shorebirdtech/shorebird/issues/472#issuecomment-1754490057

martin-bertele commented 11 months ago

in fact, this morning it works, I've only had ✗ Flutter install is correct (0.8s) [!] The version of Flutter that Shorebird includes and the Flutter on your path are different. Shorebird Flutter: 3.13.6 System Flutter: 3.10.5 and could fix this with https://docs.shorebird.dev/flutter-version#supported-flutter-versions setting shorebird version to 3.10.5

Maybe it was the system restart, even though my reloads/ sourcing the .zshrc should have done the job as well. Congrats, shorebird plays together with fvm for me !

Previously I've used only my f alias, now I've added the flutter alias.

alias f="fvm flutter"
alias flutter="fvm flutter"

and of course then in the executing directory I've got the .fvm folder.

Some hints to fvm would be nice in docu indeed :) Thanks !

martin-bertele commented 11 months ago

had sth similar when switching fvm flutter versions and updating shorebird.

With having the above aliases, after setting shorebird&fvm flutter to same version, VS Code close & restart did the trick (Developer Reload Window not sufficient).

eseidel commented 1 month ago

A user just asked on discord for:

Behavior should probably take this preference order:
If --flutter-version flag is passed, this gets the highest preference.
If flag not found and .fvmrc is found, use it.
If flag not found and .fvmrc is not found, use the latest flutter stable version.
eseidel commented 1 month ago

fvmrc doesn't look difficult to parse (it's just json): https://fvm.app/documentation/getting-started/configuration

I think the only question in my mind is if this should be a wrapper around shorebird, or built into shorebird.

And if it's built into shorebird, should we be detecting fvmrc by default, or only when a flag is passed?

martin-bertele commented 1 month ago

I vote for detect by default and possibly opt out via flag

With so many different flutter projects I wonder how is it possible to survive without flutter per project versioning :)

josh-burton commented 2 weeks ago

Out of the box support for fvm would be great. Better than opt-in as it ticks the 'it just works' box.