-
Notifications
You must be signed in to change notification settings - Fork 75
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
Simplify/improve UX of contract init
#1586
Comments
Regarding It strikes me that, after that's done, all that's left of Differences between
(1 and 3 above seem like issues we can deal with at the level of stellar/soroban-examples. We can make it a workspace. We can remove some noise; move some examples to different repositories; make it more focused. Would we still feel a need to specify the subset of contracts? Is renaming a contract difficult enough to merit A separate concern I have always had about the command, I don't know what we should call it, but if we call it the right thing, then we can (basically? actually?) make it a wrapper around degit-rs and move it to the top level. And if we do that, then it works for soroban-examples and also any other git repo. So, for frontend templates too. |
So the way I see this new command, it will:
WDYT? |
Personally, I feel it's not about being difficult to rename files but more about being a boring task that can be easily automated without added complexity.
I think we need to decide what we want to tackle and promote.
Maybe this should be a community plugin instead? Given our goal of removing complexity in favor of git cloning, this seems equally (more?) complex. |
Should |
From the original issue description:2. Renaming other comments
I agree with this - I like Jane's suggestion for a brand-new project, the workflow could be
Or, maybe we could have some way to combine those two steps into one for convenience, but also allow for them to be two separate commands for simplicity. |
Also, just to keep things straight in my brain, I think that these are the things we're in agreement on:
|
The
contract init
command is very useful to quickstart the project, but as it's been shown recently it's very fragile and prone to breaking. The main culprit behind breakage is--with-example
flag.Currently, it feels like the command tries to do too much, and therefore very easy to break by upstream dependencies.
It's proposed to simplify the command, removing some of current functionality, with the possibility of bringing it back later (as another subcommand). There's also a proposal to add some QOL improvements to the command:
--name
switch that generates a contract with that name, so users don’t have to manually rename things. This also allows for developers to easily generate new contracts in an existing project without too much friction.HelloContract
to justContract
, so it’s generic and doesn’t require manual renaming whenever a new contract is generated. Also, a crate can only have one contract, so having a unique name doesn’t bring much.--with-example
; this switch is not really useful when developing real world contracts. That doesn’t mean users won’t have access to fully functional example contracts that can be executed by cloning the examples repo. That flag is de-facto just agit clone
with some extra functionality, but proven to be quite hard to maintain.--frontend-template
; we’re pushing down a tech stack that we don’t necessarily want to promote. We can add something better later on, like a specific command for dapps. We should encourage people to use github tags on their repos for easier discovery. In addition, we may want to introducestellar dapp init
in the future, that will use one of the current templates.stellar-cli
repo, detachingstellar-cli
fromexamples
. Now that we are removing--with-example
, we don't need to clone examples repo for hello-world contract, it can simply live as a starter template in the cli repo.The text was updated successfully, but these errors were encountered: