near-syn

Crates.ionear-syn
lib.rsnear-syn
version0.5.1
sourcesrc
created_at2021-04-11 17:18:06.257633
updated_at2022-05-13 12:03:52.465971
descriptionLibrary and command line utilities to make contract development for the NEAR platform easier. This package contains two command line utilities: near-ts to generate TypeScript bindings and near-doc to generates Markdown docs.
homepagehttps://github.com/acuarica/near-syn
repositoryhttps://github.com/acuarica/near-syn
max_upload_size
id382074
size102,730
Luis Mastrangelo (acuarica)

documentation

README

near-syn

Build Status Crates.io docs.rs License

near-syn is a library and command line utility to ease contract development for the NEAR Protocol. It leverages Rust syn to generate TypeScript bindings and Markdown docs.

The near-syn command line utility contains two sub-commands:

  • ts generates TypeScript bindings from Rust source files.
  • md generates Markdown documentation from Rust source files.

For more details see near-syn --help.

Installation

To install the near-syn command line utilities use

cargo install near-syn

Or alternatively you can install it directly from GitHub (see more install options)

cargo install --git https://github.com/acuarica/near-syn --branch main

Usage

The near-syn ts utility takes a group of Rust source files, and outputs the generated TypeScript bindings.

near-syn ts path/to/src/lib.rs > src/contract.ts

Similarly, the near-syn md utility takes a group of Rust source files, and outputs the generated Markdown documentation.

near-syn md path/to/src/lib.rs > path/to/README.md

Publishing

We use cargo-release to verify, publish and tag new versions. First, install

cargo install cargo-release

Make sure you have logged in with cargo

cargo login

To perform a dry-run

cargo release --verbose [LEVEL]

And to actually publish, tag and release a new version, run

cargo release --verbose --execute [LEVEL]

where [LEVEl] is the bump level incremented to get a new version. For example

cargo release --verbose --execute patch
Commit count: 123

cargo fmt