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

feat(mason): allow packages that use MasonGenerator to acess BrickVariableProperties. #1075

Open
1 task
renancaraujo opened this issue Sep 20, 2023 · 3 comments
Labels
customer:🦄 enhancement candidate Candidate for enhancement but additional research is needed

Comments

@renancaraujo
Copy link
Collaborator

Description

There is a way of generating files from bundled bricks. That evolves mostly by calling MasonGenerator's hooks.preGen, hooks.postGen and generate methods.

Example (extracted from here)

final vars = <String, dynamic>{};

// Run pre gen
await generator.hooks.preGen(vars: vars, onVarsChanged: (v) => vars = v);

// create the files
await generator.generate(target, vars: vars, logger: logger);

// Run post gen
await generator.hooks.postGen(vars: vars, onVarsChanged: (v) => vars = v);

The problem with that approach is that it disregards the prompts, default values, value types, and allowed values specified in the vars property in the brick.yaml file.

This issue requests an API that allows access to that property directly from a MasonGeenrator or subclass.

One suggestion is to save a BrickYaml instance as property of MasonGenerator

Requirements

  • An API that allows access to that property directly from a MasonGeenrator or subclass.

Additional Context

This is a request that would make life at very_good_cli easier.

@felangel felangel added the enhancement candidate Candidate for enhancement but additional research is needed label Sep 20, 2023
@renancaraujo renancaraujo changed the title feat(mason): allow packages that use MaosnGenerator to acess BrickVariableProperties. feat(mason): allow packages that use MasonGenerator to acess BrickVariableProperties. Sep 20, 2023
@renancaraujo
Copy link
Collaborator Author

Opened a POC for this on #1076

@alestiago
Copy link
Collaborator

What's the status of this @felangel ?

@felangel
Copy link
Owner

What's the status of this @felangel ?

Was considering alternative solutions. I’ll get back to you shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer:🦄 enhancement candidate Candidate for enhancement but additional research is needed
Projects
None yet
Development

No branches or pull requests

3 participants