Skip to content

Commit

Permalink
Merge branch 'main' into fix/update-init-template
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Mar 5, 2024
2 parents 7e26e51 + 5ca509d commit 195d354
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 7 deletions.
47 changes: 43 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,54 @@
# soroban-tools
# Soroban CLI (soroban-cli)

This repo is home to the [Soroban CLI](https://github.com/stellar/soroban-tools/tree/main/cmd/soroban-cli): The command-line multi-tool for running and deploying Soroban contracts.

Soroban: https://soroban.stellar.org

# Adding git hooks
## Install the CLI
Install [the latest soroban-cli version](https://github.com/stellar/soroban-cli/releases).
`cargo install --locked soroban-cli`

You can also install with `cargo-binstall`.
```
cargo install cargo-binstall
cargo binstall -y soroban-cli
```

## Setup Autocomplete
`soroban completion --shell <SHELL>`
Possible SHELL values are `bash`, `elvish`, `fish`, `powershell`, `zsh`, etc.

To enable autocomplete in the current bash shell, run:
`source <(soroban completion --shell bash)`

To enable autocomplete permanently, run:
`echo "source <(soroban completion --shell bash)" >> ~/.bashrc`

## Full Docs
For autogenerated full docs, please see
[docs](/docs/soroban-cli-full-docs.md).

## Latest Release
For latest releases, please see
[releases](https://github.com/stellar/soroban-cli/releases).

## Upcoming Features
For upcoming features, please see the [project
board](https://github.com/orgs/stellar/projects/50).


## Adding Git Hooks

To add git hooks for commits and pushes run:

```
./install_githooks.sh
```

which copies the git hooks found at `.cargo-husky/hooks` to `.git/hooks`.
which copies the git hooks found at `.cargo-husky/hooks` to `.git/hooks`.


## To Contribute
Please fork this see `good first issues` on
[here](https://github.com/stellar/soroban-cli/contribute) and review the [contributing.md](/contributing.md).

Developer Docs: https://developers.stellar.org/docs
8 changes: 5 additions & 3 deletions cmd/soroban-cli/src/commands/contract/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ fn copy_template_files(project_path: &Path) -> Result<(), Error> {
e
})?;

// We need to include the Cargo.toml file as Cargo.text in the template so that it will be included the package. This is making sure that the Cargo file is written as Cargo.toml in the new project. This is a workaround for this issue: https://github.com/rust-lang/cargo/issues/8597.
if item == "Cargo.toml.removeextension" {
to = project_path.join("Cargo.toml");
// We need to include the Cargo.toml file as Cargo.toml.removeextension in the template so that it will be included the package. This is making sure that the Cargo file is written as Cargo.toml in the new project. This is a workaround for this issue: https://github.com/rust-lang/cargo/issues/8597.
let item_path = Path::new(item.as_ref());
if item_path.file_name().unwrap() == "Cargo.toml.removeextension" {
let item_parent_path = item_path.parent().unwrap();
to = project_path.join(item_parent_path).join("Cargo.toml");
}

println!("➕ Writing {}", &to.to_string_lossy());
Expand Down
91 changes: 91 additions & 0 deletions contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Contributing to soroban-cli

Thanks for taking the time to improve soroban-cli!

The following is a set of guidelines for contributions and may change over time.
Feel free to suggest improvements to this document in a pull request.We want to make it as easy as possible to contribute changes that help the Stellar network grow and
thrive. There are a few guidelines that we ask contributors to follow so that we can merge your
changes quickly.

## Getting Started

* Make sure you have a [GitHub account](https://github.com/signup/free).
* Create a GitHub issue for your contribution, assuming one does not already exist.
* Clearly describe the issue including steps to reproduce if it is a bug.
* Fork the repository on GitHub.

### Minor Changes

#### Documentation

For small changes to comments and documentation, it is not
always necessary to create a new GitHub issue. In this case, it is
appropriate to start the first line of a commit with 'doc' instead of
an issue number.

## Finding things to work on

The first place to start is always looking over the current GitHub issues for the project you are
interested in contributing to. Issues marked with [help wanted][help-wanted] are usually pretty
self-contained and a good place to get started.

Stellar.org also uses these same GitHub issues to keep track of what we are working on. If you see
any issues that are assigned to a particular person or have the `in progress` label, that means
someone is currently working on that issue this issue in the next week or two.

Of course, feel free to create a new issue if you think something needs to be added or fixed.


## Making Changes

* Fork the soroban-cli repo to your own Github account
* List the current configured remote repository for your fork. Your git remote
should initially look like this.
```
$ git remote -v
> origin https://github.com/YOUR_USERNAME/soroban-cli.git (fetch)
> origin https://github.com/YOUR_USERNAME/soroban-cli.git (push)`
```
* Set the `stellar/soroban-cli` repo as new remote upstream repository that will
sync with your fork.
```
git remote add upstream https://github.com/stellar/soroban-cli.git
```

* Verify the new upstream repository you've specified for your fork.
```
$ git remote -v
> origin https://github.com/YOUR_USERNAME/soroban-cli.git (fetch)
> origin https://github.com/YOUR_USERNAME/soroban-cli.git (push)
> upstream https://github.com/stellar/soroban-cli.git (fetch)
> upstream https://github.com/stellar/soroban-cli.git (push)
```
* Create a topic branch for your changes in your local repo. When you push you should be able
to create PR based on upstream stellar/soroban-cli.
* Make sure you have added the necessary tests for your changes and make sure all tests pass.


## Submitting Changes

* All content, comments, pull requests and other contributions must comply with the
[Stellar Code of Conduct][coc].
* Push your changes to a topic branch in your fork of the repository.
* Submit a pull request to the repo in the Stellar organization.
* Include a descriptive [commit message][commit-msg].
* Changes contributed via pull request should focus on a single issue at a time.
* Rebase your local changes against the master branch. Resolve any conflicts that arise.


At this point you're waiting on us. We like to at least comment on pull requests within three
business days (typically, one business day). We may suggest some changes, improvements or
alternatives.

# Additional Resources

* #dev-discussion channel on [Discord](https://discord.gg/BYPXtmwX)

This document is inspired by:

[help-wanted]: https://github.com/stellar/soroban-cli/contribute
[commit-msg]: https://github.com/erlang/otp/wiki/Writing-good-commit-messages
[coc]: https://github.com/stellar/.github/blob/master/CODE_OF_CONDUCT.md

0 comments on commit 195d354

Please sign in to comment.