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" + } +}