-
Notifications
You must be signed in to change notification settings - Fork 143
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
Update cli command in getting started guide and closes #1138 #1162
base: main
Are you sure you want to change the base?
Conversation
Preview is available here: |
Preview is available here: |
description: Understand, find, and create your own frontend templates for use with Stellar CLI's `stellar contract init` command | ||
--- | ||
|
||
<head> | ||
<title>Develop contract initialization frontend templates</title> | ||
<title>Develop contract witn frontend templates</title> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<title>Develop contract witn frontend templates</title> | |
<title>Develop contract with frontend templates</title> |
@@ -29,11 +29,11 @@ The official template maintained by Stellar Development Foundation (SDF), as use | |||
|
|||
(You may wonder why it makes this unpopular choice. A fair question! The team wanted to balance actual utility with broad approachability. Not everyone learning Stellar and Soroban is familiar with React, or any other UI library. It also demonstrates that core Soroban libraries all work with any JavaScript project.) | |||
|
|||
But note that the CLI's `contract init` command was made to work with _any_ frontend template. It need not even live on GitHub! Simply pass another valid git URL to the command, and it will clone that instead of the official repository: | |||
But note that the CLI's `contract init` command was made to work with a specific set of templates. To use other templates, we will clone other templates from repository: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But note that the CLI's `contract init` command was made to work with a specific set of templates. To use other templates, we will clone other templates from repository: | |
To use other templates, we will clone them from their repositories: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change just removes the contract init
reference, since the fe templates are independent of init now.
|
||
```sh | ||
stellar contract init ./ \ | ||
--frontend-template https://github.com/stellar/soroban-astro-template | ||
git clone [email protected]:stellar/soroban-template-astro.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will clone the template repo's files into a new soroban-template-astro
directory, inside soroban-hello-world
. in order to use these template files, i think we'd need to instruct the user to copy them into the root of the soroban-hello-world
project.
|
||
```sh | ||
stellar contract init ./ --with-example increment | ||
stellar contract init . --name increment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment this command copies the contents of the hello-world
contract from the binary, and renames the directory as increment
.
I think that the only way to get the contracts from soroban-examples we still need to use --with-example
for now.
The deprecation notice about --with-examples
(below) directs the user to clone examples from the repo, perhaps this should be changed to do that instead?
error: invalid value 'increment' for '--with-example <WITH_EXAMPLE>': This argument has been removed and will be not be recognized by the future versions of CLI: Adding examples via cli is no longer supported. You can still clone examples from the repo https://github.com/stellar/soroban-examples
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea would be to use stellar contract init . --name increment
still and then copy the increment lib.rs and test.rs files over into the new files that are created. but that may be confusing. 🤔
Also closes #1035