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:
tsgenerates TypeScript bindings from Rust source files.mdgenerates Markdown documentation from Rust source files.
For more details see near-syn --help.
To install the near-syn command line utilities use
cargo install near-synOr alternatively you can install it directly from GitHub (see more install options)
cargo install --git https://github.com/acuarica/near-syn --branch mainThe 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.tsSimilarly, 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.mdWe use cargo-release to verify, publish and tag new versions.
First, install
cargo install cargo-releaseMake sure you have logged in with cargo
cargo loginTo 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