From 7314c66c9f6ba34dc0fcf7a9e46ebd032ca3b34f Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Wed, 30 Jun 2021 00:04:59 +0300 Subject: [PATCH] cli: Add npm package (#438) --- .gitignore | 2 ++ Makefile | 4 ++++ cli/npm-package/package.json | 29 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 Makefile create mode 100644 cli/npm-package/package.json diff --git a/.gitignore b/.gitignore index 351fce1d..6fdab770 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,5 @@ examples/**/Cargo.lock .DS_Store docs/yarn.lock ts/docs/ +cli/npm-package/anchor +cli/npm-package/*.tgz diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..715b74ee --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +.PHONY: build-cli +build-cli: + cargo build -p anchor-cli --release + cp target/release/anchor cli/npm-package/anchor diff --git a/cli/npm-package/package.json b/cli/npm-package/package.json new file mode 100644 index 00000000..8ecc7925 --- /dev/null +++ b/cli/npm-package/package.json @@ -0,0 +1,29 @@ +{ + "name": "@project-serum/anchor-cli", + "version": "0.10.0", + "description": "Anchor CLI tool", + "homepage": "https://github.com/project-serum/anchor#readme", + "bugs": { + "url": "https://github.com/project-serum/anchor/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/project-serum/anchor.git" + }, + "license": "(MIT OR Apache-2.0)", + "bin": { + "anchor": "anchor" + }, + "scripts": { + "prepack": "[ \"$(uname -op)\" != \"x86_64 GNU/Linux\" ] && (echo Only for x86_64 GNU/Linux && exit 1) || ([ \"$(./anchor --version)\" != \"anchor-cli $(jq -r .version package.json)\" ] && (echo Check anchor binary version && exit 2) || exit 0)" + }, + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "publishConfig": { + "access": "public" + } +}