fastify-cli
fastify-cli copied to clipboard
feat: add `fastify install` command
First draft for a new fastify-cli command called install. This command can be used for any existing Fastify project to browse and install Fastify core plugins. Usage is as follows:
fastify install my-project: Launches an interactive CLI powered by Inquirer.js and the selected plugins will be installed in the foldermy-project. A package.json must already exist in this folder.fastify install my-project --search sql: The CLI searches for any core plugin matching the given word and let the user select from the found pluginsfastify help installshows:
Usage: fastify install <FOLDER>
Launches an interactive CLI application that allows you to browse and install Fastify plugins.
Requires an existing `package.json` file in the specified folder.
OPTS
--search, -s
search for plugins containing the given word
TODO's:
- [ ] Add tests
- [ ] update documentation
- [ ] Optimize search functionality
Checklist
- [x] run
npm run testandnpm run benchmark - [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct
@mcollina Is this approach feasible? Some points that still need to be clarified for me:
- We have to use Inquirer version
8.xsince later versions are ESM modules - Currently, the versions of the plugins are controlled via the
devDependenciesinpackage.json. I am open to other/better approaches
use the latest version and switch the CLI to esm, there is no real need for the CLI to be CJS.