permaweb-deploy 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2,6 +2,8 @@
2
2
  "use strict";
3
3
 
4
4
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
+ var _yargs = _interopRequireDefault(require("yargs"));
6
+ var _helpers = require("yargs/helpers");
5
7
  var _arweave = _interopRequireDefault(require("arweave"));
6
8
  var _sdk = _interopRequireDefault(require("@irys/sdk"));
7
9
  var _warpContracts = require("warp-contracts");
@@ -11,7 +13,13 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
11
13
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
12
14
  var DEPLOY_FOLDER = './dist';
13
15
  var DEPLOY_KEY = process.env.DEPLOY_KEY;
14
- var ANT_CONTRACT = process.env.ANT_CONTRACT;
16
+ var argv = (0, _yargs["default"])((0, _helpers.hideBin)(process.argv)).option('ant-contract', {
17
+ alias: 'a',
18
+ type: 'string',
19
+ description: 'The ANT contract address',
20
+ demandOption: true
21
+ }).argv;
22
+ var ANT_CONTRACT = argv.antContract;
15
23
  _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
16
24
  var jwk, irys, arweave, warp, warpContract, contractState, txResult;
17
25
  return _regeneratorRuntime().wrap(function _callee$(_context) {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "permaweb-deploy",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Permaweb app deployment package",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "format": "eslint --fix . && npx prettier --write .",
8
8
  "start": "node src/index.js",
9
- "build": "babel src --out-dir dist"
9
+ "build": "babel src --out-dir dist"
10
10
  },
11
11
  "bin": {
12
12
  "permaweb-deploy": "./dist/index.js"
@@ -14,7 +14,8 @@
14
14
  "dependencies": {
15
15
  "@irys/sdk": "0.1.0-a1",
16
16
  "arweave": "1.13.7",
17
- "warp-contracts": "1.4.26"
17
+ "warp-contracts": "1.4.26",
18
+ "yargs": "^17.7.2"
18
19
  },
19
20
  "devDependencies": {
20
21
  "@babel/cli": "^7.23.9",
package/src/index.js CHANGED
@@ -1,18 +1,32 @@
1
1
  #!/usr/bin/env node
2
2
 
3
+ import yargs from 'yargs';
4
+ import { hideBin } from 'yargs/helpers';
5
+
3
6
  import Arweave from 'arweave';
4
7
  import Irys from '@irys/sdk';
5
8
  import { defaultCacheOptions, WarpFactory } from 'warp-contracts';
6
9
 
7
10
  const DEPLOY_FOLDER = './dist';
8
11
  const DEPLOY_KEY = process.env.DEPLOY_KEY;
9
- const ANT_CONTRACT = process.env.ANT_CONTRACT;
12
+
13
+ const argv = yargs(hideBin(process.argv))
14
+ .option('ant-contract', {
15
+ alias: 'a',
16
+ type: 'string',
17
+ description: 'The ANT contract address',
18
+ demandOption: true,
19
+ })
20
+ .argv;
21
+
22
+ const ANT_CONTRACT = argv.antContract;
10
23
 
11
24
  (async () => {
12
25
  if (!DEPLOY_KEY) {
13
26
  console.error('DEPLOY_KEY not configured');
14
27
  return;
15
28
  }
29
+
16
30
  if (!ANT_CONTRACT) {
17
31
  console.error('ANT_CONTRACT not configured');
18
32
  return;
@@ -49,4 +63,4 @@ const ANT_CONTRACT = process.env.ANT_CONTRACT;
49
63
  } catch (e) {
50
64
  console.error(e);
51
65
  }
52
- })();
66
+ })();