Skip to content Skip to sidebar Skip to footer

Yeoman Composewith Only Calling Constructor In Subgenerator

I'm trying to use composeWith, to call a subgenerator within the same generator package. Yet for some reason, only the constructor of the called generator is invoked. My generator-

Solution 1:

This doesn't work because you cannot wait for the end on a composed generator.

Calling this.async() is pausing the run loop until the callback is called. In this case, it's never going to be called because the sub generator won't start running until the callback is called (but the callback wait for the sub generator to run). Basically, you're dead locking your node process.

Composition in Yeoman must be independent. It is very important generators stay decoupled. To enforce this, yeoman-generator don't offer flow control for composition other than the run loop priorities.

You'll need to rethink your code and decouple those generators.

Post a Comment for "Yeoman Composewith Only Calling Constructor In Subgenerator"