From 1db88cf4636bad55027af944d643c89c0cc75fc1 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 30 Aug 2018 20:30:13 +0200 Subject: [PATCH 1/5] Add plugin support --- package.json | 8 +- src/index.js | 45 +- src/lib/plugin-loader.js | 11 + src/lib/plugin-scanner.js | 28 + yarn.lock | 1083 ++++++++++++++++++------------------- 5 files changed, 617 insertions(+), 558 deletions(-) create mode 100644 src/lib/plugin-loader.js create mode 100644 src/lib/plugin-scanner.js diff --git a/package.json b/package.json index c5c7a07..d7da37c 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "author": "chevdor", "license": "ISC", "dependencies": { - "@polkadot/api": "^0.28.22", + "@polkadot/api": "0.28.24", "bn.js": "^4.11.8", "matrix-js-sdk": "^0.10.8", "minimongo": "^5.0.1", @@ -36,12 +36,12 @@ "babel-preset-env": "^1.6.1", "babel-register": "^6.26.0", "chai": "^4.1.2", - "chai-http": "^3.0.0", + "chai-http": "4.2.0", "jsdoc": "^3.5.5", "jsdoc-route-plugin": "^0.1.0", "mocha": "^5.0.4", - "nodemon": "^1.17.2", - "standard": "^10.0.3" + "nodemon": "1.18.4", + "standard": "12.0.1" }, "standard": { "parser": "babel-eslint", diff --git a/src/index.js b/src/index.js index 8d113f0..1f7a8d7 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,8 @@ import minimongo from 'minimongo' import createApi from '@polkadot/api' import WsProvider from '@polkadot/api-provider/ws' import pkg from '../package.json' +import PluginScanner from './lib/plugin-scanner' +import PluginLoader from './lib/plugin-loader' global.Olm = Olm const sdk = require('matrix-js-sdk') @@ -38,21 +40,40 @@ matrix.on('event', function (event) { function loadPlugins () { console.log('Loading plugins:') - let nbPlugins = 0 - config.plugins - .filter(plugin => plugin.enabled) - .map(plugin => { - let Plugin = require('./plugins/' + plugin.name) - let p = new Plugin( - plugin.name, + // let nbPlugins = 0 + // config.plugins + // .filter(plugin => plugin.enabled) + // .map(plugin => { + // let Plugin = require('./plugins/' + plugin.name) + // let p = new Plugin( + // plugin.name, + // config, + // matrix, + // polkadot) + // console.log(' - ' + plugin.name) + // p.start() + // nbPlugins++ + // }) + // if (!nbPlugins) console.error('Polkabot could not find any plugin, it needs at least one to be useful') + const pluginScanner = new PluginScanner(pkg.name) + + pluginScanner.scan((err, module) => { + if (err) console.error(err) + console.log('Found plugin: ', module.name) + const pluginLoader = new PluginLoader(module) + pluginLoader.load(Plugin => { + // console.log(Plugin) + let plugin = new Plugin({ config, matrix, - polkadot) - console.log(' - ' + plugin.name) - p.start() - nbPlugins++ + polkadot }) + plugin.start() }) - if (!nbPlugins) console.error('Polkabot could not find any plugin, it needs at least one to be useful') + }, (err, all) => { + if (err) console.error(err) + console.log('Found ' + all.length + ' plugins') + if (all.length === 0) { console.log('Polkabot does not do much without plugin, make sure you install at least one') } + }) } function start () { diff --git a/src/lib/plugin-loader.js b/src/lib/plugin-loader.js new file mode 100644 index 0000000..a57b7d1 --- /dev/null +++ b/src/lib/plugin-loader.js @@ -0,0 +1,11 @@ + +export default class PluginLoader { + constructor (plugin) { + this.plugin = plugin + } + + load (cb) { + console.log('loading', this.plugin.name) + cb(require(this.plugin.path)) + } +} diff --git a/src/lib/plugin-scanner.js b/src/lib/plugin-scanner.js new file mode 100644 index 0000000..76dcee1 --- /dev/null +++ b/src/lib/plugin-scanner.js @@ -0,0 +1,28 @@ +var path = require('path') +var fs = require('fs') + +export default class PluginScanner { + constructor (name) { + this.name = name + } + + scan (cb, done) { + const basepath = path.join(path.dirname(process.argv0), '../lib/node_modules') + var modules = [] + + fs.readdir(basepath, (err, items) => { + if (err) console.error(err) + done(null, items + .filter(i => i.indexOf(this.name) === 0) + .map((plugin) => { + const mod = { + name: plugin, + path: path.join(basepath, plugin) + } + modules.push(mod) + cb(null, mod) + }) + ) + }) + } +} diff --git a/yarn.lock b/yarn.lock index 0dd20ca..c1369bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -86,127 +86,127 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" -"@polkadot/api-format@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/api-format/-/api-format-0.28.22.tgz#43013bd7ce781b14d95b3168d7ee45bc5646e165" +"@polkadot/api-format@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/api-format/-/api-format-0.28.24.tgz#c7993bbb5534fca0c6009cc0d4f1ecea3050dd8e" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/jsonrpc" "^0.28.22" - "@polkadot/primitives" "^0.28.22" - "@polkadot/util" "^0.28.7" - "@polkadot/util-keyring" "^0.28.7" + "@polkadot/jsonrpc" "^0.28.24" + "@polkadot/primitives" "^0.28.24" + "@polkadot/util" "^0.28.21" + "@polkadot/util-keyring" "^0.28.21" -"@polkadot/api-provider@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/api-provider/-/api-provider-0.28.22.tgz#44bb5ba62f1a3ee3b4808fa6c1b7d4b5cd7c3cdd" +"@polkadot/api-provider@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/api-provider/-/api-provider-0.28.24.tgz#9a6f20bfa7af39b05f23466b072485192109f21c" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/storage" "^0.28.22" - "@polkadot/util" "^0.28.7" - "@polkadot/util-crypto" "^0.28.7" - "@polkadot/util-keyring" "^0.28.7" + "@polkadot/storage" "^0.28.24" + "@polkadot/util" "^0.28.21" + "@polkadot/util-crypto" "^0.28.21" + "@polkadot/util-keyring" "^0.28.21" "@types/nock" "^9.1.3" eventemitter3 "^3.1.0" isomorphic-fetch "^2.2.1" websocket "^1.0.25" -"@polkadot/api@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.28.22.tgz#356ce0247c86c5e3a784a30ea40106358a6b6245" +"@polkadot/api@0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-0.28.24.tgz#692db98a99f71ac8c59e8babc37141129a734356" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/api-format" "^0.28.22" - "@polkadot/api-provider" "^0.28.22" - "@polkadot/jsonrpc" "^0.28.22" - "@polkadot/params" "^0.28.22" - "@polkadot/util" "^0.28.7" + "@polkadot/api-format" "^0.28.24" + "@polkadot/api-provider" "^0.28.24" + "@polkadot/jsonrpc" "^0.28.24" + "@polkadot/params" "^0.28.24" + "@polkadot/util" "^0.28.21" -"@polkadot/extrinsics@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.28.22.tgz#8dfb379947238f7a445ce3ad59dac45c3b8b725c" +"@polkadot/extrinsics@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/extrinsics/-/extrinsics-0.28.24.tgz#554a98fc295d366a02f62f82605584c02257dc66" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/params" "^0.28.22" - "@polkadot/primitives" "^0.28.22" - "@polkadot/util" "^0.28.7" + "@polkadot/params" "^0.28.24" + "@polkadot/primitives" "^0.28.24" + "@polkadot/util" "^0.28.21" -"@polkadot/jsonrpc@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.28.22.tgz#1a61fed2138d877c7fa3e96a0154b6385500bd44" +"@polkadot/jsonrpc@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/jsonrpc/-/jsonrpc-0.28.24.tgz#c4af155f1c8444e05d5e23168f08500d99575431" dependencies: - "@polkadot/params" "^0.28.22" + "@polkadot/params" "^0.28.24" babel-runtime "^6.26.0" -"@polkadot/params@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.28.22.tgz#831c3c8197270c71e7f38dbb92fdcdf8fd7aa279" +"@polkadot/params@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/params/-/params-0.28.24.tgz#51f40370db084727f5520a87a3f2b9eaa783d50a" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/extrinsics" "^0.28.22" - "@polkadot/params" "^0.28.22" - "@polkadot/primitives" "^0.28.22" - "@polkadot/util" "^0.28.7" - "@polkadot/util-keyring" "^0.28.7" + "@polkadot/extrinsics" "^0.28.24" + "@polkadot/params" "^0.28.24" + "@polkadot/primitives" "^0.28.24" + "@polkadot/util" "^0.28.21" + "@polkadot/util-keyring" "^0.28.21" -"@polkadot/primitives@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.28.22.tgz#7cf435efb2ff61ced6ab94408be47cd298bf5ce9" +"@polkadot/primitives@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/primitives/-/primitives-0.28.24.tgz#41e46dcecd1066a192dcf1d7b5271b70993761fd" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/trie-hash" "^0.28.7" - "@polkadot/util" "^0.28.7" + "@polkadot/trie-hash" "^0.28.21" + "@polkadot/util" "^0.28.21" -"@polkadot/storage@^0.28.22": - version "0.28.22" - resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.28.22.tgz#9f81d33ee6b71f6e6d2d112726cd5e08ed67bd01" +"@polkadot/storage@^0.28.24": + version "0.28.24" + resolved "https://registry.yarnpkg.com/@polkadot/storage/-/storage-0.28.24.tgz#1e49204d1804d59fe4b91a37f7f971eccb831102" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/params" "^0.28.22" - "@polkadot/primitives" "^0.28.22" - "@polkadot/util" "^0.28.7" - "@polkadot/util-crypto" "^0.28.7" - "@polkadot/util-keyring" "^0.28.7" + "@polkadot/params" "^0.28.24" + "@polkadot/primitives" "^0.28.24" + "@polkadot/util" "^0.28.21" + "@polkadot/util-crypto" "^0.28.21" + "@polkadot/util-keyring" "^0.28.21" -"@polkadot/trie-hash@^0.28.7": - version "0.28.12" - resolved "https://registry.yarnpkg.com/@polkadot/trie-hash/-/trie-hash-0.28.12.tgz#a9754f7c4e5da246bd8ee10db376ff3ee8e6250e" +"@polkadot/trie-hash@^0.28.21": + version "0.28.25" + resolved "https://registry.yarnpkg.com/@polkadot/trie-hash/-/trie-hash-0.28.25.tgz#2d5c16701132fc6b86ea039ef3074b9ac92d5ba3" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/util" "^0.28.12" - "@polkadot/util-crypto" "^0.28.12" - "@polkadot/util-rlp" "^0.28.12" + "@polkadot/util" "^0.28.25" + "@polkadot/util-crypto" "^0.28.25" + "@polkadot/util-rlp" "^0.28.25" -"@polkadot/util-crypto@^0.28.12", "@polkadot/util-crypto@^0.28.7": - version "0.28.12" - resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.28.12.tgz#0b57f2c40529fae763a7778524af931597af1398" +"@polkadot/util-crypto@^0.28.21", "@polkadot/util-crypto@^0.28.25": + version "0.28.25" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-0.28.25.tgz#9d2c43a1767dfd380269996d7891f22d6a642eec" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/util" "^0.28.12" + "@polkadot/util" "^0.28.25" blakejs "^1.1.0" js-sha3 "^0.8.0" tweetnacl "^1.0.0" xxhashjs "^0.2.2" -"@polkadot/util-keyring@^0.28.7": - version "0.28.12" - resolved "https://registry.yarnpkg.com/@polkadot/util-keyring/-/util-keyring-0.28.12.tgz#c0ecd891b3e278494c89ff603570b0af34367e8f" +"@polkadot/util-keyring@^0.28.21": + version "0.28.25" + resolved "https://registry.yarnpkg.com/@polkadot/util-keyring/-/util-keyring-0.28.25.tgz#67ca180c8a0b93e7179198e1a1730f1a3e7434ae" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/util" "^0.28.12" - "@polkadot/util-crypto" "^0.28.12" + "@polkadot/util" "^0.28.25" + "@polkadot/util-crypto" "^0.28.25" "@types/bs58" "^3.0.30" bs58 "^4.0.1" -"@polkadot/util-rlp@^0.28.12": - version "0.28.12" - resolved "https://registry.yarnpkg.com/@polkadot/util-rlp/-/util-rlp-0.28.12.tgz#f46bc22a718c2a0ea875c9307584d5332b2034c6" +"@polkadot/util-rlp@^0.28.25": + version "0.28.25" + resolved "https://registry.yarnpkg.com/@polkadot/util-rlp/-/util-rlp-0.28.25.tgz#5718e08ff72dabb4a386b879f44b32a533416cc5" dependencies: "@babel/runtime" "^7.0.0-rc.1" - "@polkadot/util" "^0.28.12" + "@polkadot/util" "^0.28.25" -"@polkadot/util@^0.28.12", "@polkadot/util@^0.28.7": - version "0.28.12" - resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.28.12.tgz#e8ef5d23073eaef9e10aae7e015114cd5f2b2c7f" +"@polkadot/util@^0.28.21", "@polkadot/util@^0.28.25": + version "0.28.25" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-0.28.25.tgz#8b9c617e08b81e4442874f5882a9294265913e4a" dependencies: "@babel/runtime" "^7.0.0-rc.1" "@types/bn.js" "^4.11.1" @@ -235,6 +235,14 @@ dependencies: "@types/base-x" "*" +"@types/chai@4": + version "4.1.4" + resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.1.4.tgz#5ca073b330d90b4066d6ce18f60d57f2084ce8ca" + +"@types/cookiejar@*": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@types/cookiejar/-/cookiejar-2.1.0.tgz#4b7daf2c51696cfc70b942c11690528229d1a1ce" + "@types/deasync@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@types/deasync/-/deasync-0.1.0.tgz#b2bd6c3fcde3cf67b8be4c2f70136ba8f157b45a" @@ -253,6 +261,13 @@ version "10.9.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.9.2.tgz#f0ab8dced5cd6c56b26765e1c0d9e4fdcc9f2a00" +"@types/superagent@^3.8.3": + version "3.8.4" + resolved "https://registry.yarnpkg.com/@types/superagent/-/superagent-3.8.4.tgz#24a5973c7d1a9c024b4bbda742a79267c33fb86a" + dependencies: + "@types/cookiejar" "*" + "@types/node" "*" + "@types/xxhashjs@^0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@types/xxhashjs/-/xxhashjs-0.1.1.tgz#980709096c7138713b7777f49dccd4b8f93908e5" @@ -261,30 +276,19 @@ abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" -acorn-jsx@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" +acorn-jsx@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-4.1.1.tgz#e8e41e48ea2fe0c896740610ab6a4ffd8add225e" dependencies: - acorn "^3.0.4" - -acorn@^3.0.4: - version "3.3.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" + acorn "^5.0.3" -acorn@^5.5.0: +acorn@^5.0.3, acorn@^5.6.0: version "5.7.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.2.tgz#91fa871883485d06708800318404e72bfb26dcc5" -ajv-keywords@^1.0.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c" - -ajv@^4.7.0: - version "4.11.8" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536" - dependencies: - co "^4.6.0" - json-stable-stringify "^1.0.1" +ajv-keywords@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.2.0.tgz#e86b819c602cf8821ad637413698f1dec021847a" ajv@^5.3.0: version "5.5.2" @@ -295,6 +299,15 @@ ajv@^5.3.0: fast-json-stable-stringify "^2.0.0" json-schema-traverse "^0.3.0" +ajv@^6.0.1, ajv@^6.5.0: + version "6.5.3" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.5.3.tgz#71a569d189ecf4f4f321224fecb166f071dd90f9" + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + another-json@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/another-json/-/another-json-0.2.0.tgz#b5f4019c973b6dd5c6506a2d93469cb6d32aeedc" @@ -305,9 +318,9 @@ ansi-align@^2.0.0: dependencies: string-width "^2.0.0" -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" +ansi-escapes@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" ansi-regex@^2.0.0: version "2.1.1" @@ -376,6 +389,13 @@ arr-union@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" +array-includes@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.7.0" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -394,13 +414,6 @@ array-unique@^0.3.2: version "0.3.2" resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" -array.prototype.find@^2.0.1: - version "2.0.4" - resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.0.4.tgz#556a5c5362c08648323ddaeb9de9d14bc1864c90" - dependencies: - define-properties "^1.1.2" - es-abstract "^1.7.0" - arrify@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" @@ -427,7 +440,7 @@ async-each@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" -async@^1.4.2, async@^1.5.2: +async@^1.4.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -468,7 +481,7 @@ babel-cli@^6.0.0: optionalDependencies: chokidar "^1.6.1" -babel-code-frame@^6.16.0, babel-code-frame@^6.26.0: +babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" dependencies: @@ -1064,11 +1077,7 @@ bs58@^4.0.1: dependencies: base-x "^3.0.2" -buffer-from@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" - -builtin-modules@^1.1.1: +builtin-modules@^1.0.0: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1118,15 +1127,17 @@ catharsis@~0.8.9: dependencies: underscore-contrib "~0.3.0" -chai-http@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chai-http/-/chai-http-3.0.0.tgz#5460d8036e1f1a12b0b5b5cbd529e6dc1d31eb4b" +chai-http@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/chai-http/-/chai-http-4.2.0.tgz#25dc0c0cf9560802f069092ca834a81f04c673bc" dependencies: - cookiejar "2.0.x" - is-ip "1.0.0" + "@types/chai" "4" + "@types/superagent" "^3.8.3" + cookiejar "^2.1.1" + is-ip "^2.0.0" methods "^1.1.2" - qs "^6.2.0" - superagent "^2.0.0" + qs "^6.5.1" + superagent "^3.7.0" chai@^4.1.2: version "4.1.2" @@ -1139,7 +1150,7 @@ chai@^4.1.2: pathval "^1.0.0" type-detect "^4.0.0" -chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: +chalk@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" dependencies: @@ -1149,7 +1160,7 @@ chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.4.1: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" dependencies: @@ -1157,6 +1168,10 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + check-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" @@ -1220,11 +1235,11 @@ cli-boxes@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-1.0.0.tgz#4fa917c3e59c94a004cd61f8ee509da651687143" -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" dependencies: - restore-cursor "^1.0.1" + restore-cursor "^2.0.0" cli-width@^2.0.0: version "2.2.0" @@ -1255,7 +1270,7 @@ color-name@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" -combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.6: +combined-stream@1.0.6, combined-stream@~1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" dependencies: @@ -1277,15 +1292,6 @@ concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - configstore@^3.0.0: version "3.1.2" resolved "https://registry.yarnpkg.com/configstore/-/configstore-3.1.2.tgz#c6f25defaeef26df12dd33414b001fe81a543f8f" @@ -1313,11 +1319,7 @@ convert-source-map@^1.5.0, convert-source-map@^1.5.1: version "1.5.1" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5" -cookiejar@2.0.x: - version "2.0.6" - resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.0.6.tgz#0abf356ad00d1c5a219d88d44518046dd026acfe" - -cookiejar@^2.0.6: +cookiejar@^2.1.0, cookiejar@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/cookiejar/-/cookiejar-2.1.2.tgz#dd8a235530752f988f9a0844f3fc589e3111125c" @@ -1347,6 +1349,16 @@ cross-spawn@^5.0.1: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + crypto-random-string@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-1.0.0.tgz#a230f64f568310e1498009940790ec99545bca7e" @@ -1355,12 +1367,6 @@ cuint@^0.2.2: version "0.2.2" resolved "https://registry.yarnpkg.com/cuint/-/cuint-0.2.2.tgz#408086d409550c2631155619e9fa7bcadc3b991b" -d@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" - dependencies: - es5-ext "^0.10.9" - dashdash@^1.12.0: version "1.14.1" resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" @@ -1384,7 +1390,7 @@ debug@3.1.0, debug@^3.1.0: dependencies: ms "2.0.0" -debug@^2.1.1, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" dependencies: @@ -1478,14 +1484,14 @@ diff@3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" -doctrine@1.5.0, doctrine@^1.2.2: +doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" dependencies: esutils "^2.0.2" isarray "^1.0.0" -doctrine@^2.0.0: +doctrine@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" dependencies: @@ -1522,7 +1528,7 @@ encoding@^0.1.11: dependencies: iconv-lite "~0.4.13" -error-ex@^1.3.1: +error-ex@^1.2.0, error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" dependencies: @@ -1546,137 +1552,82 @@ es-to-primitive@^1.1.1: is-date-object "^1.0.1" is-symbol "^1.0.1" -es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14: - version "0.10.46" - resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.46.tgz#efd99f67c5a7ec789baa3daa7f79870388f7f572" - dependencies: - es6-iterator "~2.0.3" - es6-symbol "~3.1.1" - next-tick "1" - -es6-iterator@^2.0.1, es6-iterator@~2.0.1, es6-iterator@~2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" - dependencies: - d "1" - es5-ext "^0.10.35" - es6-symbol "^3.1.1" - -es6-map@^0.1.3: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-map/-/es6-map-0.1.5.tgz#9136e0503dcc06a301690f0bb14ff4e364e949f0" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-set "~0.1.5" - es6-symbol "~3.1.1" - event-emitter "~0.3.5" - -es6-set@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" - dependencies: - d "1" - es5-ext "~0.10.14" - es6-iterator "~2.0.1" - es6-symbol "3.1.1" - event-emitter "~0.3.5" - -es6-symbol@3.1.1, es6-symbol@^3.1.1, es6-symbol@~3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.1.tgz#bf00ef4fdab6ba1b46ecb7b629b4c7ed5715cc77" - dependencies: - d "1" - es5-ext "~0.10.14" - -es6-weak-map@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.2.tgz#5e3ab32251ffd1538a1f8e5ffa1357772f92d96f" - dependencies: - d "1" - es5-ext "^0.10.14" - es6-iterator "^2.0.1" - es6-symbol "^3.1.1" - escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5, escape-string-regexp@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" -escope@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" - dependencies: - es6-map "^0.1.3" - es6-weak-map "^2.0.1" - esrecurse "^4.1.0" - estraverse "^4.1.1" - -eslint-config-standard-jsx@4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-4.0.2.tgz#009e53c4ddb1e9ee70b4650ffe63a7f39f8836e1" +eslint-config-standard-jsx@6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/eslint-config-standard-jsx/-/eslint-config-standard-jsx-6.0.2.tgz#90c9aa16ac2c4f8970c13fc7efc608bacd02da70" -eslint-config-standard@10.2.1: - version "10.2.1" - resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-10.2.1.tgz#c061e4d066f379dc17cd562c64e819b4dd454591" +eslint-config-standard@12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz#638b4c65db0bd5a41319f96bba1f15ddad2107d9" -eslint-import-resolver-node@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c" +eslint-import-resolver-node@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a" dependencies: - debug "^2.2.0" - object-assign "^4.0.1" - resolve "^1.1.6" + debug "^2.6.9" + resolve "^1.5.0" -eslint-module-utils@^2.0.0: +eslint-module-utils@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz#b270362cd88b1a48ad308976ce7fa54e98411746" dependencies: debug "^2.6.8" pkg-dir "^1.0.0" -eslint-plugin-import@~2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz#72ba306fad305d67c4816348a4699a4229ac8b4e" +eslint-plugin-es@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-es/-/eslint-plugin-es-1.3.1.tgz#5acb2565db4434803d1d46a9b4cbc94b345bd028" + dependencies: + eslint-utils "^1.3.0" + regexpp "^2.0.0" + +eslint-plugin-import@~2.14.0: + version "2.14.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.14.0.tgz#6b17626d2e3e6ad52cfce8807a845d15e22111a8" dependencies: - builtin-modules "^1.1.1" contains-path "^0.1.0" - debug "^2.2.0" + debug "^2.6.8" doctrine "1.5.0" - eslint-import-resolver-node "^0.2.0" - eslint-module-utils "^2.0.0" + eslint-import-resolver-node "^0.3.1" + eslint-module-utils "^2.2.0" has "^1.0.1" - lodash.cond "^4.3.0" + lodash "^4.17.4" minimatch "^3.0.3" - pkg-up "^1.0.0" + read-pkg-up "^2.0.0" + resolve "^1.6.0" -eslint-plugin-node@~4.2.2: - version "4.2.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-4.2.3.tgz#c04390ab8dbcbb6887174023d6f3a72769e63b97" +eslint-plugin-node@~7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-node/-/eslint-plugin-node-7.0.1.tgz#a6e054e50199b2edd85518b89b4e7b323c9f36db" dependencies: - ignore "^3.0.11" - minimatch "^3.0.2" - object-assign "^4.0.1" - resolve "^1.1.7" - semver "5.3.0" + eslint-plugin-es "^1.3.1" + eslint-utils "^1.3.1" + ignore "^4.0.2" + minimatch "^3.0.4" + resolve "^1.8.1" + semver "^5.5.0" -eslint-plugin-promise@~3.5.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-3.5.0.tgz#78fbb6ffe047201627569e85a6c5373af2a68fca" +eslint-plugin-promise@~4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-promise/-/eslint-plugin-promise-4.0.0.tgz#bc15a4aa04fa6116113b6c47488c421821b758fc" -eslint-plugin-react@~6.10.0: - version "6.10.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78" +eslint-plugin-react@~7.11.1: + version "7.11.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz#c01a7af6f17519457d6116aa94fc6d2ccad5443c" dependencies: - array.prototype.find "^2.0.1" - doctrine "^1.2.2" - has "^1.0.1" - jsx-ast-utils "^1.3.4" - object.assign "^4.0.4" + array-includes "^3.0.3" + doctrine "^2.1.0" + has "^1.0.3" + jsx-ast-utils "^2.0.1" + prop-types "^15.6.2" -eslint-plugin-standard@~3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz#34d0c915b45edc6f010393c7eef3823b08565cf2" +eslint-plugin-standard@~4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-4.0.0.tgz#f845b45109c99cd90e77796940a344546c8f6b5c" eslint-scope@3.7.1: version "3.7.1" @@ -1685,62 +1636,76 @@ eslint-scope@3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.3.0, eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + eslint-visitor-keys@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" -eslint@~3.19.0: - version "3.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" +eslint@~5.4.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.4.0.tgz#d068ec03006bb9e06b429dc85f7e46c1b69fac62" dependencies: - babel-code-frame "^6.16.0" - chalk "^1.1.3" - concat-stream "^1.5.2" - debug "^2.1.1" - doctrine "^2.0.0" - escope "^3.6.0" - espree "^3.4.0" - esquery "^1.0.0" - estraverse "^4.2.0" + ajv "^6.5.0" + babel-code-frame "^6.26.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^3.1.0" + doctrine "^2.1.0" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^4.0.0" + esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^2.0.0" - glob "^7.0.3" - globals "^9.14.0" - ignore "^3.2.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.2" imurmurhash "^0.1.4" - inquirer "^0.12.0" - is-my-json-valid "^2.10.0" - is-resolvable "^1.0.0" - js-yaml "^3.5.1" - json-stable-stringify "^1.0.0" + inquirer "^5.2.0" + is-resolvable "^1.1.0" + js-yaml "^3.11.0" + json-stable-stringify-without-jsonify "^1.0.1" levn "^0.3.0" - lodash "^4.0.0" - mkdirp "^0.5.0" + lodash "^4.17.5" + minimatch "^3.0.4" + mkdirp "^0.5.1" natural-compare "^1.4.0" optionator "^0.8.2" - path-is-inside "^1.0.1" - pluralize "^1.2.1" - progress "^1.1.8" - require-uncached "^1.0.2" - shelljs "^0.7.5" - strip-bom "^3.0.0" - strip-json-comments "~2.0.1" - table "^3.7.8" - text-table "~0.2.0" - user-home "^2.0.0" + path-is-inside "^1.0.2" + pluralize "^7.0.0" + progress "^2.0.0" + regexpp "^2.0.0" + require-uncached "^1.0.3" + semver "^5.5.0" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^4.0.3" + text-table "^0.2.0" -espree@^3.4.0: - version "3.5.4" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.4.tgz#b0f447187c8a8bed944b815a660bddf5deb5d1a7" +espree@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-4.0.0.tgz#253998f20a0f82db5d866385799d912a83a36634" dependencies: - acorn "^5.5.0" - acorn-jsx "^3.0.0" + acorn "^5.6.0" + acorn-jsx "^4.1.1" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" -esquery@^1.0.0: +esquery@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" dependencies: @@ -1752,7 +1717,7 @@ esrecurse@^4.1.0: dependencies: estraverse "^4.1.0" -estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1, estraverse@^4.2.0: +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1760,13 +1725,6 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" -event-emitter@~0.3.5: - version "0.3.5" - resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" - dependencies: - d "1" - es5-ext "~0.10.14" - event-stream@~3.3.0: version "3.3.4" resolved "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz#4ab4c9a0f5a54db9338b4c34d86bfce8f4b35571" @@ -1795,10 +1753,6 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - expand-brackets@^0.1.4: version "0.1.5" resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" @@ -1840,6 +1794,14 @@ extend@^3.0.0, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" +external-editor@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -1871,6 +1833,10 @@ fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -1879,12 +1845,11 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" -figures@^1.3.5: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" dependencies: escape-string-regexp "^1.0.5" - object-assign "^4.1.0" file-entry-cache@^2.0.0: version "2.0.0" @@ -1956,15 +1921,7 @@ forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" -form-data@1.0.0-rc4: - version "1.0.0-rc4" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.0-rc4.tgz#05ac6bc22227b43e4461f488161554699d4f8b5e" - dependencies: - async "^1.5.2" - combined-stream "^1.0.5" - mime-types "^2.1.10" - -form-data@~2.3.2: +form-data@^2.3.1, form-data@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.2.tgz#4970498be604c20c005d4f5c23aecd21d6b49099" dependencies: @@ -1972,7 +1929,7 @@ form-data@~2.3.2: combined-stream "1.0.6" mime-types "^2.1.12" -formidable@^1.0.17: +formidable@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/formidable/-/formidable-1.2.1.tgz#70fb7ca0290ee6ff961090415f4b3df3d2082659" @@ -2011,6 +1968,10 @@ function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -2024,23 +1985,13 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" -generate-function@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.2.0.tgz#1aeac896147293d27bce65eb295ce5f3f094a292" - -generate-object-property@^1.1.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0" - dependencies: - is-property "^1.0.0" - get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" -get-stdin@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" get-stream@^3.0.0: version "3.0.0" @@ -2087,7 +2038,7 @@ glob@7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: +glob@^7.0.3, glob@^7.0.5, glob@^7.1.2: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" dependencies: @@ -2104,11 +2055,11 @@ global-dirs@^0.1.0: dependencies: ini "^1.3.4" -globals@^11.1.0: +globals@^11.1.0, globals@^11.7.0: version "11.7.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" -globals@^9.14.0, globals@^9.18.0: +globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -2168,10 +2119,6 @@ has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" -has-symbols@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" - has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -2203,7 +2150,7 @@ has-values@^1.0.0: is-number "^3.0.0" kind-of "^4.0.0" -has@^1.0.1: +has@^1.0.1, has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" dependencies: @@ -2220,6 +2167,10 @@ home-or-tmp@^2.0.0: os-homedir "^1.0.0" os-tmpdir "^1.0.1" +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -2228,7 +2179,7 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" -iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" dependencies: @@ -2248,10 +2199,14 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.0.11, ignore@^3.0.9, ignore@^3.2.0: +ignore@^3.0.9: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" +ignore@^4.0.2: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + import-lazy@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43" @@ -2267,7 +2222,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -2275,37 +2230,33 @@ ini@^1.3.4, ini@~1.3.0: version "1.3.5" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" -inquirer@^0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-0.12.0.tgz#1ef2bfd63504df0bc75785fff8c2c41df12f077e" +inquirer@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" dependencies: - ansi-escapes "^1.1.0" - ansi-regex "^2.0.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" + ansi-escapes "^3.0.0" + chalk "^2.0.0" + cli-cursor "^2.1.0" cli-width "^2.0.0" - figures "^1.3.5" + external-editor "^2.1.0" + figures "^2.0.0" lodash "^4.3.0" - readline2 "^1.0.1" - run-async "^0.1.0" - rx-lite "^3.1.2" - string-width "^1.0.1" - strip-ansi "^3.0.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^5.5.2" + string-width "^2.1.0" + strip-ansi "^4.0.0" through "^2.3.6" -interpret@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.1.0.tgz#7ed1b1410c6a0e0f78cf95d3b8440c63f78b8614" - invariant@^2.2.2: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: loose-envify "^1.0.0" -ip-regex@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-1.0.3.tgz#dc589076f659f419c222039a33316f1c7387effd" +ip-regex@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" ip-regex@^3.0.0: version "3.0.0" @@ -2337,6 +2288,12 @@ is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" +is-builtin-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" + dependencies: + builtin-modules "^1.0.0" + is-callable@^1.1.1, is-callable@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" @@ -2448,25 +2405,11 @@ is-installed-globally@^0.1.0: global-dirs "^0.1.0" is-path-inside "^1.0.0" -is-ip@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-1.0.0.tgz#2bb6959f797ccd6f9fdc812758bcbc87c4c59074" - dependencies: - ip-regex "^1.0.0" - -is-my-ip-valid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824" - -is-my-json-valid@^2.10.0: - version "2.19.0" - resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.19.0.tgz#8fd6e40363cd06b963fa877d444bfb5eddc62175" +is-ip@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ip/-/is-ip-2.0.0.tgz#68eea07e8a0a0a94c2d080dd674c731ab2a461ab" dependencies: - generate-function "^2.0.0" - generate-object-property "^1.1.0" - is-my-ip-valid "^1.0.0" - jsonpointer "^4.0.0" - xtend "^4.0.0" + ip-regex "^2.0.0" is-npm@^1.0.0: version "1.0.0" @@ -2522,9 +2465,9 @@ is-primitive@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" -is-property@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84" +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" is-redirect@^1.0.0: version "1.0.0" @@ -2536,7 +2479,7 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-resolvable@^1.0.0: +is-resolvable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88" @@ -2609,7 +2552,7 @@ js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" -js-yaml@^3.5.1: +js-yaml@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" dependencies: @@ -2667,15 +2610,17 @@ json-schema-traverse@^0.3.0: version "0.3.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz#349a6d44c53a51de89b40805c5d5e59b417d3340" +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + json-schema@0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" -json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: +json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" - dependencies: - jsonify "~0.0.0" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" json-stringify-safe@~5.0.1: version "5.0.1" @@ -2685,14 +2630,6 @@ json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" -jsonify@~0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73" - -jsonpointer@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9" - jsprim@^1.2.2: version "1.4.1" resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" @@ -2702,9 +2639,11 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -jsx-ast-utils@^1.3.4: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-1.4.1.tgz#3867213e8dd79bf1e8f2300c0cfc1efb182c0df1" +jsx-ast-utils@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz#e801b1b39985e20fffc87b40e3748080e2dcac7f" + dependencies: + array-includes "^3.0.3" kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: version "3.2.2" @@ -2745,6 +2684,15 @@ levn@^0.3.0, levn@~0.3.0: prelude-ls "~1.1.2" type-check "~0.3.2" +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + load-json-file@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" @@ -2761,10 +2709,6 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" -lodash.cond@^4.3.0: - version "4.5.2" - resolved "https://registry.yarnpkg.com/lodash.cond/-/lodash.cond-4.5.2.tgz#f471a1da486be60f6ab955d17115523dd1d255d5" - lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -2773,11 +2717,11 @@ lodash@^3.10.1: version "3.10.1" resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" -lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.3.0: +lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" -loose-envify@^1.0.0: +loose-envify@^1.0.0, loose-envify@^1.3.1: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" dependencies: @@ -2877,16 +2821,20 @@ mime-db@~1.36.0: version "1.36.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" -mime-types@^2.1.10, mime-types@^2.1.12, mime-types@~2.1.19: +mime-types@^2.1.12, mime-types@~2.1.19: version "2.1.20" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.20.tgz#930cb719d571e903738520f8470911548ca2cc19" dependencies: mime-db "~1.36.0" -mime@^1.3.4: +mime@^1.4.1: version "1.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" @@ -2962,9 +2910,9 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -mute-stream@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" nan@^2.0.7, nan@^2.3.3, nan@^2.9.2: version "2.11.0" @@ -2998,9 +2946,9 @@ needle@^2.2.1: iconv-lite "^0.4.4" sax "^1.2.4" -next-tick@1: - version "1.0.0" - resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c" +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" node-fetch@^1.0.1: version "1.7.3" @@ -3024,9 +2972,9 @@ node-pre-gyp@^0.10.0: semver "^5.3.0" tar "^4" -nodemon@^1.17.2: - version "1.18.3" - resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.18.3.tgz#46e681ee0dd1b590562e03019b4c5df234f906f9" +nodemon@1.18.4: + version "1.18.4" + resolved "https://registry.yarnpkg.com/nodemon/-/nodemon-1.18.4.tgz#873f65fdb53220eb166180cf106b1354ac5d714d" dependencies: chokidar "^2.0.2" debug "^3.1.0" @@ -3052,6 +3000,15 @@ nopt@~1.0.10: dependencies: abbrev "1" +normalize-package-data@^2.3.2: + version "2.4.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" + dependencies: + hosted-git-info "^2.1.4" + is-builtin-module "^1.0.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -3092,7 +3049,7 @@ oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" -object-assign@^4.0.1, object-assign@^4.1.0: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -3104,7 +3061,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-keys@^1.0.11, object-keys@^1.0.12: +object-keys@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2" @@ -3114,15 +3071,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.0.4: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.omit@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" @@ -3146,9 +3094,11 @@ once@^1.3.0: dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + dependencies: + mimic-fn "^1.0.0" optionator@^0.8.2: version "0.8.2" @@ -3165,7 +3115,7 @@ os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" -os-tmpdir@^1.0.0, os-tmpdir@^1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3222,6 +3172,12 @@ parse-glob@^3.0.4: is-extglob "^1.0.0" is-glob "^2.0.0" +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + parse-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" @@ -3251,11 +3207,11 @@ path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" -path-key@^2.0.0: +path-key@^2.0.0, path-key@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" @@ -3263,6 +3219,12 @@ path-parse@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" +path-type@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" + dependencies: + pify "^2.0.0" + pathval@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.0.tgz#b942e6d4bde653005ef6b71361def8727d0645e0" @@ -3316,15 +3278,9 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" -pkg-up@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-1.0.0.tgz#3e08fb461525c4421624a33b9f7e6d0af5b05a26" - dependencies: - find-up "^1.0.0" - -pluralize@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" +pluralize@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" posix-character-classes@^0.1.0: version "0.1.1" @@ -3350,9 +3306,16 @@ process-nextick-args@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" -progress@^1.1.8: - version "1.1.8" - resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" +progress@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" + +prop-types@^15.6.2: + version "15.6.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102" + dependencies: + loose-envify "^1.3.1" + object-assign "^4.1.1" ps-tree@^1.1.0: version "1.1.0" @@ -3378,7 +3341,11 @@ punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -qs@^6.1.0, qs@^6.2.0, qs@~6.5.2: +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + +qs@^6.5.1, qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -3399,7 +3366,22 @@ rc@^1.0.1, rc@^1.1.6, rc@^1.2.7: minimist "^1.2.0" strip-json-comments "~2.0.1" -readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.2.2: +read-pkg-up@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" + dependencies: + find-up "^2.0.0" + read-pkg "^2.0.0" + +read-pkg@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" + dependencies: + load-json-file "^2.0.0" + normalize-package-data "^2.3.2" + path-type "^2.0.0" + +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.3.5: version "2.3.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" dependencies: @@ -3420,20 +3402,6 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" -readline2@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - mute-stream "0.0.5" - -rechoir@^0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" - dependencies: - resolve "^1.1.6" - regenerate@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11" @@ -3471,6 +3439,10 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" +regexpp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.0.tgz#b2a7534a85ca1b033bcf5ce9ff8e56d4e0755365" + regexpu-core@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" @@ -3545,7 +3517,7 @@ request@^2.53.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -require-uncached@^1.0.2: +require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" dependencies: @@ -3566,18 +3538,18 @@ resolve-url@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" -resolve@^1.1.6, resolve@^1.1.7: +resolve@^1.5.0, resolve@^1.6.0, resolve@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.8.1.tgz#82f1ec19a423ac1fbd080b0bab06ba36e84a7a26" dependencies: path-parse "^1.0.5" -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" + onetime "^2.0.0" + signal-exit "^3.0.2" ret@~0.1.10: version "0.1.15" @@ -3589,19 +3561,21 @@ rimraf@^2.2.8, rimraf@^2.6.1: dependencies: glob "^7.0.5" -run-async@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/run-async/-/run-async-0.1.0.tgz#c8ad4a5e110661e402a7d21b530e009f25f8e389" +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" dependencies: - once "^1.3.0" + is-promise "^2.1.0" run-parallel@^1.1.2: version "1.1.9" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" -rx-lite@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-3.1.2.tgz#19ce502ca572665f3b647b10939f97fd1615f102" +rxjs@^5.5.2: + version "5.5.12" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-5.5.12.tgz#6fa61b8a77c3d793dbaf270bee2f43f652d741cc" + dependencies: + symbol-observable "1.0.1" safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" @@ -3627,11 +3601,7 @@ semver-diff@^2.0.0: dependencies: semver "^5.0.3" -semver@5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.5.0: +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.5.0: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" @@ -3671,14 +3641,6 @@ shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" -shelljs@^0.7.5: - version "0.7.8" - resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.8.tgz#decbcf874b0d1e5fb72e14b164a9683048e9acb3" - dependencies: - glob "^7.0.0" - interpret "^1.0.0" - rechoir "^0.6.2" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3687,9 +3649,11 @@ slash@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" -slice-ansi@0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" +slice-ansi@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d" + dependencies: + is-fullwidth-code-point "^2.0.0" snapdragon-node@^2.0.1: version "2.1.1" @@ -3742,6 +3706,28 @@ source-map@^0.5.0, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" +spdx-correct@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.0.tgz#05a5b4d7153a195bc92c3c425b69f3b2a9524c82" + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz#2c7ae61056c714a5b9b9b2b2af7d311ef5c78fe9" + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz#7a7cd28470cc6d3a1cfe6d66886f6bc430d3ac87" + split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" @@ -3773,28 +3759,28 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -standard-engine@~7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-7.0.0.tgz#ebb77b9c8fc2c8165ffa353bd91ba0dff41af690" +standard-engine@~9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/standard-engine/-/standard-engine-9.0.0.tgz#d3a3d74c4c1b91f51a1e66362465261ca7610316" dependencies: deglob "^2.1.0" - get-stdin "^5.0.1" + get-stdin "^6.0.0" minimist "^1.1.0" pkg-conf "^2.0.0" -standard@^10.0.3: - version "10.0.3" - resolved "https://registry.yarnpkg.com/standard/-/standard-10.0.3.tgz#7869bcbf422bdeeaab689a1ffb1fea9677dd50ea" +standard@12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/standard/-/standard-12.0.1.tgz#0fc5a8aa6c34c546c5562aae644242b24dae2e61" dependencies: - eslint "~3.19.0" - eslint-config-standard "10.2.1" - eslint-config-standard-jsx "4.0.2" - eslint-plugin-import "~2.2.0" - eslint-plugin-node "~4.2.2" - eslint-plugin-promise "~3.5.0" - eslint-plugin-react "~6.10.0" - eslint-plugin-standard "~3.0.1" - standard-engine "~7.0.0" + eslint "~5.4.0" + eslint-config-standard "12.0.0" + eslint-config-standard-jsx "6.0.2" + eslint-plugin-import "~2.14.0" + eslint-plugin-node "~7.0.1" + eslint-plugin-promise "~4.0.0" + eslint-plugin-react "~7.11.1" + eslint-plugin-standard "~4.0.0" + standard-engine "~9.0.0" static-extend@^0.1.1: version "0.1.2" @@ -3817,7 +3803,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -3850,24 +3836,24 @@ strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" -superagent@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/superagent/-/superagent-2.3.0.tgz#703529a0714e57e123959ddefbce193b2e50d115" +superagent@^3.7.0: + version "3.8.3" + resolved "https://registry.yarnpkg.com/superagent/-/superagent-3.8.3.tgz#460ea0dbdb7d5b11bc4f78deba565f86a178e128" dependencies: component-emitter "^1.2.0" - cookiejar "^2.0.6" - debug "^2.2.0" + cookiejar "^2.1.0" + debug "^3.1.0" extend "^3.0.0" - form-data "1.0.0-rc4" - formidable "^1.0.17" + form-data "^2.3.1" + formidable "^1.2.0" methods "^1.1.1" - mime "^1.3.4" - qs "^6.1.0" - readable-stream "^2.0.5" + mime "^1.4.1" + qs "^6.5.1" + readable-stream "^2.3.5" supports-color@5.4.0: version "5.4.0" @@ -3885,16 +3871,20 @@ supports-color@^5.2.0, supports-color@^5.3.0: dependencies: has-flag "^3.0.0" -table@^3.7.8: - version "3.8.3" - resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" +symbol-observable@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.1.tgz#8340fc4702c3122df5d22288f88283f513d3fdd4" + +table@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/table/-/table-4.0.3.tgz#00b5e2b602f1794b9acaf9ca908a76386a7813bc" dependencies: - ajv "^4.7.0" - ajv-keywords "^1.0.0" - chalk "^1.1.1" - lodash "^4.0.0" - slice-ansi "0.0.4" - string-width "^2.0.0" + ajv "^6.0.1" + ajv-keywords "^3.0.0" + chalk "^2.1.0" + lodash "^4.17.4" + slice-ansi "1.0.0" + string-width "^2.1.1" taffydb@2.6.2: version "2.6.2" @@ -3918,7 +3908,7 @@ term-size@^1.2.0: dependencies: execa "^0.7.0" -text-table@~0.2.0: +text-table@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" @@ -3930,6 +3920,12 @@ timed-out@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + dependencies: + os-tmpdir "~1.0.2" + to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -4007,10 +4003,6 @@ typedarray-to-buffer@^3.1.2: dependencies: is-typedarray "^1.0.0" -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - undefsafe@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/undefsafe/-/undefsafe-2.0.2.tgz#225f6b9e0337663e0d8e7cfd686fc2836ccace76" @@ -4080,6 +4072,12 @@ update-notifier@^2.3.0: semver-diff "^2.0.0" xdg-basedir "^3.0.0" +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + dependencies: + punycode "^2.1.0" + urix@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" @@ -4098,12 +4096,6 @@ user-home@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" -user-home@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" - dependencies: - os-homedir "^1.0.0" - util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -4118,6 +4110,13 @@ v8flags@^2.1.1: dependencies: user-home "^1.1.1" +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -4187,7 +4186,7 @@ xmlcreate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-1.0.2.tgz#fa6bf762a60a413fb3dd8f4b03c5b269238d308f" -xtend@^4.0.0, xtend@^4.0.1: +xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" -- GitLab From 1a2791f101ac491c28b8016c92967b7c0e4e5708 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 31 Aug 2018 11:48:19 +0200 Subject: [PATCH 2/5] Cleanup Remove plugins from the repo --- README.adoc | 14 +---- src/index.js | 65 +++---------------- src/lib/plugin-loader.js | 2 +- src/plugins/AccountWatcher/README.adoc | 4 -- src/plugins/BlockStats/README.adoc | 13 ---- src/plugins/BlockStats/config-sample.js | 6 -- src/plugins/BlockStats/index.js | 76 ----------------------- src/plugins/Blocthday/README.adoc | 10 --- src/plugins/Blocthday/config-sample.js | 5 -- src/plugins/Blocthday/index.js | 39 ------------ src/plugins/Operator/README.adoc | 4 -- src/plugins/Operator/config-sample.js | 4 -- src/plugins/Operator/index.js | 58 ----------------- src/plugins/StallWatcher/README.adoc | 10 --- src/plugins/StallWatcher/config-sample.js | 5 -- src/plugins/StallWatcher/index.js | 43 ------------- src/plugins/Validator/README.adoc | 4 -- src/plugins/Validator/config-sample.js | 4 -- src/plugins/Validator/index.js | 70 --------------------- 19 files changed, 12 insertions(+), 424 deletions(-) delete mode 100644 src/plugins/AccountWatcher/README.adoc delete mode 100644 src/plugins/BlockStats/README.adoc delete mode 100644 src/plugins/BlockStats/config-sample.js delete mode 100644 src/plugins/BlockStats/index.js delete mode 100644 src/plugins/Blocthday/README.adoc delete mode 100644 src/plugins/Blocthday/config-sample.js delete mode 100644 src/plugins/Blocthday/index.js delete mode 100644 src/plugins/Operator/README.adoc delete mode 100644 src/plugins/Operator/config-sample.js delete mode 100644 src/plugins/Operator/index.js delete mode 100644 src/plugins/StallWatcher/README.adoc delete mode 100644 src/plugins/StallWatcher/config-sample.js delete mode 100644 src/plugins/StallWatcher/index.js delete mode 100644 src/plugins/Validator/README.adoc delete mode 100644 src/plugins/Validator/config-sample.js delete mode 100644 src/plugins/Validator/index.js diff --git a/README.adoc b/README.adoc index c8dc155..7377506 100644 --- a/README.adoc +++ b/README.adoc @@ -60,16 +60,4 @@ include::doc/plugin.js[] == Plugins -You can find the list of supported plugins below. - -include::src/plugins/AccountWatcher/README.adoc[leveloffset=+2] - -include::src/plugins/BlockStats/README.adoc[leveloffset=+2] - -include::src/plugins/Blocthday/README.adoc[leveloffset=+2] - -include::src/plugins/Operator/README.adoc[leveloffset=+2] - -include::src/plugins/StallWatcher/README.adoc[leveloffset=+2] - -include::src/plugins/Validator/README.adoc[leveloffset=+2] +You can all the plugins in https://gitlab.com/Polkabot diff --git a/src/index.js b/src/index.js index 1f7a8d7..a13cc40 100644 --- a/src/index.js +++ b/src/index.js @@ -18,7 +18,6 @@ const polkadot = createApi(provider) const LocalDb = minimongo.MemoryDb const db = new LocalDb() -db.addCollection('accounts') db.addCollection('config') db.config.upsert({ master: config.matrix.master }, () => { @@ -33,63 +32,38 @@ var matrix = sdk.createClient({ userId: config.matrix.userId }) -matrix.on('event', function (event) { - // comment out if you need to trouble shoot - // console.log(event.getType()) -}) +// comment out if you need to trouble shoot matrix issues +// matrix.on('event', function (event) { +// console.log(event.getType()) +// }) function loadPlugins () { console.log('Loading plugins:') - // let nbPlugins = 0 - // config.plugins - // .filter(plugin => plugin.enabled) - // .map(plugin => { - // let Plugin = require('./plugins/' + plugin.name) - // let p = new Plugin( - // plugin.name, - // config, - // matrix, - // polkadot) - // console.log(' - ' + plugin.name) - // p.start() - // nbPlugins++ - // }) - // if (!nbPlugins) console.error('Polkabot could not find any plugin, it needs at least one to be useful') - const pluginScanner = new PluginScanner(pkg.name) + const pluginScanner = new PluginScanner(pkg.name + '-plugin') pluginScanner.scan((err, module) => { if (err) console.error(err) - console.log('Found plugin: ', module.name) const pluginLoader = new PluginLoader(module) pluginLoader.load(Plugin => { - // console.log(Plugin) let plugin = new Plugin({ config, + db, matrix, polkadot }) plugin.start() }) }, (err, all) => { if (err) console.error(err) - console.log('Found ' + all.length + ' plugins') if (all.length === 0) { console.log('Polkabot does not do much without plugin, make sure you install at least one') } }) } function start () { loadPlugins() - console.log(`${pkg.name} v${pkg.version} started`) - - // matrix.sendTextMessage( - // config.matrix.room, - // `${pkg.name} v${pkg.version} started`) - // .finally(() => { - // }) } matrix.on('sync', function (state, prevState, data) { - // console.log(state, data) switch (state) { case 'PREPARED': start() @@ -97,35 +71,16 @@ matrix.on('sync', function (state, prevState, data) { } }) -matrix.on('RoomMember.typing', function (event, member) { - // if (member.typing) { - // // console.log(member.name + ' is typing...') - // } else { - // // console.log(member.name + ' stopped typing.') - // } -}) - matrix.on('RoomMember.membership', function (event, member) { if (member.membership === 'invite' && member.userId === config.userId) { - matrix.joinRoom(member.roomId).done(function () { + matrix.joinRoom(member.roomId).done(() => { console.log('Auto-joined %s', member.roomId) + matrix.sendTextMessage( + member.roomId, + `Hi there!`) }) } }) -matrix.on('Room.timeline', function (event, room, toStartOfTimeline) { - if (toStartOfTimeline) { - return // don't print paginated results - } - - if (event.getType() !== 'm.room.message') { - // console.log('EVENT:', event) - - } - - // console.log(event) - // console.log('(%s) %s \t: %s', room.name, '*** master ***', event.getContent().body) -}) - const MESSAGES_TO_SHOW = 20 matrix.startClient(MESSAGES_TO_SHOW) diff --git a/src/lib/plugin-loader.js b/src/lib/plugin-loader.js index a57b7d1..cf50271 100644 --- a/src/lib/plugin-loader.js +++ b/src/lib/plugin-loader.js @@ -5,7 +5,7 @@ export default class PluginLoader { } load (cb) { - console.log('loading', this.plugin.name) + console.log('loading plugin: ' + this.plugin.name) cb(require(this.plugin.path)) } } diff --git a/src/plugins/AccountWatcher/README.adoc b/src/plugins/AccountWatcher/README.adoc deleted file mode 100644 index b56d07a..0000000 --- a/src/plugins/AccountWatcher/README.adoc +++ /dev/null @@ -1,4 +0,0 @@ - -= AccountWatcher - -NOTE: Not Implemented Yet diff --git a/src/plugins/BlockStats/README.adoc b/src/plugins/BlockStats/README.adoc deleted file mode 100644 index 0390532..0000000 --- a/src/plugins/BlockStats/README.adoc +++ /dev/null @@ -1,13 +0,0 @@ - -= BlockStats - -This plugin computes stats from time to time. Under normal circumstances, it will not show anything. If the network seems to be running slower than usual, the stats will be sent to the Matrix room. - -Messages look like: - ----- -WARNING: Average block time exceeded 5.000s -Stats for the last 10 at #1184470: - - Nb Blocks: 10 - - Average Block time: 6.705s ----- diff --git a/src/plugins/BlockStats/config-sample.js b/src/plugins/BlockStats/config-sample.js deleted file mode 100644 index 9a91f3a..0000000 --- a/src/plugins/BlockStats/config-sample.js +++ /dev/null @@ -1,6 +0,0 @@ -const config = { - NB_BLOCKS: 300, // Every how many blocks do we output stats - threshold: 6.0 // We remain silent unless the average goes above this value -} - -export default config diff --git a/src/plugins/BlockStats/index.js b/src/plugins/BlockStats/index.js deleted file mode 100644 index 1370022..0000000 --- a/src/plugins/BlockStats/index.js +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env node -import Plugin from '../../lib/lib' -import BN from 'bn.js' -import pluginConfig from './config' - -module.exports = class Blocthday extends Plugin { - constructor (...args) { - super(args) - this.version = '0.0.1' - - this.config[this.name] = pluginConfig - - this.data = [] - this.previousData = null - } - - start () { - super.start() - this.watchChain() - } - - watchChain () { - this.polkadot.chain - .newHead((error, header) => { - if (error) console.error('ERR:', error) - const bnBlockNumber = new BN(header.number, 16) - - this.addBlock(header) - - if (bnBlockNumber.mod(new BN(this.config[this.name].NB_BLOCKS)).toString(10) === '0') { - this.computeStats() - this.alert(bnBlockNumber) - } - }) - .catch(e => console.log) - } - - addBlock (header) { - const data = { - tmsp: new Date(), - blockTime: this.previousData ? new Date() - this.previousData.tmsp : null - // header - } - this.data.push(data) - - while (this.data.length > this.config[this.name].NB_BLOCKS) { this.data.shift() } - this.previousData = data - } - - averageBlockTime () { - const sum = (accumulator, currentValue) => accumulator + currentValue - return this.data - .map(el => el.blockTime || 0) - .reduce(sum) / this.data.filter(item => item.blockTime > 0).length / 1000 - } - - computeStats () { - this.stats = { - nbBlock: this.data.length, - averageBlockTime: this.averageBlockTime() - } - } - - alert (bnBlockNumber) { - if (this.stats.averageBlockTime >= pluginConfig.threshold) { - this.matrix.sendTextMessage( - this.config.matrix.room, - `WARNING: Average block time exceeded ${pluginConfig.threshold.toFixed(3)}s -Stats for the last ${pluginConfig.NB_BLOCKS} at #${bnBlockNumber.toString(10)}: - - Nb Blocks: ${this.stats.nbBlock} - - Average Block time: ${this.stats.averageBlockTime.toFixed(3)}s`) - .finally(function () { - }) - } - } -} diff --git a/src/plugins/Blocthday/README.adoc b/src/plugins/Blocthday/README.adoc deleted file mode 100644 index e7d5f2c..0000000 --- a/src/plugins/Blocthday/README.adoc +++ /dev/null @@ -1,10 +0,0 @@ - -= Blocthday - -This plugin wishes Polkadot a happy blocthday every nth block. - -Messages look like: - ----- -Happy BlocthDay!!! Polkadot is now at #1184300 ----- diff --git a/src/plugins/Blocthday/config-sample.js b/src/plugins/Blocthday/config-sample.js deleted file mode 100644 index d8a92c8..0000000 --- a/src/plugins/Blocthday/config-sample.js +++ /dev/null @@ -1,5 +0,0 @@ -const config = { - NB_BLOCKS: 1000 // we wish a blocthday every nth block -} - -export default config diff --git a/src/plugins/Blocthday/index.js b/src/plugins/Blocthday/index.js deleted file mode 100644 index 9b6139e..0000000 --- a/src/plugins/Blocthday/index.js +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env node -import Plugin from '../../lib/lib' -import BN from 'bn.js' -import pluginConfig from './config' - -module.exports = class Blocthday extends Plugin { - constructor (...args) { - super(args) - this.version = '0.0.1' - - // Every how many blocks do we wish a happy Blocthday - this.config[this.name] = pluginConfig - } - - start () { - super.start() - this.watchChain() - } - - watchChain () { - this.polkadot.chain - .newHead((error, header) => { - if (error) console.error('ERR:', error) - - const bnBlockNumber = new BN(header.number, 16) - - // console.log('#' + bnBlockNumber.toString(10)) - - if (bnBlockNumber.mod(new BN(pluginConfig.NB_BLOCKS)).toString(10) === '0') { - this.matrix.sendTextMessage( - this.config.matrix.room, - `Happy ${pluginConfig.NB_BLOCKS}-BlocthDay!!! Polkadot is now at #${bnBlockNumber.toString(10)}`) - .finally(function () { - }) - } - }) - .catch(e => console.log) - } -} diff --git a/src/plugins/Operator/README.adoc b/src/plugins/Operator/README.adoc deleted file mode 100644 index cef2e48..0000000 --- a/src/plugins/Operator/README.adoc +++ /dev/null @@ -1,4 +0,0 @@ - -= Operator - -This plugin takes care of the administration of Polkabot thru Matrix.org messages. diff --git a/src/plugins/Operator/config-sample.js b/src/plugins/Operator/config-sample.js deleted file mode 100644 index 41d19d2..0000000 --- a/src/plugins/Operator/config-sample.js +++ /dev/null @@ -1,4 +0,0 @@ -const config = { -} - -export default config diff --git a/src/plugins/Operator/index.js b/src/plugins/Operator/index.js deleted file mode 100644 index 442ee3c..0000000 --- a/src/plugins/Operator/index.js +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env node -import Plugin from '../../lib/lib' -import pluginConfig from './config' - -module.exports = class Operator extends Plugin { - constructor (...args) { - super(args) - this.version = '0.0.1' - - this.config[this.name] = pluginConfig - } - - start () { - super.start() - this.watchChat() - } - - answer (roomId, msg) { - this.matrix - .sendTextMessage(roomId, msg) - // .finally(function () { - // }) - } - - watchChat () { - this.matrix.on('Room.timeline', (event, room, toStartOfTimeline) => { - if (event.getType() !== 'm.room.message') { - return - } - - function isPrivate (sender, room) { - return (sender === `@${room.name}:matrix.org`) - } - - const isOperator = (sender) => sender === this.config.matrix.master - - if (isPrivate(event.getSender(), room) && isOperator(event.getSender())) { - // console.log('Private OP message received') - // console.log('event', event) - // console.log('room', room) - - const msg = event.getContent().body - - let capture = msg.match(/^!(?\w+)/) || [] - if (capture.length > 0 && capture.groups.cmd) { - const cmd = capture.groups.cmd - switch (cmd) { - case 'status': - this.answer(room.roomId, 'I am still there!') - break - default: - this.answer(room.roomId, `Command *${cmd}* is not supported`) - } - } - } - }) - } -} diff --git a/src/plugins/StallWatcher/README.adoc b/src/plugins/StallWatcher/README.adoc deleted file mode 100644 index 940fc73..0000000 --- a/src/plugins/StallWatcher/README.adoc +++ /dev/null @@ -1,10 +0,0 @@ - -= StallWatcher - -StallWatcher issues a warning when the network did not issue a block for more than N seconds. - -Messages look like: - ----- -CRITICAL: Network seems to be stalled !!! The last block (#1184813) was 8.002s ago. ----- diff --git a/src/plugins/StallWatcher/config-sample.js b/src/plugins/StallWatcher/config-sample.js deleted file mode 100644 index 048b3a9..0000000 --- a/src/plugins/StallWatcher/config-sample.js +++ /dev/null @@ -1,5 +0,0 @@ -const config = { - duration: 5 // If a block takes longer than n seconds, we trigger the alert -} - -export default config diff --git a/src/plugins/StallWatcher/index.js b/src/plugins/StallWatcher/index.js deleted file mode 100644 index 9dc917a..0000000 --- a/src/plugins/StallWatcher/index.js +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env node -import Plugin from '../../lib/lib' -import pluginConfig from './config' -import BN from 'bn.js' - -module.exports = class StallWatcher extends Plugin { - constructor (...args) { - super(args) - this.version = '0.0.1' - - this.config[this.name] = pluginConfig - } - - start () { - super.start() - this.watchChain() - } - - watchChain () { - this.polkadot.chain - .newHead((error, header) => { - if (error) console.error('ERR:', error) - clearTimeout(this.watchdogId) - - this.watchdogId = setTimeout(this.alert.bind(this), pluginConfig.duration * 1000) - this.lastBlockNumber = new BN(header.number, 16) - this.lastBlockTime = new Date() - }) - .catch(e => console.log) - } - - getDuration () { - return (new Date() - this.lastBlockTime) / 1000 - } - - alert () { - this.matrix.sendTextMessage( - this.config.matrix.room, - `CRITICAL: Network seems to be stalled !!! The last block (#${this.lastBlockNumber.toString(10)}) was seen ${pluginConfig.duration}s ago.`) - .finally(function () { - }) - } -} diff --git a/src/plugins/Validator/README.adoc b/src/plugins/Validator/README.adoc deleted file mode 100644 index 1dc28fd..0000000 --- a/src/plugins/Validator/README.adoc +++ /dev/null @@ -1,4 +0,0 @@ - -= Validator - -NOTE: Not Implemented Yet diff --git a/src/plugins/Validator/config-sample.js b/src/plugins/Validator/config-sample.js deleted file mode 100644 index 41d19d2..0000000 --- a/src/plugins/Validator/config-sample.js +++ /dev/null @@ -1,4 +0,0 @@ -const config = { -} - -export default config diff --git a/src/plugins/Validator/index.js b/src/plugins/Validator/index.js deleted file mode 100644 index c3a0538..0000000 --- a/src/plugins/Validator/index.js +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env node -import Plugin from '../../lib/lib' -import pluginConfig from './config' -import BN from 'bn.js' - -module.exports = class StallWatcher extends Plugin { - constructor (...args) { - super(args) - this.version = '0.0.1' - - this.config[this.name] = pluginConfig - - this.previousValidators = [] - this.currentValidators = [] - } - - start () { - super.start() - this.watchChain() - } - - getValidators () { - if (this.previousValidators.length) { return ['5Dpq7rU6KAZVdRtcegvpCoeJtZzFPzieRkRz4xajRAiMRkCf'] } - return ['5F2ABwFm3fUhWMZT7Zeu7UjCr1dndjJD7qBeHChJhiJC949V', '5Dpq7rU6KAZVdRtcegvpCoeJtZzFPzieRkRz4xajRAiMRkCf'] - } - - validatorChanged () { - return !(JSON.stringify(this.previousValidators) === JSON.stringify(this.currentValidators)) - } - - watchChain () { - this.polkadot.chain - .newHead((error, header) => { - if (error) console.error('ERR:', error) - - this.bnBlockNumber = new BN(header.number, 16) - - this.previousValidators = this.currentValidators - this.currentValidators = this.getValidators() - - if (this.previousValidators.length && - this.validatorChanged()) { - this.alert() - } - }) - .catch(e => console.log) - } - - formatValidators (array) { - let res = '' - array.map(item => { - res += `\t - ${item}\n` - }) - return res - } - - // TODO: Don“t show before after but who is IN and OUT - alert () { - this.matrix.sendTextMessage( - this.config.matrix.room, - `#${this.bnBlockNumber.toString(10)} - Validators have changed: - Previous: -${this.formatValidators(this.previousValidators)} - Current: -${this.formatValidators(this.currentValidators)} -See details at http://polkadash.io/`) - .finally(function () { - }) - } -} -- GitLab From b57b4d9407e451206759f3c4a6e0aaf98ad097b0 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 31 Aug 2018 18:10:19 +0200 Subject: [PATCH 3/5] Add yargs to handle user config --- package.json | 15 +++-- src/index.js | 152 ++++++++++++++++++++++++++++++--------------------- src/polkabot | 17 ++++++ yarn.lock | 125 +++++++++++++++++++++++++++++++++++++++++- 4 files changed, 239 insertions(+), 70 deletions(-) create mode 100755 src/polkabot diff --git a/package.json b/package.json index d7da37c..6b5dacd 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,13 @@ { "name": "polkabot", - "version": "0.0.2", + "version": "0.0.3", "description": "Matrix Bot for Polkadot", - "main": "src/index.js", + "main": "./src/polkabot", + "bin": "./src/polkabot", "repository": "", "scripts": { - "dev": "nodemon ./src/index.js ./config-dev.json --exec babel-node --presets env", - "start": "babel-node ./src/index.js", + "dev": "nodemon ./src/polkabot -c ./src/config.js --exec babel-node --presets env", + "start": "babel-node ./src/polkabot", "test": "mocha --timeout 5000 --require babel-core/register test/* --exit", "test:local": "mocha --require babel-core/register test/* --exit", "test:watch": "mocha --watch --require babel-core/register test/* --exit", @@ -21,12 +22,16 @@ }, "author": "chevdor", "license": "ISC", + "keywords": [ + "blockchain", "polkadot", "NodeJS", "ChatBox", "Matrix.org" + ], "dependencies": { "@polkadot/api": "0.28.24", "bn.js": "^4.11.8", "matrix-js-sdk": "^0.10.8", "minimongo": "^5.0.1", - "olm": "https://matrix.org/packages/npm/olm/olm-2.2.2.tgz" + "olm": "https://matrix.org/packages/npm/olm/olm-2.2.2.tgz", + "yargs": "^12.0.1" }, "devDependencies": { "babel-cli": "^6.0.0", diff --git a/src/index.js b/src/index.js index a13cc40..f6f11c7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,86 +1,112 @@ import 'babel-core/register' import 'babel-polyfill' import Olm from 'olm' -import config from './config' import minimongo from 'minimongo' import createApi from '@polkadot/api' import WsProvider from '@polkadot/api-provider/ws' import pkg from '../package.json' import PluginScanner from './lib/plugin-scanner' import PluginLoader from './lib/plugin-loader' +var path = require('path') global.Olm = Olm const sdk = require('matrix-js-sdk') -console.log(`Connecting to ${config.polkadot.host}`) -const provider = new WsProvider(config.polkadot.host) -const polkadot = createApi(provider) - -const LocalDb = minimongo.MemoryDb -const db = new LocalDb() -db.addCollection('config') - -db.config.upsert({ master: config.matrix.master }, () => { - db.config.findOne({}, {}, function (res) { - console.log('Master is : ' + res.master) - }) -}) - -var matrix = sdk.createClient({ - baseUrl: 'https://matrix.org', - accessToken: config.matrix.token, - userId: config.matrix.userId -}) - // comment out if you need to trouble shoot matrix issues // matrix.on('event', function (event) { // console.log(event.getType()) // }) -function loadPlugins () { - console.log('Loading plugins:') - const pluginScanner = new PluginScanner(pkg.name + '-plugin') - - pluginScanner.scan((err, module) => { - if (err) console.error(err) - const pluginLoader = new PluginLoader(module) - pluginLoader.load(Plugin => { - let plugin = new Plugin({ - config, - db, - matrix, - polkadot }) - plugin.start() - }) - }, (err, all) => { - if (err) console.error(err) - if (all.length === 0) { console.log('Polkabot does not do much without plugin, make sure you install at least one') } - }) -} +export default class Polakbot { + constructor (args) { + this.args = args + } -function start () { - loadPlugins() - console.log(`${pkg.name} v${pkg.version} started`) -} + loadPlugins () { + console.log('Loading plugins:') + const pluginScanner = new PluginScanner(pkg.name + '-plugin') -matrix.on('sync', function (state, prevState, data) { - switch (state) { - case 'PREPARED': - start() - break - } -}) - -matrix.on('RoomMember.membership', function (event, member) { - if (member.membership === 'invite' && member.userId === config.userId) { - matrix.joinRoom(member.roomId).done(() => { - console.log('Auto-joined %s', member.roomId) - matrix.sendTextMessage( - member.roomId, - `Hi there!`) + pluginScanner.scan((err, module) => { + if (err) console.error(err) + const pluginLoader = new PluginLoader(module) + pluginLoader.load(Plugin => { + let plugin = new Plugin({ + config: this.config, + db: this.db, + matrix: this.matrix, + polkadot: this.polkadot }) + plugin.start() + }) + }, (err, all) => { + if (err) console.error(err) + if (all.length === 0) { console.log('Polkabot does not do much without plugin, make sure you install at least one') } }) } -}) -const MESSAGES_TO_SHOW = 20 -matrix.startClient(MESSAGES_TO_SHOW) + start () { + this.loadPlugins() + } + + run () { + console.log(`${pkg.name} v${pkg.version}`) + console.log(`===========================`) + + console.log('process', process.cwd()) + console.log('dirname', __dirname) + + const configLocation = this.args.config + ? path.join(process.cwd(), this.args.config) + : path.join(__dirname, './config') + console.log('Config location: ', configLocation) + + this.config = require(configLocation).default + + console.log(`Connecting to ${this.config.polkadot.host}`) + const provider = new WsProvider(this.config.polkadot.host) + this.polkadot = createApi(provider) + + const LocalDb = minimongo.MemoryDb + this.db = new LocalDb() + this.db.addCollection('config') + + this.db.config.upsert({ master: this.config.matrix.master }, () => { + this.db.config.findOne({}, {}, res => { + console.log('Master is : ' + res.master) + }) + }) + + this.matrix = sdk.createClient({ + baseUrl: 'https://matrix.org', + accessToken: this.config.matrix.token, + userId: this.config.matrix.userId + }) + + this.matrix.on('sync', (state, prevState, data) => { + switch (state) { + case 'PREPARED': + this.start() + break + } + }) + + this.matrix.on('RoomMember.membership', (event, member) => { + if (member.membership === 'invite') { + // TODO: Fix the following to get the latest activity in the room + // const roomState = new sdk.RoomState(member.roomId) + // const inactivityInDays = (new Date() - new Date(roomState._modified)) / 1000 / 60 / 60 + // console.log(roomState.events) + + // if (inactivityInDays < 7) { + this.matrix.joinRoom(member.roomId).done(() => { + console.log('Auto-joined %s', member.roomId) + console.log(` - ${event.event.membership} from ${event.event.sender}`) + // console.log(` - modified ${new Date(roomState._modified)})`) + // console.log(` - last activity for ${(inactivityInDays / 24).toFixed(3)} days (${(inactivityInDays).toFixed(2)}h)`) + }) + // } + } + }) + + this.matrix.startClient(this.config.matrix.MESSAGES_TO_SHOW || 20) + } +} diff --git a/src/polkabot b/src/polkabot new file mode 100755 index 0000000..e8ed8ff --- /dev/null +++ b/src/polkabot @@ -0,0 +1,17 @@ +#!/usr/bin/env node +import Polkabot from './index.js' + +const argv = require('yargs') + .usage('Usage: $0 [options]') + .alias('c', 'config') + .nargs('c', 1) + .describe('c', 'Select config file') + .demandOption(['c']) + .help('h') + .alias('h', 'help') + .epilog('chevdor-(C)2018') + .argv + +var polkabot = new Polkabot(argv) + +polkabot.run() diff --git a/yarn.lock b/yarn.lock index c1369bf..10c83b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1105,7 +1105,7 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" -camelcase@^4.0.0: +camelcase@^4.0.0, camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" @@ -1245,6 +1245,14 @@ cli-width@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1396,6 +1404,12 @@ debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: dependencies: ms "2.0.0" +decamelize@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-2.0.0.tgz#656d7bbc8094c4c788ea53c5840908c9c7d063c7" + dependencies: + xregexp "4.0.0" + decode-uri-component@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" @@ -1898,6 +1912,12 @@ find-up@^2.0.0: dependencies: locate-path "^2.0.0" +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + dependencies: + locate-path "^3.0.0" + flat-cache@^1.2.1: version "1.3.0" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-1.3.0.tgz#d3030b32b38154f4e3b7e9c709f490f7ef97c481" @@ -1985,6 +2005,10 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + get-func-name@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" @@ -2254,6 +2278,10 @@ invariant@^2.2.2: dependencies: loose-envify "^1.0.0" +invert-kv@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" + ip-regex@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9" @@ -2677,6 +2705,12 @@ latest-version@^3.0.0: dependencies: package-json "^4.0.0" +lcid@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" + dependencies: + invert-kv "^1.0.0" + levn@^0.3.0, levn@~0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" @@ -2709,6 +2743,13 @@ locate-path@^2.0.0: p-locate "^2.0.0" path-exists "^3.0.0" +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" @@ -2777,6 +2818,12 @@ matrix-js-sdk@^0.10.8: content-type "^1.0.2" request "^2.53.0" +mem@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" + dependencies: + mimic-fn "^1.0.0" + methods@^1.1.1, methods@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -3115,6 +3162,14 @@ os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" +os-locale@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" + dependencies: + execa "^0.7.0" + lcid "^1.0.0" + mem "^1.1.0" + os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" @@ -3144,16 +3199,32 @@ p-limit@^1.1.0: dependencies: p-try "^1.0.0" +p-limit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.0.0.tgz#e624ed54ee8c460a778b3c9f3670496ff8a57aec" + dependencies: + p-try "^2.0.0" + p-locate@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" dependencies: p-limit "^1.1.0" +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + dependencies: + p-limit "^2.0.0" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" +p-try@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.0.0.tgz#85080bb87c64688fa47996fe8f7dfbe8211760b1" + package-json@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/package-json/-/package-json-4.0.1.tgz#8869a0401253661c4c4ca3da6c2121ed555f5eed" @@ -3517,6 +3588,14 @@ request@^2.53.0: tunnel-agent "^0.6.0" uuid "^3.3.2" +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + require-uncached@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/require-uncached/-/require-uncached-1.0.3.tgz#4e0d56d6c9662fd31e43011c4b95aa49955421d3" @@ -3605,7 +3684,7 @@ semver-diff@^2.0.0: version "5.5.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.1.tgz#7dfdd8814bdb7cabc7be0fb1d734cfb66c940477" -set-blocking@~2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -4138,6 +4217,10 @@ whatwg-fetch@>=0.10.0: version "2.0.4" resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f" +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + which@^1.2.9: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" @@ -4160,6 +4243,13 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -4186,6 +4276,10 @@ xmlcreate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/xmlcreate/-/xmlcreate-1.0.2.tgz#fa6bf762a60a413fb3dd8f4b03c5b269238d308f" +xregexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xregexp/-/xregexp-4.0.0.tgz#e698189de49dd2a18cc5687b05e17c8e43943020" + xtend@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -4196,6 +4290,10 @@ xxhashjs@^0.2.2: dependencies: cuint "^0.2.2" +"y18n@^3.2.1 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" @@ -4207,3 +4305,26 @@ yallist@^2.1.2: yallist@^3.0.0, yallist@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.2.tgz#8452b4bb7e83c7c188d8041c1a837c773d6d8bb9" + +yargs-parser@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-10.1.0.tgz#7202265b89f7e9e9f2e5765e0fe735a905edbaa8" + dependencies: + camelcase "^4.1.0" + +yargs@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.1.tgz#6432e56123bb4e7c3562115401e98374060261c2" + dependencies: + cliui "^4.0.0" + decamelize "^2.0.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^2.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^10.1.0" -- GitLab From d9bc26ee54a1460bf90979b6c9c1328569a1b0d9 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 31 Aug 2018 18:58:53 +0200 Subject: [PATCH 4/5] Cleanup --- docker/Dockerfile | 7 ------- docker/config-sample.js | 26 -------------------------- package.json | 1 + src/index.js | 4 ++-- src/lib/lib.js | 20 -------------------- 5 files changed, 3 insertions(+), 55 deletions(-) delete mode 100644 docker/Dockerfile delete mode 100644 docker/config-sample.js delete mode 100644 src/lib/lib.js diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index e852cce..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM chevdor/polkabot:latest - -WORKDIR /usr/src/app - -COPY config.js ./src/ - -CMD [ "npm", "start" ] diff --git a/docker/config-sample.js b/docker/config-sample.js deleted file mode 100644 index c29bc47..0000000 --- a/docker/config-sample.js +++ /dev/null @@ -1,26 +0,0 @@ -const config = { - polkadot: { - host: 'ws://127.0.0.1:9944' - }, - matrix: { - master: '@you:matrix.org', - room: '!:matrix.org' - }, - - userId: '@...:matrix.org', - token: 'your_token_here', - - // Plugin names must match folder names in the plugins folder - plugins: [{ - name: 'BlockStats', - enabled: true - }, { - name: 'Blocthday', - enabled: true - }, { - name: 'Operator', - enabled: true - }] -} - -export default config diff --git a/package.json b/package.json index 6b5dacd..355e9ce 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "docker:run": "docker run --rm -it chevdor/mypolkabot" }, "author": "chevdor", + "repository":"https://gitlab.com/Polkabot/polkabot", "license": "ISC", "keywords": [ "blockchain", "polkadot", "NodeJS", "ChatBox", "Matrix.org" diff --git a/src/index.js b/src/index.js index f6f11c7..2b4e164 100644 --- a/src/index.js +++ b/src/index.js @@ -55,11 +55,11 @@ export default class Polakbot { console.log('dirname', __dirname) const configLocation = this.args.config - ? path.join(process.cwd(), this.args.config) + ? this.args.config : path.join(__dirname, './config') console.log('Config location: ', configLocation) - this.config = require(configLocation).default + this.config = require(configLocation) console.log(`Connecting to ${this.config.polkadot.host}`) const provider = new WsProvider(this.config.polkadot.host) diff --git a/src/lib/lib.js b/src/lib/lib.js deleted file mode 100644 index 6dabe70..0000000 --- a/src/lib/lib.js +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env node - -export default class Plugin { - constructor (args) { - // console.log('Plugin args', args) - this.name = args[0] - this.config = args[1] - this.matrix = args[2] - this.polkadot = args[3] - - // console.log('Name set to ', this.name) - // console.log('Config set to ', this.config) - // console.log('Matrix set to ', this.matrix) - // console.log('Polkadot set to ', this.polkadot) - } - - start () { - console.log(' starting ' + this.name) - } -} -- GitLab From de68357c4de1499676e14fa7e8deb1ac399a832f Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 1 Sep 2018 15:42:06 +0200 Subject: [PATCH 5/5] Fix for plugins --- Dockerfile | 2 ++ README.adoc | 9 +++++---- package.json | 16 +++++++--------- src/index.js | 1 + src/lib/plugin-loader.js | 8 ++++++-- src/{polkabot => polkabot.js} | 0 6 files changed, 21 insertions(+), 15 deletions(-) rename src/{polkabot => polkabot.js} (100%) diff --git a/Dockerfile b/Dockerfile index f3c310c..31d7b99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ COPY . . RUN npm i npm@latest -g && \ npm install && \ + npm install -g \ + polkabot-plugin-stallwatcher && \ npm audit fix --force CMD [ "npm", "start" ] diff --git a/README.adoc b/README.adoc index 7377506..4b2bb65 100644 --- a/README.adoc +++ b/README.adoc @@ -28,13 +28,15 @@ At that point, you will need to search for the `config-sample.js` files. Everywh To build the base and the custom: - yarn docker + yarn build:docker -This will build the Polkabot main image and a custom image as specified in the `docker` folder. +This will build the Polkabot main image. Then, test with : - yarn docker:run +---- +docker run --rm -it -v ~/path/to/your/config.js:/data/config.js chevdor/polkabot npm start -- --config /data/config.js +---- == Configuration @@ -46,7 +48,6 @@ Polkabot uses 2 levels of configuration: include::CONTRIBUTING.adoc[] - === Create plugins Once you picked a name for your plugin, create a folder in `src/plugin`. diff --git a/package.json b/package.json index 355e9ce..8abfa34 100644 --- a/package.json +++ b/package.json @@ -2,23 +2,21 @@ "name": "polkabot", "version": "0.0.3", "description": "Matrix Bot for Polkadot", - "main": "./src/polkabot", - "bin": "./src/polkabot", + "main": "./dist/polkabot.js", + "bin": { "polkabot" : "./dist/polkabot.js" }, "repository": "", "scripts": { - "dev": "nodemon ./src/polkabot -c ./src/config.js --exec babel-node --presets env", + "dev": "nodemon ./src/polkabot -c ./config.js --exec babel-node --presets env", "start": "babel-node ./src/polkabot", "test": "mocha --timeout 5000 --require babel-core/register test/* --exit", "test:local": "mocha --require babel-core/register test/* --exit", "test:watch": "mocha --watch --require babel-core/register test/* --exit", "lint": "standard", - "clean": "rm -rf .nyc_output build coverage node_modules out", - "build": "babel src -d dist", + "clean": "rm -rf .nyc_output build coverage node_modules out dist", + "build": "babel src -d dist --ignore config*.js", "build:doc": "jsdoc -r -d out -c jsdoc.conf", - "docker:build": "docker build -t chevdor/polkabot .", - "docker:build-my": "cd docker && docker build -t chevdor/mypolkabot .", - "docker": "npm run docker:build && npm run docker:build-my", - "docker:run": "docker run --rm -it chevdor/mypolkabot" + "build:docker": "docker build -t chevdor/polkabot .", + "docker:run": "docker run --rm -it chevdor/mypolkabot " }, "author": "chevdor", "repository":"https://gitlab.com/Polkabot/polkabot", diff --git a/src/index.js b/src/index.js index 2b4e164..343b899 100644 --- a/src/index.js +++ b/src/index.js @@ -39,6 +39,7 @@ export default class Polakbot { }) }, (err, all) => { if (err) console.error(err) + console.log() if (all.length === 0) { console.log('Polkabot does not do much without plugin, make sure you install at least one') } }) } diff --git a/src/lib/plugin-loader.js b/src/lib/plugin-loader.js index cf50271..4663f9d 100644 --- a/src/lib/plugin-loader.js +++ b/src/lib/plugin-loader.js @@ -1,3 +1,4 @@ +var path = require('path') export default class PluginLoader { constructor (plugin) { @@ -5,7 +6,10 @@ export default class PluginLoader { } load (cb) { - console.log('loading plugin: ' + this.plugin.name) - cb(require(this.plugin.path)) + const plugin = require(this.plugin.path) + const pkg = require(path.join(this.plugin.path, 'package.json')) + console.log(` - ${pkg.name} version ${pkg.version} from ${pkg.author.name || pkg.author}`) + // console.log(` - path: ${this.plugin.path}`) + cb(plugin) } } diff --git a/src/polkabot b/src/polkabot.js similarity index 100% rename from src/polkabot rename to src/polkabot.js -- GitLab