cargo-near
Advanced tools
Comparing version 0.4.1 to 0.6.0
@@ -14,4 +14,7 @@ const { Binary } = require("binary-install"); | ||
const name = "cargo-near"; | ||
const artifact_download_url = "https://github.com/near/cargo-near/releases/download/cargo-near-v0.4.1"; | ||
const artifact_download_url = "https://github.com/near/cargo-near/releases/download/cargo-near-v0.6.0"; | ||
const builder_glibc_major_version = 2; | ||
const builder_glibc_minor_version = 31; | ||
const supportedPlatforms = { | ||
@@ -69,17 +72,8 @@ "aarch64-apple-darwin": { | ||
// Assume the above succeeded and build a target triple to look things up with. | ||
// If any of it failed, this lookup will fail and we'll handle it like normal. | ||
let target_triple = `${arch}-${os_type}`; | ||
let platform = supportedPlatforms[target_triple]; | ||
if (!platform) { | ||
error( | ||
`Platform with type "${raw_os_type}" and architecture "${raw_architecture}" is not supported by ${name}.\nYour system must be one of the following:\n\n${Object.keys(supportedPlatforms).join(",")}` | ||
); | ||
} | ||
// These are both situation where you might toggle to unknown-linux-musl but we don't support that yet | ||
if (raw_os_type === "Linux") { | ||
if (libc.isNonGlibcLinuxSync()) { | ||
error("This operating system does not support dynamic linking to glibc."); | ||
if (libc.familySync() == 'musl') { | ||
os_type = "unknown-linux-musl-dynamic"; | ||
} else if (libc.isNonGlibcLinuxSync()) { | ||
console.warn("Your libc is neither glibc nor musl; trying static musl binary instead"); | ||
os_type = "unknown-linux-musl-static"; | ||
} else { | ||
@@ -90,11 +84,10 @@ let libc_version = libc.versionSync(); | ||
let libc_minor_version = split_libc_version[1]; | ||
let min_major_version = 2; | ||
let min_minor_version = 17; | ||
if ( | ||
libc_major_version < min_major_version || | ||
libc_minor_version < min_minor_version | ||
libc_major_version != builder_glibc_major_version || | ||
libc_minor_version < builder_glibc_minor_version | ||
) { | ||
error( | ||
`This operating system needs glibc >= ${min_major_version}.${min_minor_version}, but only has ${libc_version} installed.` | ||
); | ||
// We can't run the glibc binaries, but we can run the static musl ones | ||
// if they exist | ||
console.warn("Your glibc isn't compatible; trying static musl binary instead"); | ||
os_type = "unknown-linux-musl-static"; | ||
} | ||
@@ -104,2 +97,13 @@ } | ||
// Assume the above succeeded and build a target triple to look things up with. | ||
// If any of it failed, this lookup will fail and we'll handle it like normal. | ||
let target_triple = `${arch}-${os_type}`; | ||
let platform = supportedPlatforms[target_triple]; | ||
if (!platform) { | ||
error( | ||
`Platform with type "${raw_os_type}" and architecture "${raw_architecture}" is not supported by ${name}.\nYour system must be one of the following:\n\n${Object.keys(supportedPlatforms).join(",")}` | ||
); | ||
} | ||
return platform; | ||
@@ -106,0 +110,0 @@ }; |
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
@@ -9,2 +10,28 @@ | ||
## [0.6.0](https://github.com/near/cargo-near/compare/cargo-near-v0.5.2...cargo-near-v0.6.0) - 2024-02-03 | ||
### Added | ||
- Use hello-world contract instead of the status-message contract for the new project starter | ||
- Enable by default release mode, embedded ABIs with doc strings | ||
## [0.5.2](https://github.com/near/cargo-near/compare/cargo-near-v0.5.1...cargo-near-v0.5.2) - 2024-01-27 | ||
### Other | ||
- Updated "feature flag" for near-cli-rs (ledger) ([#126](https://github.com/near/cargo-near/pull/126)) | ||
- Updated near-sdk-rs to 5.0.0-alpha.2 in the new project template ([#127](https://github.com/near/cargo-near/pull/127)) | ||
## [0.5.1](https://github.com/near/cargo-near/compare/cargo-near-v0.5.0...cargo-near-v0.5.1) - 2024-01-25 | ||
### Other | ||
- Upgraded NEAR crates to 0.20.0 release ([#125](https://github.com/near/cargo-near/pull/125)) | ||
- Updated binary releases pipeline to use cargo-dist v0.7.2 (previously v0.3.0) ([#122](https://github.com/near/cargo-near/pull/122)) | ||
## [0.5.0](https://github.com/near/cargo-near/compare/cargo-near-v0.4.1...cargo-near-v0.5.0) - 2023-11-20 | ||
### Added | ||
- New command to initialize a new smart contract project ([#117](https://github.com/near/cargo-near/pull/117)) | ||
### Other | ||
- update `near-sdk`, `near-abi`, `borsh` version ([#109](https://github.com/near/cargo-near/pull/109)) | ||
## [0.4.1](https://github.com/near/cargo-near/compare/cargo-near-v0.4.0...cargo-near-v0.4.1) - 2023-10-19 | ||
@@ -26,1 +53,31 @@ | ||
- [**breaking**] Re-implemented cargo-near to use interactive-clap and near-cli-rs features ([#103](https://github.com/near/cargo-near/pull/103)) | ||
## [0.3.1] - 2023-06-23 | ||
- Exposed `build` and `abi` modules to make them reusable when cargo-near is used as a crate. <https://github.com/near/cargo-near/pull/97> | ||
## [0.3.0] - 2022-11-10 | ||
Highlight: We revised the overall experience of the CLI, making it more accessible, robust, and easier to understand. | ||
- The minimum supported version of the SDK for this release is `4.1.0`. | ||
- Upgraded the `near-abi` version to `0.3.0`. <https://github.com/near/cargo-near/pull/83> | ||
- The exported and embedded ABI now includes build information. <https://github.com/near/cargo-near/pull/55> | ||
- When building a contract, the exported ABI now also includes the code hash of the built contract. <https://github.com/near/cargo-near/pull/55> | ||
- Fixed a situation where `cargo-near` could potentially run into segfaults when working with incompatible versions of the SDK. <https://github.com/near/cargo-near/pull/74> | ||
- `cargo-near` now only accepts valid UTF-8 input from the CLI, and will error out if it encounters invalid UTF-8. <https://github.com/near/cargo-near/pull/76> | ||
- `cargo-near` no longer requires explicitly activating the `abi` feature for the SDK. <https://github.com/near/cargo-near/pull/85> | ||
- Fixed a bug where `cargo-near` exports an empty ABI file when the target directory is explicitly specified. <https://github.com/near/cargo-near/pull/75> | ||
- Introduced build stages with a neat report interface. <https://github.com/near/cargo-near/pull/59>, <https://github.com/near/cargo-near/pull/63>, <https://github.com/near/cargo-near/pull/69> | ||
- Added the `--color` flag to control the color output. <https://github.com/near/cargo-near/pull/86> | ||
- Ensured all forwarded `cargo` output retains colors in it's report, maintaining tooling familiarity. <https://github.com/near/cargo-near/pull/66> | ||
- Removed the buffering that made `cargo`'s `stdout` lag behind its `stderr`. <https://github.com/near/cargo-near/pull/65> | ||
- When building contracts, `cargo`'s warnings are only emitted at the build stage, and not duplicated. <https://github.com/near/cargo-near/pull/68> | ||
## [0.2.0] - 2022-09-01 | ||
> Release Page: <https://github.com/near/cargo-near/releases/tag/v0.2.0> | ||
[unreleased]: https://github.com/near/cargo-near/compare/v0.3.0...HEAD | ||
[0.3.0]: https://github.com/near/cargo-near/compare/v0.2.0...v0.3.0 | ||
[0.2.0]: https://github.com/near/cargo-near/releases/tag/v0.2.0 |
{ | ||
"name": "cargo-near", | ||
"version": "0.4.1", | ||
"version": "0.6.0", | ||
"lockfileVersion": 3, | ||
@@ -9,3 +9,3 @@ "requires": true, | ||
"name": "cargo-near", | ||
"version": "0.4.1", | ||
"version": "0.6.0", | ||
"license": "MIT OR Apache-2.0", | ||
@@ -12,0 +12,0 @@ "hasInstallScript": true, |
{ | ||
"name": "cargo-near", | ||
"version": "0.4.1", | ||
"version": "0.6.0", | ||
"description": "Cargo extension for building Rust smart contracts on NEAR", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/near/cargo-near", |
@@ -25,9 +25,27 @@ <!-- markdownlint-disable MD014 --> | ||
From crates.io: | ||
### Install prebuilt binaries via shell script (Linux, macOS) | ||
```sh | ||
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh | ||
``` | ||
### Install prebuilt binaries via powershell script (Windows) | ||
```sh | ||
irm https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.ps1 | iex | ||
``` | ||
### Install prebuilt binaries into your npm project | ||
```sh | ||
npm install cargo-near | ||
``` | ||
### Compile latest released version from source code | ||
```console | ||
$ cargo install cargo-near | ||
cargo install cargo-near | ||
``` | ||
To install from source: | ||
### Compile latest development version from source code | ||
@@ -41,5 +59,11 @@ ```console | ||
See `cargo near --help` for a complete list of available commands. Help is also available for each individual command with a `--help` flag, e.g. `cargo near build --help`. | ||
See `cargo near --help` for a complete list of available commands or run `cargo near` to dive into interactive mode. Help is also available for each individual command with a `--help` flag, e.g. `cargo near build --help`. | ||
```console | ||
cargo near | ||
``` | ||
Starts interactive mode that will allow to explore all the available commands. | ||
```console | ||
cargo near build | ||
@@ -58,2 +82,15 @@ ``` | ||
```console | ||
cargo near create-dev-account | ||
``` | ||
Guides you through creation of a new NEAR account on [testnet](https://explorer.testnet.near.org). | ||
```console | ||
cargo near deploy | ||
``` | ||
Builds the smart contract (equivalent to `cargo near build`) and guides you to deploy it to the blockchain. | ||
## Contribution | ||
@@ -60,0 +97,0 @@ |
38082
479
109