浏览代码

cli: Add npm package (#438)

Kirill Fomichev 4 年之前
父节点
当前提交
7314c66c9f
共有 3 个文件被更改,包括 35 次插入0 次删除
  1. 2 0
      .gitignore
  2. 4 0
      Makefile
  3. 29 0
      cli/npm-package/package.json

+ 2 - 0
.gitignore

@@ -13,3 +13,5 @@ examples/**/Cargo.lock
 .DS_Store
 docs/yarn.lock
 ts/docs/
+cli/npm-package/anchor
+cli/npm-package/*.tgz

+ 4 - 0
Makefile

@@ -0,0 +1,4 @@
+.PHONY: build-cli
+build-cli:
+	cargo build -p anchor-cli --release
+	cp target/release/anchor cli/npm-package/anchor

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