VeryGoodOpenSource / very_good_cli

A Very Good Command-Line Interface for Dart created by Very Good Ventures 🦄
http://cli.vgv.dev
MIT License
2.17k stars 190 forks source link

Add platform flags to flutter app template #630

Open renancaraujo opened 1 year ago

renancaraujo commented 1 year ago

Description Derived from this comment: https://github.com/VeryGoodOpenSource/very_good_cli/issues/467#issuecomment-1379602368

People want to use flags to specify which platform directories should be created when using

very_good create flutter_app
superiorsd10 commented 1 year ago

Hello @renancaraujo 👋 I hope you're doing well. I'd like to contribute to the very_good_cli and noticed that there's this open issue. Would it be possible to assign this issue to me? I'd be happy to work on it.

Thank you,

renancaraujo commented 1 year ago

Hello @superiorsd10 , Of course, I am happy to assign this to you.

But please keep in mind that this is not a beginner-friendly issue, as there are changes that should be made on some templates (flame game, wear os, and very good core) before any change is made on the CLI itself.

superiorsd10 commented 1 year ago

Hello @renancaraujo 👋 I've been working on this issue for the past few days, and that's how I'm approaching it:-

  1. Added an addMultiOption for the platforms to the argParser in the flutter_app.dart.
  2. Stored the specified platforms by the user in the vars map in the getTemplateVars function in the flutter_app.dart.
  3. Added the platforms in the very_good_core_bundle.dart.

Still it's not working out.

Another thing that I've come across while working on this issue is that, there are no files available for the macos and linux platforms in the veryGoodCoreBundle in the very_good_core_bundle.dart.

So, can you please help in guiding through it?

renancaraujo commented 1 year ago

Hello @superiorsd10,

As described on the contributing guide, the templates have their own repository (linked above in my comment). Then after the changes are released to brickhub, we bundle them to the CLI.

superiorsd10 commented 1 year ago

Hello @superiorsd10,

As described on the contributing guide, the templates have their own repository (linked above in my comment). Then after the changes are released to brickhub, we bundle them to the CLI.

Okay, so you mean that it's not really enough to change only the lib folder code to test the code (manually)? Am I understanding it right?

Also, there are no files for macos and 'linux' in the core app bundle.

alestiago commented 1 year ago

Hi @superiorsd10 ! Thanks for asking all these questions! I'm looking forward to your contributions 💙 !

Okay, so you mean that it's not really enough to change only the lib folder code to test the code (manually)? Am I understanding it right?

This is a valid concern. If you think we're missing some information within the CONTRIBUTING let us know. In a nutshell, "templates (the code that gets generated per create command) have their own repositories, if you want to contribute to them please refer to their repositories".

If you checkout to a template repository and would like to generate the code locally you would have to use mason (the templating generator we use). They have an official documentation site. Mason templates can be passed variables that change the output, see the variables accepted by the latest Very Good Core template and those can be populated via Very Good CLI (acting as a proxy for create commands).

Once a template changes, we (maintainers) would make sure to publish a new version and update Very Good CLI , where necessary, to use such.

Also, there are no files for macos and 'linux' in the core app bundle.

There is an open issue about providing support to these platforms https://github.com/VeryGoodOpenSource/very_good_cli/issues/452. There is a comment with further instructions there if you wish to contribute 🙌