seanh1986 / flutter-bbtm

MIT License
0 stars 0 forks source link

Feature/sync fvm version #33

Closed arlophoenix closed 1 month ago

arlophoenix commented 1 month ago

Would you mind protecting the main & develop branches (under settings)? I accidentally pushed directly to develop before making this PR 😬

I saw you had some questions about how this all works:

I haven't entirely figured out how your branch is enforcing the version control but I merged it anyways.

This branch (along with feature/support-multiple-node-version) enables project specific versioning for two key frameworks: Node.js and Flutter. It also puts some guardrails around versioning getting out of sync with the tooling.

It enables the use of third-party tools NVM (Node Version Manager) and FVM (Flutter Version Manager). Both do a similar thing: when you enter the project directory and run nvm use or fvm use they look up a file .nvmrc or .fvmrc, read the framework version, download that version and make it available on the path. From then on shell commands to node or flutter will be to the correct project version.

I saw you added the settings.json which is specifying 3.24.1.

You are right, I specified the incorrect directory for vscode settings. It should have been "dart.flutterSdkPath": ".fvm/flutter_sdk", in order to always use whatever version fvm has installed. Thanks for noticing!

I also have added that to the environment in the pubspec.yaml, which maybe would have been good enough?

That is also necessary but for the package manager itself, not for fvm (again, same with Node.js). These branches add guardrails in the form of scripts (and a pre-commit hook to run them) which looks up the framework version and copies it to the appropriate .*vmrc file.

Hope that helps. Happy to answer questions!

On a related note: my preferred format for these discussions is within the pull request / associated issues so I can keep track of the conversation alongside the context (it easily gets lost in the Discord chat) 🙏