Closed flipace closed 7 years ago
This would need to be implemented. Offhand we could do it with maybe a top-level built-in prompt like destination
(see https://github.com/FormidableLabs/builder-init#archetype-data) or a default derived data like eslintrc
that could be swapped for a prompt.
So as a strawman, we could have a default provided (automatically):
{
derived: {
initTemplatesDir: function (data, cb) { cb(null, "init"); }
}
}
that you could override like:
// init.js
{
derived: {
initTemplatesDir: function (data, cb) { cb(null, "init-somethinelse"); }
}
}
OR
// init.js
{
prompts: {
initTemplatesDir: {
// Using https://github.com/SBoudrias/Inquirer.js#list---type-list
type: "list",
message: "Choose your project type",
choices: [
"init-react",
"init-reactwithrouter",
"init-somethinelse"
]
}
}
}
Does that sound workable? Would you have alternative ideas for how to present the options to the user?
I think the second option sounds rad!
👍 for option 2, an elegant implementation of something I have wanted for a specific use-case for a little while.
@shakefon @ryan-roemer i actually went ahead and found a workaround to just do it myself without touching builder-init itself. i think i could port it into the "core" and make a PR! I'll give it a spin.
Also see https://github.com/FormidableLabs/denim/pull/5 in the underlying denim
engine that will soon support filtering arbitrary file paths with an include / exclude function.
I don't know if this is already possible and I missed it.
I'd like to have multiple different
init
folders likeand I'd like to allow the user when running builder-init to choose which one to use.
Is this possible already or would this need to be implemented?