Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EPIC] Enhance CLI init Command with Interactive Setup, Config Automation, and Default Project Structure #1390

Closed
23 of 25 tasks
gregsantos opened this issue Feb 7, 2024 · 0 comments · Fixed by #1616
Closed
23 of 25 tasks
Assignees

Comments

@gregsantos
Copy link
Contributor

gregsantos commented Feb 7, 2024

Issue To Be Solved

This feature request aims to enhance the user setup experience for our CLI tool by introducing a series of interactive prompts during the initialization (init) process. The goal is to enable users to tailor their setup process by making key decisions about their environment, specifically:

  1. Choosing between testnet or mainnet for their network configuration.
  2. Deciding whether to run an emulator for local development purposes. If yes, the tool should automatically use a service account key for authentication and integrate this key into the flow.json configuration file, simplifying the process.
  3. Offering the option to create a new account/s for immediate use in testing.

The problem addressed here is the current lack of guided setup, which can lead to a cumbersome and error-prone configuration process for users, particularly those new to the platform.

Solution

Network Configuration Prompt

Technical Implementation: During the init process, implement a series of prompts asking users to select their desired network, accounts, deployment, and contracts configuration. Store their responses in the flow.json configuration file.

Emulator Usage and Configuration Automation

Technical Implementation: Introduce a prompt asking users if they wish to enable the emulator. If the user opts in, automatically retrieve a service account key and update the flow.json configuration file to include this key. This process should be automated to reduce setup complexity and user error.

Account Creation Option

Technical Implementation: In addition to the service account configuration, offer users the option to create a new account/s during the init process. This should include storing generated keys in the flow.json

Default Directory Structure and Project Bootstrapping

Technical Implementation: Enhance the init command to also create a default directory structure that follows best practices for Flow project organization. This structure should be automatically generated upon initialization and include:

  • A flow.json file populated with all sensible defaults relevant to the chosen network configuration (testnet or mainnet) and any accounts, deployments, or contracts created during the initialization process.
  • A cadence directory containing subdirectories for contracts, scripts, and transactions. Each of these subdirectories will contain a starter Cadence file (HelloWorld.cdc in contracts, QueryHelloMessage.cdc in scripts, and SetHelloMessage.cdc in transactions) to help users get started with development immediately.
    A tests directory containing a basic test file (TestHello.cdc) to encourage testing from the outset of the project.
    Considerations: This structure aims to provide a solid foundation for project development, encouraging best practices in organization and testing. While the default files and structure are designed to be universally applicable, users should have the flexibility to modify or extend this structure as needed for their specific projects.

Tradeoffs: Introducing a default directory structure increases the CLI's complexity and the assumptions it makes about user needs. However, it significantly benefits by providing a clear path forward for new users and reducing the initial setup time for a new project.

Context

The lack of an intuitive setup process seems a significant barrier to entry for new users of our CLI tool. By addressing this issue, we can lower the hurdles for engaging with our platform, thereby increasing adoption and user satisfaction. This feature request is part of a broader initiative to enhance user experience and streamline developer workflows.

Tasks

  1. Feedback Improvement
    chasefleming
  2. Feature Feedback
    chasefleming
  3. Feature
    chasefleming
  4. Feature Feedback
    jribbink
  5. Feature Feedback
    chasefleming
  6. Feature
    chasefleming
  7. Feature
    chasefleming
  8. Feature
    chasefleming
  9. chasefleming
  10. chasefleming
  11. chasefleming
  12. chasefleming
  13. chasefleming
  14. chasefleming
  15. chasefleming
  16. chasefleming
  17. chasefleming
  18. chasefleming
  19. chasefleming
  20. chasefleming
  21. chasefleming
  22. chasefleming
  23. chasefleming
  24. chasefleming
  25. chasefleming
@gregsantos gregsantos converted this from a draft issue Feb 7, 2024
@gregsantos gregsantos moved this from 🆕 New to 🧊 Backlog in 🌊 Flow 4D Feb 7, 2024
@gregsantos gregsantos changed the title Enhance CLI init Command with Interactive Setup, Config Automation, and Default Project Structure [EPIC] Enhance CLI init Command with Interactive Setup, Config Automation, and Default Project Structure Feb 7, 2024
@gregsantos gregsantos moved this from 🧊 Backlog to 🏗 In Progress in 🌊 Flow 4D Mar 28, 2024
@gregsantos gregsantos moved this from 🏗 In Progress to EPICs In Progress in 🌊 Flow 4D Mar 28, 2024
@github-project-automation github-project-automation bot moved this from EPICs In Progress to ✅ Done in 🌊 Flow 4D May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants