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
I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
After #737, I think we should make fastify-cli more interactive.
1) When running generate, we should perhaps ask users a few questions in a relevant order.
Use of typescript? Esm/Cjs?
do they want to set up an environment?
do they want to set up a database, a migration system?
do they want to use swagger? under pressure? or any other relevant question?
do they want to use authentication? what kind?
2. We could also create a command to create plugins for an existing project.
If the plugin is customized :
choose a name
does this plugin have any dependencies?
3. We could also enable core and community plugins to be installed with fastify-cli.
After installation, we could check whether a plugin has a specific configuration file following the convention of our choice, and use it to automatically generate the plugin file with some default configuration and comments in the project.
Motivation
The idea here is to make a more relevant and educative tool. I realize it would be a lot of work, but it could also improve the developer experience, I think, and that's something I'd love to do.
Example
1. generate command
When a user runs fastify generate, the CLI might interact with them to configure the project specifics:
$ fastify generate
Welcome to Fastify project generator!? Use TypeScript? (Y/n) Y
? Module system (Use arrow keys)
> ESM
CJS
? Set up an environment configuration? (Y/n) Y
? Set up a database with migration system? (Y/n) n
? Include Swagger for API documentation? (Y/n) Y
? Include authentication? (Y/n) Y
? What kind of authentication:
> OAuth
JWT
Basic
Generating project with TypeScript, ESM, Swagger, and OAuth authentication...
Project generated successfully!
2. New command to add plugins to a project
When creating a new plugin within an existing project, the CLI can guide through setting it up:
$ fastify add-plugin
? Name of the plugin: awesome-logger
? Does this plugin have any dependencies? (Y/n) Y
? List dependencies (comma separated): pino
Creating plugin 'awesome-logger' with dependencies: pino
Plugin created successfully!
3. Installation of core and community plugins
The process to install plugins can also be streamlined with smart configuration:
$ fastify @fastify/cors
? Search and install plugin: '@fastify/cors'
Searching '@fastify/cors'...
?'@fastify/cors' requires specific configuration. Generate default config? (Y/n) Y
Installing '@fastify/cors'...
Plugin installed and configured successfully!
The text was updated successfully, but these errors were encountered:
Prerequisites
🚀 Feature Proposal
After #737, I think we should make
fastify-cli
more interactive.1) When running
generate
, we should perhaps ask users a few questions in a relevant order.2. We could also create a command to create plugins for an existing project.
If the plugin is customized :
3. We could also enable core and community plugins to be installed with
fastify-cli
.After installation, we could check whether a plugin has a specific configuration file following the convention of our choice, and use it to automatically generate the plugin file with some default configuration and comments in the project.
Motivation
The idea here is to make a more relevant and educative tool. I realize it would be a lot of work, but it could also improve the developer experience, I think, and that's something I'd love to do.
Example
1.
generate
commandWhen a user runs
fastify generate
, the CLI might interact with them to configure the project specifics:2. New command to add plugins to a project
When creating a new plugin within an existing project, the CLI can guide through setting it up:
3. Installation of core and community plugins
The process to install plugins can also be streamlined with smart configuration:
The text was updated successfully, but these errors were encountered: