Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local very_good create doesn't use imported templates #1161

Closed
SareXx opened this issue Oct 9, 2024 · 3 comments
Closed

fix: local very_good create doesn't use imported templates #1161

SareXx opened this issue Oct 9, 2024 · 3 comments
Labels
bug Something isn't working as expected p3 Issues that we currently consider unimportant

Comments

@SareXx
Copy link

SareXx commented Oct 9, 2024

Description

While working with the local very_good_cli and very_good_templates I ran into the issue that the very_good_cli doesn't use the modified very_good_core_bundle.dart and therefore very_good create flutter_app doesn't create a customized app.

Steps To Reproduce

Prerequires

  1. Using Ubuntu 22.04
  2. Installing Flutter 3.24.3
  3. Clone very_good_cli
  4. Clone very_goog_templates
  5. Activating mason_cli
  6. Activating very_good_cli with the code locally

Steps to reproduce unexpected behavior

  1. Customize very_good_core template in the the very_good_templates:
    (very_good_templates/very_good_core/brick/{{project_name.snakeCase()}})
    1.1 Adding an additional File
    1.2 Adding additional dependencies in the pubspec.yaml
  2. Bundle the existing very_good_core brick mason bundle . -t dart -o /path/to/export/
  3. Copy the created very_good_core_bundle.dart and replace it in the very_good_cli directory:
    (very_good_cli/lib/src/commands/create/templates/very_good_core/)
  4. (Format the code inside the very_good_core_bundle.dart that it's recognizable by the language styling of dart)
  5. Create a new flutter app with the modified local very_good_cli very_good create flutter_app AppName
  6. See that no additional file is present as well as no customized dependencies in the pubspec.yaml

Expected Behavior

very_good create flutter_app AppName creates a flutter app while using the very_good_core template, including the modified very_good_core_bundle.dart

Additional Context

I haven't changed any code in the cli, besides mentioned below, so I would assume that if the filename of the very_good_core_bundle.dart is correct, it should be used and my changes become created/implemented when I create a new app.
Am I missing an implementation step somewhere or is this what I'm trying to use your projects for even possible?

I can verify the following things:

  1. I'm using the local very_good_cli:
    To confirm that I'm using my local cli, I changed the comment block after when an app gets created in the very_good_core_template.dart in the cli project.
  2. The changes I've made in the very_good_core template are there:
    With a base64 decoder I can see from the pubspec.yaml string that my modifications are inside the bundle. Not to mention the new lines of my additional file.
  3. As I'm getting no errors whatsoever I assume that there shouldn't be any issues.
@SareXx SareXx added the bug Something isn't working as expected label Oct 9, 2024
@tomarra
Copy link
Contributor

tomarra commented Oct 15, 2024

This may be a duplicate of #1078

@SareXx
Copy link
Author

SareXx commented Oct 16, 2024

On the first glance my problem looks very much like #4295, which is mentioned inside #1078, that the local cli is not used, even if it was activated with the proper command and also successfully shown in the terminal.

But as I mentioned in my additional context, when I activate the local cli and create a flutter_app, the very_good_core_templates.dart is used - which I would expect to actually include the very_good_core_bundle.dart.

Therefore, it looks to me as if my local cli is being used on the one hand, but on the other hand, since the very_good_core_bundle.dart is not included/used, that the online version is being used there?
If my very_good_core_templates.dart wasn't used while creating an app with the local activated cli I would confirm that it is a duplicate of #1078.

Maybe I expect dart to work differently here than it does.
So I'm a little unsure.

I also tried as mentioned in #4295 to activate my local cli after I cleaned / deleted my pub-cache folder but with no success.

From matthew-carroll: I've discovered that if I delete all the references I can find in my Pub cache for this package, then I can get Pub to truly activate my local version.

@tomarra tomarra moved this from Needs Triage to Backlog in VGV Open Source 🦄 🧙🌟 Oct 18, 2024
@tomarra tomarra added the p3 Issues that we currently consider unimportant label Oct 18, 2024
@tomarra
Copy link
Contributor

tomarra commented Nov 6, 2024

Hi @SareXx, thanks for opening this issue and the explanation.

Overall I don't see this as an issue on the CLI package and more of a local setup issue overall. The update process for our bundles is working as expected. As was noted before, we do know of some issues with the pub cache when installing packages but this isn't something that we can fix inside of this package. Also we can't provide support for people forking our repo just given our staffing. If this is something you feel like you can work on and provide a PR for please let us know.

Given this I'm going to close this out as a won't fix as I don't see a need for a change/update on the CLI package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected p3 Issues that we currently consider unimportant
Projects
Development

No branches or pull requests

2 participants