tailcallhq / tailcall

High Performance GraphQL Runtime
https://tailcall.run
Apache License 2.0
1.3k stars 254 forks source link

Enhance `tailcall init` Command for Improved Developer Experience #3135

Open amitksingh1490 opened 5 days ago

amitksingh1490 commented 5 days ago

Description:

Currently, the tailcall init command is not optimized for reinitializing a Tailcall project after updating the Tailcall version. This process can be made more seamless with the following enhancements:

  1. Auto-detection of Configuration Format:

    • When reinitializing a project, the command should automatically detect the configuration format (GraphQL/YAML) based on existing files in the folder (e.g., .tailcallrc.graphql or .tailcallrc.yaml).
    • Only prompt the user to choose a format if no configuration file is detected.

    Example Improvement:
    Instead of showing:
    image Automatically infer the format from the existing file.

  2. Skip Confirmation for Overwriting .tailcallrc:

    • Overwriting the .tailcallrc file should not require user confirmation, as it is mandatory for IDEs to understand the Tailcall configuration.

    Current Behavior:
    image Proposed Change: Automatically overwrite the file without prompting.

  3. Skip Overwriting main.graphql:

    • Reinitializing should not overwrite main.graphql

    Current Behavior:

    main.graphql already exists. Overwrite? (y/n)  

    Proposed Change: don't overwrite main.graphql.

These changes will improve the developer experience by reducing unnecessary steps and making the tailcall init command more intuitive during reinitialization.


Steps to Reproduce Current Behavior:

  1. Run tailcall init in an existing Tailcall project directory.
  2. Observe the prompts for configuration format and confirmation to overwrite files.
webbdays commented 4 days ago

Hi, these commands like

tailcall update or tailcall schema update/upgrade

isnt enough? this looks nice.