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

Update cli command in getting started guide and closes #1138 #1162

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

janewang
Copy link
Contributor

@janewang janewang commented Jan 6, 2025

Also closes #1035

@stellar-jenkins
Copy link

@stellar-jenkins
Copy link

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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:

Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

@elizabethengelman elizabethengelman Jan 7, 2025

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

Copy link
Contributor

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. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

soroban getting started guide broken Stop referencing --frontend-template
3 participants