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
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:
Choosing between testnet or mainnet for their network configuration.
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.
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.
The content you are editing has changed. Please copy your edits and refresh the page.
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
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: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 theflow.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: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.cadence
directory containing subdirectories forcontracts
,scripts
, andtransactions
. Each of these subdirectories will contain a starter Cadence file (HelloWorld.cdc
in contracts,QueryHelloMessage.cdc
in scripts, andSetHelloMessage.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
flow dev
should startflow emulator
#1392flow test
configuration and default behaviour #1378flow generate contract
#1394flow init
should generate all files required #1481flow init
should ask what core contracts you'd like installed with dependency manager #1482flow dev
should run tests #1493setup
toinit
#1503flow dev
should run emulator without flag #1579The text was updated successfully, but these errors were encountered: