diff --git a/.gitignore b/.gitignore index 40b878d..04c01ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules/ \ No newline at end of file +node_modules/ +dist/ \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..40b878d --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/README.md b/README.md index 8df0a9b..dd58e0f 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ - [Get Started](#get-started) - [Production Build](#production-build) + - [npm releases](#npm-releases) - [License](#license) --- @@ -40,6 +41,40 @@ This will start a watcher for changes of the code. npm run build ``` +## npm releases + +For a new **patch release**, execute on the machine where you're logged into your npm account: + +```bash +npm run release +``` + +In case you have 2FA setup on npm.js, pass a code as One Time Password: + +```bash +npm run release --otp +``` + +Command is powered by [`release-it`](https://github.com/webpro/release-it) package, defined in the `package.json`. + +That's what the command does without any user interaction: + +- create release commit by updating version in `package.json` +- create tag for that release commit +- push commit & tag +- create a new release on GitHub, with change log auto-generated from commit messages +- publish to npm as a new release + +If you want to create a **minor** or **major release**, use these commands: + +```bash +npm run release-minor +``` + +```bash +npm run release-major +``` + ## License ``` @@ -55,4 +90,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. \ No newline at end of file +limitations under the License. diff --git a/dist/contractLoader.js b/dist/contractLoader.js deleted file mode 100644 index 23fc821..0000000 --- a/dist/contractLoader.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - -var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); - -var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); - -var _truffleContract = _interopRequireDefault(require("truffle-contract")); - -var contracts = []; - -var ContractLoader = -/*#__PURE__*/ -function () { - function ContractLoader() { - (0, _classCallCheck2.default)(this, ContractLoader); - } - - (0, _createClass2.default)(ContractLoader, null, [{ - key: "_doLoad", - value: function () { - var _doLoad2 = (0, _asyncToGenerator2.default)( - /*#__PURE__*/ - _regenerator.default.mark(function _callee(what, where, provider) { - var artifact, contract; - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - // console.log("Loading", what, "from", where) - - /* eslint-disable-next-line */ - artifact = require("@oceanprotocol/keeper-contracts/artifacts/".concat(what, ".").concat(where)); - contract = (0, _truffleContract.default)(artifact); - contract.setProvider(provider); - _context.next = 5; - return contract.at(artifact.address); - - case 5: - contracts[what] = _context.sent; - return _context.abrupt("return", contracts[what]); - - case 7: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function _doLoad(_x, _x2, _x3) { - return _doLoad2.apply(this, arguments); - }; - }() - }, { - key: "load", - value: function load(what, where, provider) { - return contracts[what] || ContractLoader._doLoad(what, where, provider); - } - }]); - return ContractLoader; -}(); - -exports.default = ContractLoader; \ No newline at end of file diff --git a/dist/ocean-agent.js b/dist/ocean-agent.js deleted file mode 100644 index 874268d..0000000 --- a/dist/ocean-agent.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); - -var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); - -/* global fetch */ -var OceanAgent = -/*#__PURE__*/ -function () { - function OceanAgent(connectionUrl) { - (0, _classCallCheck2.default)(this, OceanAgent); - this.assetsUrl = connectionUrl + '/assets'; - } - - (0, _createClass2.default)(OceanAgent, [{ - key: "getAssetsMetadata", - value: function getAssetsMetadata() { - return fetch(this.assetsUrl + '/metadata', { - method: 'GET' - }).then(function (res) { - return res.json(); - }).then(function (data) { - return JSON.parse(data); - }); - } - }, { - key: "publishDataAsset", - value: function publishDataAsset(asset) { - return fetch(this.assetsUrl + '/metadata', { - method: 'POST', - body: JSON.stringify(asset), - headers: { - 'Content-type': 'application/json' - } - }).then(function (response) { - console.log('Success:', response); - - if (response.ok) { - console.log('Success:', response); - return true; - } - - console.log('Failed: ', response.status, response.statusText); - return false; // throw new Error(response.statusText ? response.statusText : `publish asset failed with status ${response.status}`) - }).catch(function (error) { - console.log("Publish asset to ocean database could not be completed: ".concat(error.message())); - return false; - }); - } - }]); - return OceanAgent; -}(); - -exports.default = OceanAgent; \ No newline at end of file diff --git a/dist/ocean-keeper.js b/dist/ocean-keeper.js deleted file mode 100644 index f569d80..0000000 --- a/dist/ocean-keeper.js +++ /dev/null @@ -1,390 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = void 0; - -var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread")); - -var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); - -var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); - -var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); - -var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); - -var _web = _interopRequireDefault(require("web3")); - -var _contractLoader = _interopRequireDefault(require("./contractLoader")); - -var DEFAULT_GAS = 300000; - -var OceanKeeper = -/*#__PURE__*/ -function () { - function OceanKeeper(uri, network) { - (0, _classCallCheck2.default)(this, OceanKeeper); - var web3Provider = new _web.default.providers.HttpProvider(uri); - this.web3 = new _web.default(web3Provider); - this.defaultGas = DEFAULT_GAS; - this.network = network || 'development'; - } - - (0, _createClass2.default)(OceanKeeper, [{ - key: "initContracts", - value: function () { - var _initContracts = (0, _asyncToGenerator2.default)( - /*#__PURE__*/ - _regenerator.default.mark(function _callee() { - return _regenerator.default.wrap(function _callee$(_context) { - while (1) { - switch (_context.prev = _context.next) { - case 0: - _context.next = 2; - return _contractLoader.default.load('OceanToken', this.network, this.web3.currentProvider); - - case 2: - this.oceanToken = _context.sent; - _context.next = 5; - return _contractLoader.default.load('OceanMarket', this.network, this.web3.currentProvider); - - case 5: - this.oceanMarket = _context.sent; - _context.next = 8; - return _contractLoader.default.load('OceanAuth', this.network, this.web3.currentProvider); - - case 8: - this.oceanAuth = _context.sent; - return _context.abrupt("return", { - oceanToken: this.oceanToken, - oceanMarket: this.oceanMarket, - oceanAuth: this.oceanAuth - }); - - case 10: - case "end": - return _context.stop(); - } - } - }, _callee, this); - })); - - return function initContracts() { - return _initContracts.apply(this, arguments); - }; - }() // web3 wrappers - - }, { - key: "sign", - value: function sign(accountAddress, message) { - return this.web3.eth.sign(accountAddress, message); - } - }, { - key: "getMessageHash", - value: function getMessageHash(message) { - return this.web3.sha3("\x19Ethereum Signed Message:\n".concat(message.length).concat(message)); - } // call functions (costs no gas) - - }, { - key: "checkAsset", - value: function checkAsset(assetId) { - return this.oceanMarket.checkAsset(assetId); - } - }, { - key: "getBalance", - value: function getBalance(accountAddress) { - return this.oceanToken.balanceOf.call(accountAddress); - } - }, { - key: "getAssetPrice", - value: function getAssetPrice(assetId) { - return this.oceanMarket.getAssetPrice(assetId).then(function (price) { - return price.toNumber(); - }); - } - }, { - key: "getOrderStatus", - value: function getOrderStatus(orderId) { - return this.oceanAuth.statusOfAccessRequest(orderId); - } - }, { - key: "verifyOrderPayment", - value: function verifyOrderPayment(orderId) { - return this.oceanMarket.verifyPaymentReceived(orderId); - } - }, { - key: "getEncryptedAccessToken", - value: function getEncryptedAccessToken(orderId, senderAddress) { - return this.oceanAuth.getEncryptedAccessToken(orderId, { - from: senderAddress - }); - } - }, { - key: "getConsumerOrders", - value: function () { - var _getConsumerOrders = (0, _asyncToGenerator2.default)( - /*#__PURE__*/ - _regenerator.default.mark(function _callee3(consumerAddress) { - var _this = this; - - var accessConsentEvent, _resolve, _reject, promise, getEvents, events, orders; - - return _regenerator.default.wrap(function _callee3$(_context3) { - while (1) { - switch (_context3.prev = _context3.next) { - case 0: - accessConsentEvent = this.oceanAuth.AccessConsentRequested({ - _consumer: consumerAddress - }, { - fromBlock: 0, - toBlock: 'latest' - }); - _resolve = null; - _reject = null; - promise = new Promise(function (resolve, reject) { - _resolve = resolve; - _reject = reject; - }); - - getEvents = function getEvents() { - accessConsentEvent.get(function (error, logs) { - if (error) { - _reject(error); - - throw new Error(error); - } else { - _resolve(logs); - } - }); - return promise; - }; - - _context3.next = 7; - return getEvents().then(function (events) { - return events; - }); - - case 7: - events = _context3.sent; - // let orders = await this.buildOrdersFromEvents(events, consumerAddress).then((result) => result) - orders = events.filter(function (obj) { - return obj.args._consumer === consumerAddress; - }).map( - /*#__PURE__*/ - function () { - var _ref = (0, _asyncToGenerator2.default)( - /*#__PURE__*/ - _regenerator.default.mark(function _callee2(event) { - return _regenerator.default.wrap(function _callee2$(_context2) { - while (1) { - switch (_context2.prev = _context2.next) { - case 0: - _context2.t0 = _objectSpread2.default; - _context2.t1 = {}; - _context2.t2 = event.args; - _context2.t3 = event.args._timeout.toNumber(); - _context2.next = 6; - return _this.getOrderStatus(event.args._id).then(function (status) { - return status.toNumber(); - }); - - case 6: - _context2.t4 = _context2.sent; - _context2.next = 9; - return _this.verifyOrderPayment(event.args._id).then(function (received) { - return received; - }); - - case 9: - _context2.t5 = _context2.sent; - _context2.t6 = { - timeout: _context2.t3, - status: _context2.t4, - paid: _context2.t5, - key: null - }; - return _context2.abrupt("return", (0, _context2.t0)(_context2.t1, _context2.t2, _context2.t6)); - - case 12: - case "end": - return _context2.stop(); - } - } - }, _callee2, this); - })); - - return function (_x2) { - return _ref.apply(this, arguments); - }; - }()); - console.debug('got orders: ', orders); - return _context3.abrupt("return", orders); - - case 11: - case "end": - return _context3.stop(); - } - } - }, _callee3, this); - })); - - return function getConsumerOrders(_x) { - return _getConsumerOrders.apply(this, arguments); - }; - }() // Transactions with gas cost - - }, { - key: "requestTokens", - value: function requestTokens(senderAddress, numTokens) { - return this.oceanMarket.requestTokens(numTokens, { - from: senderAddress - }); - } - }, { - key: "registerDataAsset", - value: function () { - var _registerDataAsset = (0, _asyncToGenerator2.default)( - /*#__PURE__*/ - _regenerator.default.mark(function _callee4(name, description, price, publisherAddress) { - var assetId, result; - return _regenerator.default.wrap(function _callee4$(_context4) { - while (1) { - switch (_context4.prev = _context4.next) { - case 0: - _context4.next = 2; - return this.oceanMarket.generateId(name + description); - - case 2: - assetId = _context4.sent; - _context4.next = 5; - return this.oceanMarket.register(assetId, price, { - from: publisherAddress, - gas: this.defaultGas - }); - - case 5: - result = _context4.sent; - console.log('registered: ', result); - return _context4.abrupt("return", assetId); - - case 8: - case "end": - return _context4.stop(); - } - } - }, _callee4, this); - })); - - return function registerDataAsset(_x3, _x4, _x5, _x6) { - return _registerDataAsset.apply(this, arguments); - }; - }() - }, { - key: "sendPayment", - value: function () { - var _sendPayment = (0, _asyncToGenerator2.default)( - /*#__PURE__*/ - _regenerator.default.mark(function _callee5(assetId, order, publisherAddress, senderAddress) { - var assetPrice; - return _regenerator.default.wrap(function _callee5$(_context5) { - while (1) { - switch (_context5.prev = _context5.next) { - case 0: - _context5.next = 2; - return this.oceanMarket.getAssetPrice(assetId).then(function (price) { - return price.toNumber(); - }); - - case 2: - assetPrice = _context5.sent; - this.oceanMarket.sendPayment(order.id, publisherAddress, assetPrice, order.timeout, { - from: senderAddress, - gas: 2000000 - }); - - case 4: - case "end": - return _context5.stop(); - } - } - }, _callee5, this); - })); - - return function sendPayment(_x7, _x8, _x9, _x10) { - return _sendPayment.apply(this, arguments); - }; - }() - }, { - key: "cancelAccessRequest", - value: function cancelAccessRequest(orderId, senderAddress) { - return this.oceanAuth.cancelAccessRequest(orderId, { - from: senderAddress - }); - } - }, { - key: "orchestrateResourcePurchase", - value: function orchestrateResourcePurchase(assetId, publisherId, price, privateKey, publicKey, timeout, senderAddress, initialRequestEventHandler, accessCommittedEventHandler, tokenPublishedEventHandler) { - var _this2 = this; - - var oceanToken = this.oceanToken, - oceanMarket = this.oceanMarket, - oceanAuth = this.oceanAuth; // Allow OceanMarket contract to transfer funds on the consumer's behalf - - oceanToken.approve(oceanMarket.address, price, { - from: senderAddress, - gas: 2000000 - }); // Submit the access request - - oceanAuth.initiateAccessRequest(assetId, publisherId, publicKey, timeout, { - from: senderAddress, - gas: 1000000 - }); - var resourceFilter = { - _resourceId: assetId, - _consumer: senderAddress - }; - var initRequestEvent = oceanAuth.AccessConsentRequested(resourceFilter); - var order = {}; - - this._listenOnce(initRequestEvent, 'AccessConsentRequested', function (result, error) { - order = initialRequestEventHandler(result, error); - var requestIdFilter = { - _id: order.id - }; - var accessCommittedEvent = oceanAuth.AccessRequestCommitted(requestIdFilter); - var tokenPublishedEvent = oceanAuth.EncryptedTokenPublished(requestIdFilter); - - _this2._listenOnce(accessCommittedEvent, 'AccessRequestCommitted', function (result, error) { - accessCommittedEventHandler(result, order, error); - }); - - _this2._listenOnce(tokenPublishedEvent, 'EncryptedTokenPublished', function (result, error) { - tokenPublishedEventHandler(result, order, error); - }); - }); - - return order; - } // Helper functions (private) - - }, { - key: "_listenOnce", - value: function _listenOnce(event, eventName, callback) { - event.watch(function (error, result) { - event.stopWatching(); - - if (error) { - console.log("Error in keeper ".concat(eventName, " event: "), error); - } - - callback(result, error); - }); - } - }]); - return OceanKeeper; -}(); - -exports.default = OceanKeeper; \ No newline at end of file diff --git a/dist/squid.js b/dist/squid.js deleted file mode 100644 index 136c509..0000000 --- a/dist/squid.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; - -var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); - -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "OceanAgent", { - enumerable: true, - get: function get() { - return _oceanAgent.default; - } -}); -Object.defineProperty(exports, "OceanKeeper", { - enumerable: true, - get: function get() { - return _oceanKeeper.default; - } -}); - -var _oceanAgent = _interopRequireDefault(require("./ocean-agent")); - -var _oceanKeeper = _interopRequireDefault(require("./ocean-keeper")); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index c76abf7..daa08b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2796,19 +2796,6 @@ "whatwg-fetch": "2.0.4" } }, - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dev": true, - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, "crypto-js": { "version": "3.1.8", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.8.tgz", @@ -2946,6 +2933,22 @@ "pify": "^2.0.0", "pinkie-promise": "^2.0.0", "rimraf": "^2.2.8" + }, + "dependencies": { + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + } } }, "delayed-stream": { @@ -3187,6 +3190,19 @@ "supports-color": "^5.3.0" } }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, "fast-deep-equal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", @@ -3205,6 +3221,12 @@ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -3405,6 +3427,12 @@ "semver": "^5.5.0" }, "dependencies": { + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, "resolve": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", @@ -3417,9 +3445,9 @@ } }, "eslint-plugin-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.0.tgz", - "integrity": "sha512-3on8creJifkmNHvT425jCWSuVK0DG0Quf3H75ENZFqvHl6/s2xme8z6bfxww13XwqfELYWKxc/N3AtBXyV1hdg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.0.1.tgz", + "integrity": "sha512-Si16O0+Hqz1gDHsys6RtFRrW7cCTB6P7p3OJmKp3Y3dxpQE2qwOA7d3xnV+0mBmrPoi0RBnxlCKvqu70te6wjg==", "dev": true }, "eslint-plugin-security": { @@ -4536,24 +4564,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true }, "aproba": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, "requires": { @@ -4563,12 +4595,14 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, "brace-expansion": { "version": "1.1.11", - "bundled": true, + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -4577,34 +4611,40 @@ }, "chownr": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true }, "concat-map": { "version": "0.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true }, "core-util-is": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "bundled": true, + "resolved": false, + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, "requires": { @@ -4613,25 +4653,29 @@ }, "deep-extend": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, "requires": { @@ -4640,13 +4684,15 @@ }, "fs.realpath": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "bundled": true, + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, "requires": { @@ -4662,7 +4708,8 @@ }, "glob": { "version": "7.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, "requires": { @@ -4676,13 +4723,15 @@ }, "has-unicode": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "bundled": true, + "resolved": false, + "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, "requires": { @@ -4691,7 +4740,8 @@ }, "ignore-walk": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, "requires": { @@ -4700,7 +4750,8 @@ }, "inflight": { "version": "1.0.6", - "bundled": true, + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, "requires": { @@ -4710,18 +4761,21 @@ }, "inherits": { "version": "2.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, "ini": { "version": "1.3.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { "number-is-nan": "^1.0.0" @@ -4729,13 +4783,15 @@ }, "isarray": { "version": "1.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -4743,12 +4799,14 @@ }, "minimist": { "version": "0.0.8", - "bundled": true, + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, "minipass": { "version": "2.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, "requires": { "safe-buffer": "^5.1.1", @@ -4757,7 +4815,8 @@ }, "minizlib": { "version": "1.1.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, "requires": { @@ -4766,7 +4825,8 @@ }, "mkdirp": { "version": "0.5.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { "minimist": "0.0.8" @@ -4774,13 +4834,15 @@ }, "ms": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, "requires": { @@ -4791,7 +4853,8 @@ }, "node-pre-gyp": { "version": "0.10.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, "requires": { @@ -4809,7 +4872,8 @@ }, "nopt": { "version": "4.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, "requires": { @@ -4819,13 +4883,15 @@ }, "npm-bundled": { "version": "1.0.3", - "bundled": true, + "resolved": false, + "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "bundled": true, + "resolved": false, + "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, "requires": { @@ -4835,7 +4901,8 @@ }, "npmlog": { "version": "4.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, "requires": { @@ -4847,18 +4914,21 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true }, "object-assign": { "version": "4.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { "wrappy": "1" @@ -4866,19 +4936,22 @@ }, "os-homedir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "bundled": true, + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, "requires": { @@ -4888,19 +4961,22 @@ }, "path-is-absolute": { "version": "1.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "bundled": true, + "resolved": false, + "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, "requires": { @@ -4912,7 +4988,8 @@ "dependencies": { "minimist": { "version": "1.2.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true } @@ -4920,7 +4997,8 @@ }, "readable-stream": { "version": "2.3.6", - "bundled": true, + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, "requires": { @@ -4935,7 +5013,8 @@ }, "rimraf": { "version": "2.6.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, "requires": { @@ -4944,42 +5023,49 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, "safer-buffer": { "version": "2.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "bundled": true, + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "bundled": true, + "resolved": false, + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "bundled": true, + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { "code-point-at": "^1.0.0", @@ -4989,7 +5075,8 @@ }, "string_decoder": { "version": "1.1.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, "requires": { @@ -4998,7 +5085,8 @@ }, "strip-ansi": { "version": "3.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { "ansi-regex": "^2.0.0" @@ -5006,13 +5094,15 @@ }, "strip-json-comments": { "version": "2.0.1", - "bundled": true, + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "bundled": true, + "resolved": false, + "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, "requires": { @@ -5027,13 +5117,15 @@ }, "util-deprecate": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "bundled": true, + "resolved": false, + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, "requires": { @@ -5042,12 +5134,14 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "yallist": { "version": "3.0.2", - "bundled": true, + "resolved": false, + "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true } } @@ -5108,20 +5202,6 @@ "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" }, - "globby": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", - "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", - "dev": true, - "requires": { - "array-union": "^1.0.1", - "arrify": "^1.0.0", - "glob": "^7.0.3", - "object-assign": "^4.0.1", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", @@ -5313,12 +5393,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true - }, "immediate": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", @@ -6479,6 +6553,14 @@ "prelude-ls": "~1.1.2", "type-check": "~0.3.2", "wordwrap": "~1.0.0" + }, + "dependencies": { + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + } } }, "original-require": { @@ -8415,12 +8497,6 @@ "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=" }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", - "dev": true - }, "wrap-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", diff --git a/package.json b/package.json index 76de7b4..25ccfc4 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,11 @@ "scripts": { "test": "eslint ./src", "start": "babel src --watch --out-dir dist", - "build": "babel src --out-dir dist" + "build": "babel src --out-dir dist", + "release": "./node_modules/release-it/bin/release-it.js --src.tagName='v%s' --github.release --npm.publish --non-interactive", + "release-minor": "./node_modules/release-it/bin/release-it.js minor --src.tagName='v%s' --github.release --npm.publish --non-interactive", + "release-major": "./node_modules/release-it/bin/release-it.js major --src.tagName='v%s' --github.release --npm.publish --non-interactive", + "prepublishOnly": "npm run build" }, "repository": { "type": "git",