You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I was working on an internal project for my company. It's a simple CLI tool and of course I used Inquirer.js. Everything works pretty well so far. There is only one thing which is bothering me. The user needs to have Node.JS installed and must know some basic terminal commands in order to install and use the program.
To open up the tool to a broader group I was first considering to build something similar to https://github.com/yeoman/yeoman-app. Since I'm already stuck with getting the yeoman project forward I was looking for a generic solution where everyone like the yeoman-app project can benefit.
In yeoman/environment you implemented something that you call adapter which is basicly a wrapper around Inquirer.js. My idea is to build something similar into Inquierer.js so we can easily overwrite the render function of each component. I did a quick exploration by overloading inquirer/lib/prompts/list.js and it works pretty well. This is the gist with the example code https://gist.github.com/stefanbuck/3668ee97aba0cfa859203704be7041a6
Another option would be to write a package with implements exactly the same interface as Inquirer.js has. Of course this has a couple down sides, mainly the biggest on is that maintaining one project is hard, maintaining two dependent project is even harder.
I would love to hear what do you think about the idea in general. Do you think it's worth to spend time on it?
The text was updated successfully, but these errors were encountered:
You can use https://github.com/SBoudrias/Inquirer.js#inquirerregisterpromptname-prompt to overwrite the existing prompts. Would you need anything more?
Recently I was working on an internal project for my company. It's a simple CLI tool and of course I used Inquirer.js. Everything works pretty well so far. There is only one thing which is bothering me. The user needs to have Node.JS installed and must know some basic terminal commands in order to install and use the program.
To open up the tool to a broader group I was first considering to build something similar to https://github.com/yeoman/yeoman-app. Since I'm already stuck with getting the yeoman project forward I was looking for a generic solution where everyone like the yeoman-app project can benefit.
In yeoman/environment you implemented something that you call adapter which is basicly a wrapper around Inquirer.js. My idea is to build something similar into Inquierer.js so we can easily overwrite the render function of each component. I did a quick exploration by overloading
inquirer/lib/prompts/list.js
and it works pretty well. This is the gist with the example code https://gist.github.com/stefanbuck/3668ee97aba0cfa859203704be7041a6Another option would be to write a package with implements exactly the same interface as Inquirer.js has. Of course this has a couple down sides, mainly the biggest on is that maintaining one project is hard, maintaining two dependent project is even harder.
I would love to hear what do you think about the idea in general. Do you think it's worth to spend time on it?
The text was updated successfully, but these errors were encountered: