diff --git a/package-lock.json b/package-lock.json index 1ac4ab46f..b26c78368 100644 --- a/package-lock.json +++ b/package-lock.json @@ -352,9 +352,9 @@ } }, "app-root-path": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.0.1.tgz", - "integrity": "sha1-zWLc+OT9WkF+/GZNLlsQZTxlG0Y=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.1.0.tgz", + "integrity": "sha1-mL9lmTJ+zqGZMJhm6BQDaP0uZGo=" }, "aproba": { "version": "1.2.0", @@ -1737,17 +1737,22 @@ "resolved": "https://registry.npmjs.org/babel-plugin-transform-runtime/-/babel-plugin-transform-runtime-6.23.0.tgz", "integrity": "sha1-iEkNRGUC6puOfvsP4J7E2ZR5se4=", "requires": { - "babel-runtime": "6.23.0" + "babel-runtime": "^6.22.0" }, "dependencies": { "babel-runtime": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.23.0.tgz", - "integrity": "sha1-CpSJ8UTecO+zzkMArM2zKeL8VDs=", + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "requires": { - "core-js": "2.4.1", - "regenerator-runtime": "0.10.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" } } }, @@ -2025,7 +2030,7 @@ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", "requires": { - "pako": "0.2.9" + "pako": "~0.2.0" } }, "buffer-crc32": { @@ -2033,6 +2038,11 @@ "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, "buffer-shims": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", @@ -2360,9 +2370,9 @@ "dev": true }, "cookiejar": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.0.tgz", - "integrity": "sha1-hlSWiVObbQ4mm2Y3owS+UIGU2Jg=" + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" }, "copy-descriptor": { "version": "0.1.1", @@ -3223,14 +3233,14 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, "duplexify": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", - "integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", "requires": { - "end-of-stream": "1.0.0", - "inherits": "2.0.3", - "readable-stream": "2.2.2", - "stream-shift": "1.0.0" + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" } }, "ecc-jsbn": { @@ -4011,6 +4021,11 @@ "mime-types": "2.1.13" } }, + "formidable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", + "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==" + }, "fs-extra": { "version": "0.30.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", @@ -5168,16 +5183,16 @@ "dev": true }, "gunzip-maybe": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/gunzip-maybe/-/gunzip-maybe-1.4.0.tgz", - "integrity": "sha1-fYMWyNBXHh0IpaeeRv/wr+gXKxk=", - "requires": { - "browserify-zlib": "0.1.4", - "is-deflate": "1.0.0", - "is-gzip": "1.0.0", - "peek-stream": "1.1.2", - "pumpify": "1.3.5", - "through2": "2.0.3" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/gunzip-maybe/-/gunzip-maybe-1.4.1.tgz", + "integrity": "sha512-qtutIKMthNJJgeHQS7kZ9FqDq59/Wn0G2HYCRNjpup7yKfVI6/eqwpmroyZGFoCYaG+sW6psNVb4zoLADHpp2g==", + "requires": { + "browserify-zlib": "^0.1.4", + "is-deflate": "^1.0.0", + "is-gzip": "^1.0.0", + "peek-stream": "^1.1.0", + "pumpify": "^1.3.3", + "through2": "^2.0.3" } }, "h5.buffers": { @@ -6666,9 +6681,9 @@ } }, "mime": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { "version": "1.25.0", @@ -7580,123 +7595,105 @@ } }, "particle-commands": { - "version": "0.2.11", - "resolved": "https://registry.npmjs.org/particle-commands/-/particle-commands-0.2.11.tgz", - "integrity": "sha1-uGsPY2svEgubbaT8sXjMGJSrb8U=", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/particle-commands/-/particle-commands-0.3.0.tgz", + "integrity": "sha512-GoWrECPCUky2W4IDgT3pOeB5M7i5KdMwJr1LlkD6MxZsHZwQaTNu+ogdyoWvmBwDduePuFLdsADHuWXwN5ZgyQ==", "requires": { - "babel-runtime": "6.20.0", - "es6-promisify": "4.1.0", - "mkdirp": "0.5.1", - "particle-api-js": "6.6.2", - "particle-library-manager": "0.1.12", - "semver": "5.5.0", - "underscore": "1.8.3", - "when": "3.7.8", - "winreg": "1.2.3", - "yeoman-environment": "1.6.6", - "yeoman-generator": "1.1.1" + "babel-runtime": "^6.9.2", + "es6-promisify": "^4.1.0", + "mkdirp": "^0.5.1", + "particle-api-js": "^6.5.0", + "particle-library-manager": "^0.1.13", + "semver": "^5.1.0", + "underscore": "^1.8.3", + "when": "^3.7.2", + "winreg": "^1.2.2", + "yeoman-environment": "^1.6.6", + "yeoman-generator": "^1.1.1" } }, "particle-library-manager": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/particle-library-manager/-/particle-library-manager-0.1.12.tgz", - "integrity": "sha1-+SlNxgZrYLWm2amBJLZzBznDh4o=", - "requires": { - "app-root-path": "2.0.1", - "async": "2.3.0", - "babel-plugin-array-includes": "2.0.3", - "babel-plugin-transform-runtime": "6.23.0", - "babel-runtime": "6.20.0", - "es6-promisify": "5.0.0", - "fs-extra": "2.1.2", - "gunzip-maybe": "1.4.0", - "klaw": "1.3.1", - "minimatch": "3.0.3", - "mkdirp": "0.5.1", - "particle-api-js": "6.6.2", - "properties-parser": "0.3.1", - "semver": "5.5.0", - "superagent": "3.5.2", + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/particle-library-manager/-/particle-library-manager-0.1.13.tgz", + "integrity": "sha512-NMd7IKb/QiCK5X40eVQmQhowJIzaEXGLwZ8I1cU6sQiufkWYchYbyLEH9KdE6vE3Az2Ipf9WI4NiKTi/Bui6jQ==", + "requires": { + "app-root-path": "^2.0.1", + "async": "^2.0.0-rc.4", + "babel-plugin-array-includes": "^2.0.3", + "babel-plugin-transform-runtime": "^6.9.0", + "babel-runtime": "^6.9.2", + "es6-promisify": "^5.0.0", + "fs-extra": "^2.0.0", + "gunzip-maybe": "^1.3.1", + "klaw": "^1.3.1", + "minimatch": "^3.0.3", + "mkdirp": "^0.5.1", + "particle-api-js": "^6.4.1", + "properties-parser": "^0.3.1", + "semver": "^5.1.0", + "superagent": "^3.4.1", "superagent-prefix": "0.0.2", - "tar-fs": "1.15.2", - "tar-stream": "1.5.2", + "tar-fs": "^1.13.2", + "tar-stream": "^1.5.2", "tmp": "0.0.31", "verror": "^1.6.1" }, "dependencies": { "async": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.3.0.tgz", - "integrity": "sha1-EBPRBRBH3TIP4k5JTVxm7K9hR9k=", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "requires": { - "lodash": "4.17.4" + "lodash": "^4.17.10" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "es6-promise": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.1.0.tgz", - "integrity": "sha1-3aA8qPn4m8WX5omEKSnee6jOvfA=" + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==" }, "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "requires": { - "es6-promise": "4.1.0" - } - }, - "form-data": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", - "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", - "requires": { - "asynckit": "0.4.0", - "combined-stream": "1.0.5", - "mime-types": "2.1.13" + "es6-promise": "^4.0.3" } }, - "formidable": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", - "integrity": "sha1-lriIb3w8NQi5Mta9cMTTqI818ak=" - }, "fs-extra": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-2.1.2.tgz", "integrity": "sha1-BGxwFjzvmq1GsOSn+kZ/si1x3jU=", "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0" } }, "lodash": { - "version": "4.17.4", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, "minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", - "requires": { - "brace-expansion": "1.1.6" - } - }, - "superagent": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.5.2.tgz", - "integrity": "sha1-M2GjlxVnUEw1EGOr6q4PqiPb8/g=", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "requires": { - "component-emitter": "1.2.1", - "cookiejar": "2.1.0", - "debug": "2.6.0", - "extend": "3.0.0", - "form-data": "2.1.4", - "formidable": "1.1.1", - "methods": "1.1.2", - "mime": "1.3.4", - "qs": "6.3.0", - "readable-stream": "2.2.2" + "brace-expansion": "^1.1.7" } }, "tmp": { @@ -7704,7 +7701,7 @@ "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.1" } } } @@ -7756,12 +7753,13 @@ } }, "peek-stream": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/peek-stream/-/peek-stream-1.1.2.tgz", - "integrity": "sha1-l+t2NlvP2MieKH9VyLadTD6bzFI=", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/peek-stream/-/peek-stream-1.1.3.tgz", + "integrity": "sha512-FhJ+YbOSBb9/rIl2ZeE/QHEsWn7PqNYt8ARAY3kIgNGOk13g9FGyIY6JIl/xB/3TFRVoTv5as0l11weORrTekA==", "requires": { - "duplexify": "3.5.0", - "through2": "2.0.3" + "buffer-from": "^1.0.0", + "duplexify": "^3.5.0", + "through2": "^2.0.3" } }, "pify": { @@ -8110,7 +8108,7 @@ "resolved": "https://registry.npmjs.org/properties-parser/-/properties-parser-0.3.1.tgz", "integrity": "sha1-ExbpU5/7/ZOEXjabIRAiq9R4dxo=", "requires": { - "string.prototype.codepointat": "0.2.0" + "string.prototype.codepointat": "^0.2.0" } }, "proxyquire": { @@ -8157,13 +8155,32 @@ } }, "pumpify": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.3.5.tgz", - "integrity": "sha1-G2ccYZlAq8rqwK0OOjwWS+dgmTs=", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "requires": { - "duplexify": "3.5.0", - "inherits": "2.0.3", - "pump": "1.0.2" + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } } }, "punycode": { @@ -8172,9 +8189,9 @@ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, "qs": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.0.tgz", - "integrity": "sha1-9AOyZPI7wBIox0ExtAfxjV6l1EI=" + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "radio-symbol": { "version": "2.0.0", @@ -9210,9 +9227,9 @@ } }, "string.prototype.codepointat": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.0.tgz", - "integrity": "sha1-aybpvTr8qnvjtCabUm3huCAArHg=" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz", + "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==" }, "string_decoder": { "version": "0.10.31", @@ -9264,6 +9281,83 @@ "resolved": "https://registry.npmjs.org/success-symbol/-/success-symbol-0.1.0.tgz", "integrity": "sha1-JAIuSG878c3KCUKDt2nEctO3KJc=" }, + "superagent": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.3.5" + }, + "dependencies": { + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, "superagent-prefix": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/superagent-prefix/-/superagent-prefix-0.0.2.tgz", @@ -9681,9 +9775,9 @@ } }, "winreg": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz", - "integrity": "sha1-k60RayaW2ofVj3JlqPzqUlSpZdU=" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.4.tgz", + "integrity": "sha1-ugZWKbepJRMOFXeRCM9UCZDpjRs=" }, "wiring-preprocessor": { "version": "1.0.1", diff --git a/package.json b/package.json index f24b1bdd8..bf68e7585 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ "moment": "^2.9.0", "node-wifiscanner2": "^1.2.0", "particle-api-js": "^6.4.1", - "particle-commands": "0.2.11", - "particle-library-manager": "0.1.12", + "particle-commands": "0.3.0", + "particle-library-manager": "0.1.13", "request": "https://github.com/particle-iot/request/releases/download/v2.75.1-relativepath.1/request-2.75.1-relativepath.1.tgz", "safe-buffer": "^5.1.1", "semver": "^5.1.0", diff --git a/src/app/command-processor.js b/src/app/command-processor.js index f6d719068..4b26cb8d3 100644 --- a/src/app/command-processor.js +++ b/src/app/command-processor.js @@ -109,6 +109,7 @@ class CLICommandItem { configure(yargs, { options, setup, examples, version, epilogue }=this.buildOptions()) { if (options) { this.fetchAliases(options); + this.configureOptions(options); // avoid converting positional arguments to numbers by default const optionsWithDefaults = Object.assign({ '_': { string: true } }, options); yargs.options(optionsWithDefaults); @@ -146,6 +147,26 @@ class CLICommandItem { }); } + configureOptions(options) { + Object.keys(options).forEach((key) => { + const option = options[key]; + if (!option.hasOwnProperty('nargs') && + !option.boolean && + !option.count && + !option.array) { + option.nargs = 1; + } + + if (!option.hasOwnProperty('number') && + !option.hasOwnProperty('boolean') && + !option.hasOwnProperty('string') && + !option.hasOwnProperty('count') && + !option.hasOwnProperty('array')) { + option.string = true; + } + }); + } + /** * Finds the original name of an option given a possible alias. * @param {string} name The option name to unalias. @@ -428,7 +449,7 @@ function consoleErrorLogger(console, yargs, exit, err) { // Adapted from: https://github.com/bcoe/yargs/blob/master/lib/validation.js#L83-L110 function checkForUnknownArguments(yargs, argv, command) { const aliasLookup = {}; - const descriptions = yargs.getUsageInstance().getDescriptions(); + const flags = yargs.getOptions().key; const demanded = yargs.getDemanded(); const unknown = []; @@ -440,8 +461,8 @@ function checkForUnknownArguments(yargs, argv, command) { function isUnknown(key) { return (key !== '$0' && key !== '_' && key !== 'params' && - !descriptions.hasOwnProperty(key) && !demanded.hasOwnProperty(key) && + !flags.hasOwnProperty(key) && !aliasLookup.hasOwnProperty('no-' + key) && !aliasLookup.hasOwnProperty(key)); } diff --git a/src/cli/cloud.js b/src/cli/cloud.js index ba35fe9a1..ca5279574 100644 --- a/src/cli/cloud.js +++ b/src/cli/cloud.js @@ -3,8 +3,7 @@ export default ({ commandProcessor, root }) => { const compileOptions = { 'target': { - description: 'The firmware version to compile against. Defaults to latest version, or version on device for cellular.', - nargs: 1 + description: 'The firmware version to compile against. Defaults to latest version, or version on device for cellular.' } }; @@ -80,8 +79,7 @@ export default ({ commandProcessor, root }) => { params: ' [files...]', options: Object.assign({}, compileOptions, { 'saveTo': { - description: 'Filename for the compiled binary', - nargs: 1 + description: 'Filename for the compiled binary' } }), handler: (args) => { @@ -113,22 +111,18 @@ export default ({ commandProcessor, root }) => { options: { u: { description: 'your username', - alias: 'username', - nargs: 1 + alias: 'username' }, p: { description: 'your password', - alias: 'password', - nargs: 1 + alias: 'password' }, t: { description: 'an existing Particle access token to use', - alias: 'token', - nargs: 1 + alias: 'token' }, otp: { - description: 'the login code if two-step authentication is enabled', - nargs: 1 + description: 'the login code if two-step authentication is enabled' } }, handler: (args) => { diff --git a/src/cli/config.js b/src/cli/config.js index d1463fc92..b5c4ba281 100644 --- a/src/cli/config.js +++ b/src/cli/config.js @@ -3,6 +3,7 @@ export default ({ commandProcessor, root }) => { params: '[profile] [setting] [value]', options: { 'list': { + boolean: true, description: 'Display available configurations' } }, diff --git a/src/cli/flash.js b/src/cli/flash.js index c8995e0ab..5b2679a36 100644 --- a/src/cli/flash.js +++ b/src/cli/flash.js @@ -27,12 +27,10 @@ export default ({ commandProcessor, root }) => { description: 'Answer yes to all questions' }, 'target': { - description: 'The firmware version to compile against. Defaults to latest version, or version on device for cellular.', - nargs: 1 + description: 'The firmware version to compile against. Defaults to latest version, or version on device for cellular.' }, 'port': { - describe: 'Use this serial port instead of auto-detecting. Useful if there are more than 1 connected device. Only available for serial', - nargs: 1 + describe: 'Use this serial port instead of auto-detecting. Useful if there are more than 1 connected device. Only available for serial' } }, handler: (args) => { diff --git a/src/cli/keys.js b/src/cli/keys.js index 6f3a1ae72..0c8b6aeec 100644 --- a/src/cli/keys.js +++ b/src/cli/keys.js @@ -3,8 +3,7 @@ export default ({ commandProcessor, root }) => { const protocolOption = { 'protocol': { - description: 'Communication protocol for the device using the key. tcp or udp', - nargs: 1 + description: 'Communication protocol for the device using the key. tcp or udp' } }; @@ -45,8 +44,7 @@ export default ({ commandProcessor, root }) => { options: { 'product_id': { number: true, - description: 'The product ID to use when provisioning a new device', - nargs: 1 + description: 'The product ID to use when provisioning a new device' } }, handler: (args) => { @@ -69,12 +67,11 @@ export default ({ commandProcessor, root }) => { params: '[filename]', options: Object.assign({}, protocolOption, { 'host': { - description: 'Hostname or IP address of the server to add to the key', - nargs: 1 + description: 'Hostname or IP address of the server to add to the key' }, 'port': { - description: 'Port number of the server to add to the key', - nargs: 1 + number: true, + description: 'Port number of the server to add to the key' } }), handler: (args) => { diff --git a/src/cli/library.js b/src/cli/library.js index eb10ddd9c..30ffaf5fa 100644 --- a/src/cli/library.js +++ b/src/cli/library.js @@ -16,7 +16,6 @@ export default ({ commandProcessor, root }) => { const lib = commandProcessor.createCategory(root, 'library', 'Manage firmware libraries', { alias: 'libraries' }); commandProcessor.createCommand(lib, 'add', 'Add a library to the current project.', { - options: {}, params: '', handler: (...args) => require('./library_add').command(api(), ...args), examples: { @@ -27,16 +26,13 @@ export default ({ commandProcessor, root }) => { commandProcessor.createCommand(lib, 'create', 'Create a new library in the specified or current directory', { options: { 'name': { - description: 'The name of the library to create.', - nargs: 1 + description: 'The name of the library to create.' }, 'version': { - description: 'The initial version of the library to create.', - nargs: 1 + description: 'The initial version of the library to create.' }, 'author': { - description: 'The author of the library.', - nargs: 1 + description: 'The author of the library.' } }, handler: (...args) => require('./library_init').command(...args) @@ -58,7 +54,6 @@ export default ({ commandProcessor, root }) => { alias: 'y' }, 'dest': { - boolean: false, description: 'the directory to install to' } }, @@ -74,20 +69,19 @@ export default ({ commandProcessor, root }) => { commandProcessor.createCommand(lib, 'list', 'List libraries available', { options: { 'filter': { - description: 'filters libraries not matching the text', - nargs: 1 + description: 'filters libraries not matching the text' }, 'non-interactive': { boolean: true, description: 'Prints a single page of libraries without prompting' }, 'page': { - description: 'Start the listing at the given page number', - nargs: 1 + number: true, + description: 'Start the listing at the given page number' }, 'limit': { - description: 'The number of items to show per page', - nargs: 1 + number: true, + description: 'The number of items to show per page' } }, params: '[sections...]', @@ -128,7 +122,6 @@ export default ({ commandProcessor, root }) => { }); commandProcessor.createCommand(lib, 'publish', 'Publish a private library, making it public', { - options: {}, params: '[name]', handler: (...args) => require('./library_publish').command(api(), ...args) }); diff --git a/src/cli/project.js b/src/cli/project.js index bd1570d97..94764daa4 100644 --- a/src/cli/project.js +++ b/src/cli/project.js @@ -6,8 +6,7 @@ export default ({ commandProcessor, root }) => { commandProcessor.createCommand(project, 'create', 'Create a new project in the current or specified directory', { options: { 'name' : { - description: 'provide a name for the project', - nargs: 1 + description: 'provide a name for the project' } }, params: '[dir]', diff --git a/src/cli/serial.js b/src/cli/serial.js index 52262e655..1706b3dd4 100644 --- a/src/cli/serial.js +++ b/src/cli/serial.js @@ -5,8 +5,7 @@ export default ({ commandProcessor, root }) => { const portOption = { 'port': { - describe: 'Use this serial port instead of auto-detecting. Useful if there are more than 1 connected device', - nargs: 1 + describe: 'Use this serial port instead of auto-detecting. Useful if there are more than 1 connected device' } }; @@ -41,8 +40,7 @@ export default ({ commandProcessor, root }) => { commandProcessor.createCommand(serial, 'wifi', 'Configure Wi-Fi credentials over serial', { options: Object.assign({ 'file': { - description: 'Take the credentials from a JSON file instead of prompting for them', - nargs: 1 + description: 'Take the credentials from a JSON file instead of prompting for them' } }, portOption), handler: (args) => { diff --git a/src/cli/subscribe.js b/src/cli/subscribe.js index 219d49f0f..a42579799 100644 --- a/src/cli/subscribe.js +++ b/src/cli/subscribe.js @@ -7,8 +7,7 @@ export default ({ commandProcessor, root }) => { description: 'Listen to all events instead of just those from my devices' }, 'device': { - describe: 'Listen to events from this device only', - nargs: 1 + describe: 'Listen to events from this device only' } }, handler: (args) => { diff --git a/test/app/command-processor.spec.js b/test/app/command-processor.spec.js index 807861ac9..5ebed650f 100644 --- a/test/app/command-processor.spec.js +++ b/test/app/command-processor.spec.js @@ -167,7 +167,7 @@ describe('command-line parsing', () => { it('can accept options', () => { // see '.choices()` https://www.npmjs.com/package/yargs const app = commandProcessor.createAppCategory({ options: { - cm: { alias: 'chundermonkey' } + cm: { alias: 'chundermonkey', boolean: true } }}); expect(commandProcessor.parse(app, ['--cm'])).to.have.property('cm').equal(true); @@ -177,10 +177,10 @@ describe('command-line parsing', () => { it('refuses options meant for other commands', () => { const app = commandProcessor.createAppCategory(); const one = commandProcessor.createCommand(app, 'one', 'first', { options: { - one: { alias: '1', description: ''} + one: { alias: '1', description: '', boolean: true } }}); const two = commandProcessor.createCommand(app, 'two', 'second', { options: { - two: { alias: '2', description: ''} + two: { alias: '2', description: '', boolean: true } }}); // sanity test @@ -203,6 +203,17 @@ describe('command-line parsing', () => { test: { alias: 'flag', boolean: true + }, + string: { + }, + multipleStrings: { + nargs: 2 + }, + number: { + number: true, + }, + count: { + count: true } } }); @@ -312,6 +323,30 @@ describe('command-line parsing', () => { .deep.equal(commandProcessor.errors.unknownParametersError(['stragglers', 'here'])); }); + it('flags default to strings', () => { + const result = paramsCommand('', ['--string', '42']); + expect(result).to.have.property('string').equal('42'); + }); + + it('flags require one argument by default', () => { + expect(() => paramsCommand('', ['--string'])).to.throw(/Not enough arguments following: string/); + }); + + it('flags can require multiple arguments', () => { + const result = paramsCommand('', ['--multipleStrings', '1', '2']); + expect(result).to.have.property('multipleStrings').deep.equal(['1', '2']); + }); + + it('number flag get converted', () => { + const result = paramsCommand('', ['--number', '42']); + expect(result).to.have.property('number').equal(42); + }); + + it('count flag get counted', () => { + const result = paramsCommand('', ['--count', '--count']); + expect(result).to.have.property('count').equal(2); + }); + it('keeps device ids as strings', () => { const result = paramsCommand('', ['500000000000000000000000']).params; expect(result).to.have.property('deviceid').equal('500000000000000000000000');