Open jonschlinkert opened 8 years ago
I like how generate
's generators share an environment when ran. In fact, I initially added the ability to run multiple generators with yo under the same environment from the commandline; however, they didn't like the idea of having them share data on it (for justifiable reasons). I think at the very least it is useful for sub-generators and composing them together. So to me, that is one of the strong points of generate, because in my eyes it allows for more powerful composability (simpler prompting that scaffolds better and more normalized projects)
To give you an example of a place I wanted to use this in, I was going to make this "generator suite" for yeoman that scaffolded out multiple types of projects (called generator-devjs
) using sub-generators that share a global.devjs
object (or this.env.devjs
)... so the main idea was that it only prompted once for certain information then reused it in the other sub-generators. That generator has since been discontinued because I've been content enough with generate's packages, though.
awesome! yeah we plan to expand on how generators share data. This is also a favorite feature of mine because of how intuitive it is (to reiterate for anyone who might be joining the convo, every generator is created with a new instance of generate, but we also expose a special "shared" instance that can be used to pass specific data or options back between generators).
Node.js needs a fast, pluggable prompt library that isn't bloated and dog slow. We might have some ideas here :)
Sounds great! keypress
looks good as starting point for this job. I have some very old shit thingy with it https://github.com/tunnckoCore/prompt-promise. Let me know if can help or suggest something more - the word "pluggable" is enough.
Let's do it.
K you ready for this? :) I think we can simplify further, but it's just a start.
progress here: https://github.com/enquirer
awesome! i'll look.
@tunnckoCore can you check gitter? I left a msg
Yea, no problem. I'm on slack rooms of toolkit too. :)
I didn't know toolkit had one lol. I do now!
I just commented there
I didn't know toolkit had one lol. I do now!
Yea, I don't see you there https://[generatejs/basejs/verbjs/etc].slack.com/messages/general :)
you don't? I should be. I thought you meant an actual toolkit
room.
I'd like to see the following on a formal roadmap (feedback, suggestions, ideas, requests, are all very welcome!):
app.base
property, which can be used for shared data. This has turned out to be a really nice solution (since, after all, generators are used for scaffolding out projects, and not serving up web pages or apps etc). But we still have some rough edges around how "hints" are displayed and answers are pre-populated from successive prompts from multiple generators.TBC...