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

Yo composability and run loop priority #1100

Closed
cakriwut opened this issue Feb 2, 2019 · 2 comments
Closed

Yo composability and run loop priority #1100

cakriwut opened this issue Feb 2, 2019 · 2 comments

Comments

@cakriwut
Copy link

cakriwut commented Feb 2, 2019

#Backgound

  1. Yeoman composeWith has option to pass options object from main generator to sub generator. The options must be provided as parameter in composeWith call
  2. Yeoman has run loop priority where Initializing comes before Prompting

#Problem

  1. If we want to provide options for sub-generator, then composeWith must be called after main-generator completes prompting.
  2. If we composeWith, after main-generator prompting, (let say writing() of the main-generator) - then the run loop will put sub-generator prompting() , in higher priority - causing user needs to press Enter twice on the second question during sub-generator prompting.

#Question

  1. Is there any strategy, that we can define composeWith during Initializating() and provide reference to the future options after main-generator prompting() ?
@SBoudrias
Copy link
Member

Is there any strategy, that we can define composeWith during Initializating() and provide reference to the future options after main-generator prompting() ?

That's not possible, but also you shouldn't need to do this.

I don't understand what's the problem with calling composeWith after the main generator prompting phase. If you want to skip the second generator prompts when options are provided, you need to implement this yourself (for example by using the prompt when option.)

All phases of every generator will always run. There's no way to skip phases.

@cakriwut
Copy link
Author

cakriwut commented Feb 4, 2019

Thanks, I use mem-fs-editor as the tunnel between generators.

I close this issue. For other folks who has same challenges, please check generator-office-x npm. 🙏🙏

@cakriwut cakriwut closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants