about summary refs log tree commit diff
path: root/pkgs/tools/misc/near-cli
diff options
context:
space:
mode:
authorRobert Schütz <nix@dotlambda.de>2023-09-09 17:46:09 -0700
committerRobert Schütz <nix@dotlambda.de>2023-09-10 20:20:12 -0700
commit7728271b31b5b4d05ccbea1f4599b5ecb7e8958f (patch)
tree41d6978533e0d86a54d00e0a339edbb94880eb7a /pkgs/tools/misc/near-cli
parent6812ad7a21fefca84cd0470384cec3b65462e5d8 (diff)
near-cli: use mkYarnPackage
Diffstat (limited to 'pkgs/tools/misc/near-cli')
-rw-r--r--pkgs/tools/misc/near-cli/default.nix49
-rw-r--r--pkgs/tools/misc/near-cli/package.json83
2 files changed, 132 insertions, 0 deletions
diff --git a/pkgs/tools/misc/near-cli/default.nix b/pkgs/tools/misc/near-cli/default.nix
new file mode 100644
index 0000000000000..8741f694782cd
--- /dev/null
+++ b/pkgs/tools/misc/near-cli/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, mkYarnPackage
+, fetchFromGitHub
+, fetchYarnDeps
+}:
+
+mkYarnPackage rec {
+  pname = "near-cli";
+  version = "3.4.2";
+
+  src = fetchFromGitHub {
+    owner = "near";
+    repo = "near-cli";
+    rev = "v${version}";
+    hash = "sha256-C+viNYk+6BA11cdi5GqARU3QTTONTR2B2VEZf/SeeSQ=";
+  };
+
+  packageJSON = ./package.json;
+
+  offlineCache = fetchYarnDeps {
+    yarnLock = "${src}/yarn.lock";
+    hash = "sha256-G/Y8xGGOlXH37Bup7mKhEaNh05GTP5CC9e/Xw4TBNMU=";
+  };
+
+  doDist = false;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out/lib/node_modules"
+    mv deps/near-cli "$out/lib/node_modules"
+    rm "$out/lib/node_modules/near-cli/node_modules"
+    mv node_modules "$out/lib/node_modules/near-cli"
+
+    mkdir -p "$out/bin"
+    ln -s "$out/lib/node_modules/near-cli/bin/near" "$out/bin"
+
+    runHook postInstall
+  '';
+
+  meta = {
+    changelog = "https://github.com/near/near-cli/blob/${src.rev}/CHANGELOG.md";
+    description = "General purpose command line tools for interacting with NEAR Protocol";
+    homepage = "https://github.com/near/near-cli";
+    license = with lib.licenses; [ asl20 mit ];
+    mainProgram = "near";
+    maintainers = with lib.maintainers; [ ekleog ];
+  };
+}
diff --git a/pkgs/tools/misc/near-cli/package.json b/pkgs/tools/misc/near-cli/package.json
new file mode 100644
index 0000000000000..a6b794a99115a
--- /dev/null
+++ b/pkgs/tools/misc/near-cli/package.json
@@ -0,0 +1,83 @@
+{
+  "name": "near-cli",
+  "version": "3.4.2",
+  "description": "General purpose command line tools for interacting with NEAR Protocol",
+  "engines": {
+    "node": ">= 12"
+  },
+  "main": "index.js",
+  "scripts": {
+    "pretest": "rm -rf tmp-project",
+    "test": "npm run test:unit && npm run test:integration",
+    "test:unit": "jest",
+    "test:integration": "bash ./test/index.sh",
+    "lint": "eslint .",
+    "fix": "eslint . --fix"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/near/near-cli.git"
+  },
+  "author": "Jane Degtiareva",
+  "license": "(MIT AND Apache-2.0)",
+  "bugs": {
+    "url": "https://github.com/near/near-cli/issues"
+  },
+  "homepage": "https://github.com/near/near-cli#readme",
+  "bin": {
+    "near": "bin/near"
+  },
+  "devDependencies": {
+    "danger": "^10.6.6",
+    "lodash": "^4.17.21",
+    "eslint": "^7.0.0",
+    "jest": "^26.1.0",
+    "strip-ansi": "^7.0.0",
+    "strip-ansi-cli": "^3.0.0",
+    "ts-node": "^10.4.0",
+    "typescript": "^4.5.4"
+  },
+  "dependencies": {
+    "analytics-node": "^6.1.0",
+    "ascii-table": "0.0.9",
+    "bn.js": "^5.1.1",
+    "bs58": "^4.0.1",
+    "chalk": "^4.0.0",
+    "flagged-respawn": "^1.0.1",
+    "is-ci": "^2.0.0",
+    "jest-environment-node": "^27.0.6",
+    "ncp": "^2.0.0",
+    "near-api-js": "^0.44.2",
+    "near-seed-phrase": "^0.2.0",
+    "open": "^8.0.7",
+    "rimraf": "^3.0.0",
+    "stoppable": "^1.1.0",
+    "tcp-port-used": "^1.0.1",
+    "update-notifier": "^5.0.0",
+    "uuid": "^8.0.0",
+    "v8flags": "^3.1.3",
+    "yargs": "^16.0.3"
+  },
+  "optionalDependencies": {
+    "@ledgerhq/hw-transport-node-hid": "^6.1.0",
+    "near-ledger-js": "^0.2.0"
+  },
+  "keywords": [
+    "blockchain",
+    "crypto",
+    "dapps",
+    "distributed",
+    "applications",
+    "distributed applications"
+  ],
+  "files": [
+    "bin",
+    "commands",
+    "middleware",
+    "utils",
+    "config.js",
+    "get-config.js",
+    "test_environment.js",
+    "context"
+  ]
+}