diff --git a/.travis.yml b/.travis.yml index 8ad81a111..e74b918da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,9 @@ language: node_js +env: + global: + - FORCE_COLOR=1 + node_js: - '8' - '6' diff --git a/package-lock.json b/package-lock.json index b9f9f7a8f..f0fd5acb2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,225 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@commitlint/cli": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-7.1.2.tgz", + "integrity": "sha512-Dck7MqJCzrATYm4UqIKPdJvLVUuVZcpFw9KicrLw+a9YNIjsaXG9XojgPomTxFBNJZabAYBqKWkqNoFLrFA77w==", + "requires": { + "@commitlint/format": "^7.1.2", + "@commitlint/lint": "^7.1.2", + "@commitlint/load": "^7.1.2", + "@commitlint/read": "^7.1.2", + "babel-polyfill": "6.26.0", + "chalk": "2.3.1", + "get-stdin": "5.0.1", + "lodash.merge": "4.6.1", + "lodash.pick": "4.4.0", + "meow": "5.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.3.1", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", + "requires": { + "ansi-styles": "^3.2.0", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.2.0" + } + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "requires": { + "camelcase": "^4.1.0" + } + } + } + }, + "@commitlint/config-conventional": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-7.1.2.tgz", + "integrity": "sha512-DmA4ixkpv03qA1TVs1Bl25QsVym2bPL6pKapesALWIVggG3OpwqGZ55vN75Tx8xZoG7LFKrVyrt7kwhA7X8njQ==" + }, + "@commitlint/ensure": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-7.1.2.tgz", + "integrity": "sha512-F0U4UEMgB5lnscgiZtuUolFkQ/dRD4RzXs8KgCik2D0wL3fUXSB5hmfbrbMF9ERseVQCHsxCHWm7bKzxKmXgIA==", + "requires": { + "lodash.camelcase": "4.3.0", + "lodash.kebabcase": "4.1.1", + "lodash.snakecase": "4.1.1", + "lodash.startcase": "4.4.0", + "lodash.upperfirst": "4.3.1" + } + }, + "@commitlint/execute-rule": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-7.1.2.tgz", + "integrity": "sha512-EP/SqX2U2L4AQHglZ2vGM1pvHJOh3sbYtHn1QhtllqEpsdmhuNpVPSGHP/r9OD2h4i90vtnWgZQoskt2MkbknA==", + "requires": { + "babel-runtime": "6.26.0" + } + }, + "@commitlint/format": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-7.1.2.tgz", + "integrity": "sha512-l+eQChtIeNOddi4t5p+T9ViFXQMMFWIbzKh708YCI8BoByhqedhLsEhEn1nzGq1cVYT2AdGRhY8ed6/Nc5z85w==", + "requires": { + "babel-runtime": "^6.23.0", + "chalk": "^2.0.1" + } + }, + "@commitlint/is-ignored": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-7.1.2.tgz", + "integrity": "sha512-29SHreGSAKxOTtIdG1swo9E14E8KZbyE0Y1u0wz9iKjb6i0m7ahZW0l4Ty+j3pACiYDOOXDW1BWSOFaBwwKlxQ==", + "requires": { + "semver": "5.5.0" + } + }, + "@commitlint/lint": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-7.1.2.tgz", + "integrity": "sha512-HCkMlnUZD4yVnGDHcJQN/PkJRQpKgsiLojUaUHE8b1YjWW+qviolizbZjcqs/nimzCWlAkaU5KPs+3pzGBfVug==", + "requires": { + "@commitlint/is-ignored": "^7.1.2", + "@commitlint/parse": "^7.1.2", + "@commitlint/rules": "^7.1.2", + "babel-runtime": "^6.23.0", + "lodash.topairs": "4.3.0" + } + }, + "@commitlint/load": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-7.1.2.tgz", + "integrity": "sha512-BEQ9k3iZjB1NDAblmB88WU+256p8xHCWYuqZmJOerx6Upbam7XrpDTurMOKFUxk8tZU9OBqHQtBapX8UxJWi9A==", + "requires": { + "@commitlint/execute-rule": "^7.1.2", + "@commitlint/resolve-extends": "^7.1.2", + "babel-runtime": "^6.23.0", + "cosmiconfig": "^4.0.0", + "lodash.merge": "4.6.1", + "lodash.mergewith": "4.6.1", + "lodash.pick": "4.4.0", + "lodash.topairs": "4.3.0", + "resolve-from": "4.0.0" + }, + "dependencies": { + "cosmiconfig": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-4.0.0.tgz", + "integrity": "sha512-6e5vDdrXZD+t5v0L8CrurPeybg4Fmf+FCSYxXKYVAqLUtyCSbuyqE059d0kDthTNRzKVjL7QMgNpEUlsoYH3iQ==", + "requires": { + "is-directory": "^0.3.1", + "js-yaml": "^3.9.0", + "parse-json": "^4.0.0", + "require-from-string": "^2.0.1" + } + } + } + }, + "@commitlint/message": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-7.1.2.tgz", + "integrity": "sha512-6FQeK5LAs1Bde6W/jULg+I/XZhj3gbqCWlS2Q11A2JbaTRpRJZzm7WdD9nK3I0+De41EOqW2t4mBnrpio3o1Zg==" + }, + "@commitlint/parse": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-7.1.2.tgz", + "integrity": "sha512-wrdLwJZL3cs89MfgPtnbbKByijUo3Wrug55aTke5k/F0XNxGaDaNJyH4QXgidgXk57r2t4NJVAKwjnY4wjfNwg==", + "requires": { + "conventional-changelog-angular": "^1.3.3", + "conventional-commits-parser": "^2.1.0" + }, + "dependencies": { + "conventional-changelog-angular": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-1.6.6.tgz", + "integrity": "sha512-suQnFSqCxRwyBxY68pYTsFkG0taIdinHLNEAX5ivtw8bCRnIgnpvcHmlR/yjUyZIrNPYAoXlY1WiEKWgSE4BNg==", + "requires": { + "compare-func": "^1.3.1", + "q": "^1.5.1" + } + } + } + }, + "@commitlint/read": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-7.1.2.tgz", + "integrity": "sha512-sarYQgfTay2Eu7onHz53EYyRw7pI5QmLE7tP5Ri9op6eu4LadjSoA/4dfc+VE7avsq21J2ewSbz+9f0uvhDxgg==", + "requires": { + "@commitlint/top-level": "^7.1.2", + "@marionebl/sander": "^0.6.0", + "babel-runtime": "^6.23.0", + "git-raw-commits": "^1.3.0" + } + }, + "@commitlint/resolve-extends": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-7.1.2.tgz", + "integrity": "sha512-zwbifMB9DeHP4sYQdrkx+XJh5Q1lyP/OdlErUCC34NV4Lkxw/XxXF4St3e+y1X28/SgrEc2XSOS6n/vQQfUlLA==", + "requires": { + "babel-runtime": "6.26.0", + "lodash.merge": "4.6.1", + "lodash.omit": "4.5.0", + "require-uncached": "^1.0.3", + "resolve-from": "^4.0.0", + "resolve-global": "^0.1.0" + } + }, + "@commitlint/rules": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-7.1.2.tgz", + "integrity": "sha512-O9fONZXiJ6NN2mfy+enHmeTzBHcfDVVYjxTdBJFp99yUSvVyHaD+jc2r795gcMv3oP5594BDXSKcD/3yb8sLzA==", + "requires": { + "@commitlint/ensure": "^7.1.2", + "@commitlint/message": "^7.1.2", + "@commitlint/to-lines": "^7.1.2", + "babel-runtime": "^6.23.0" + } + }, + "@commitlint/to-lines": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-7.1.2.tgz", + "integrity": "sha512-Nz3qZwrIEYiN9v/ThJqXAwu4X5+hvT9H8yRPHfjc538R8WhwEfhvym7/4YznDHSvWrQgwqtNPdrb6b2OSBsHmg==" + }, + "@commitlint/top-level": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-7.1.2.tgz", + "integrity": "sha512-YKugOAKy3hgM/ITezPp7Ns51U3xoJfuOsVnMGW4oDcHLhuQ/Qd58ROv/Hgedtk8HugKX3DdZ8XoEnRG70RDGqQ==", + "requires": { + "find-up": "^2.1.0" + } + }, + "@marionebl/sander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/@marionebl/sander/-/sander-0.6.1.tgz", + "integrity": "sha1-GViWWHTyS8Ub5Ih1/rUNZC/EH3s=", + "requires": { + "graceful-fs": "^4.1.3", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.2" + } + }, "@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -30,6 +249,15 @@ "url-template": "^2.0.8" } }, + "@phenomnomnominal/tsquery": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@phenomnomnominal/tsquery/-/tsquery-2.0.1.tgz", + "integrity": "sha512-dgsEKwoTon4N/INO8otlInEVed8fsSwBuHnwEloQY121n9Gttf2BQG+vUP3Es+jlKJfsGPUcQG+ZC4Bby9BS0Q==", + "dev": true, + "requires": { + "esquery": "^1.0.1" + } + }, "@semantic-release/commit-analyzer": { "version": "5.0.3", "resolved": "https://registry.npmjs.org/@semantic-release/commit-analyzer/-/commit-analyzer-5.0.3.tgz", @@ -149,19 +377,34 @@ "lodash": "^4.17.4" } }, + "@sinonjs/commons": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.0.2.tgz", + "integrity": "sha512-WR3dlgqJP4QNrLC4iXN/5/2WaLQQ0VijOOkmflqFGVJ6wLEpbSjo7c0ZeGIdtY8Crk7xBBp87sM6+Mkerz7alw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, "@sinonjs/formatio": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", "dev": true, "requires": { "samsam": "1.3.0" } }, + "@sinonjs/samsam": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-2.0.0.tgz", + "integrity": "sha512-D7VxhADdZbDJ0HjUTMnSQ5xIGb4H2yWpg8k9Sf1T08zfFiQYlaxM8LZydpR4FQ2E6LZJX8IlabNZ5io4vdChwg==", + "dev": true + }, "@sourcegraph/prettierrc": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@sourcegraph/prettierrc/-/prettierrc-2.1.1.tgz", - "integrity": "sha512-p02LPFLOhr0JRsBwtCqNC+9AoSAKjNsW96zdfPjkn4lA+3H/0nHBtjUkoSPTuVh8FXZ56sAB2JkhH9RIZ5YiuA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@sourcegraph/prettierrc/-/prettierrc-2.2.0.tgz", + "integrity": "sha512-kRdHxdAppxYnN7qAQjNTyuG05pjYHFtEUquZauXVXBeaGB4sye3uSkb8wgi34jeaUHG/gWp2f5hQgCCBMizjjA==", "dev": true }, "@sourcegraph/tsconfig": { @@ -171,20 +414,20 @@ "dev": true }, "@sourcegraph/tslint-config": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/@sourcegraph/tslint-config/-/tslint-config-11.0.1.tgz", - "integrity": "sha512-HeeLEpVXxL9e+7FzYBUzrvj5/mC1l+vTpT3vcQ599pmN187gQnvQ9UO4o6ux7a6PnoeMar2q+RORgFtjPUN69g==", + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/@sourcegraph/tslint-config/-/tslint-config-12.0.0.tgz", + "integrity": "sha512-LqDM5n/oE7yQxwEbD24RKauUArsgYsTL8jwagh3+YFoleh5tA22DpooSKYmNJRDQX0aTVSeiE/J23YzuX3V0MQ==", "dev": true, "requires": { - "rxjs-tslint-rules": "^3.3.0", + "rxjs-tslint-rules": "^4.2.0", "tslint-config-prettier": "^1.6.0", "tslint-react": "^3.2.0" } }, "@types/chai": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.0.6.tgz", - "integrity": "sha512-IzRWv/7IpaMm41KLLJcaaD/UKit/MrHu4rWs61oWiVjuk4aKWe2eopx3XyhAHhSnMyB5EeCMRr2AsJtuQ8COWA==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.4.tgz", + "integrity": "sha512-h6+VEw2Vr3ORiFCyyJmcho2zALnUq9cvdB/IO8Xs9itrJVCenC7o26A6+m7D0ihTTr65eS259H5/Ghl/VjYs6g==", "dev": true }, "@types/chai-as-promised": { @@ -214,9 +457,9 @@ } }, "@types/lodash": { - "version": "4.14.108", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.108.tgz", - "integrity": "sha512-WD2vUOKfBBVHxWUV9iMR9RMfpuf8HquxWeAq2yqGVL7Nc4JW2+sQama0pREMqzNI3Tutj0PyxYUJwuoxxvX+xA==", + "version": "4.14.116", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.116.tgz", + "integrity": "sha512-lRnAtKnxMXcYYXqOiotTmJd74uawNWuPnsnPrrO7HiFuE3npE2iQhfABatbYDyxTNqZNuXzcKGhw37R7RjBFLg==", "dev": true }, "@types/minimatch": { @@ -226,15 +469,15 @@ "dev": true }, "@types/mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-YeDiSEzznwZwwp766SJ6QlrTyBYUGPSIwmREHVTmktUYiT/WADdWtpt9iH0KuUSf8lZLdI4lP0X6PBzPo5//JQ==", + "version": "5.2.5", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.5.tgz", + "integrity": "sha512-lAVp+Kj54ui/vLUFxsJTMtWvZraZxum3w3Nwkble2dNuV5VnPA+Mi2oGX9XYJAaIvZi3tn3cbjS/qcJXRb6Bww==", "dev": true }, "@types/mz": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/@types/mz/-/mz-0.0.31.tgz", - "integrity": "sha1-pNgMCC/v5x5Ap8DwfR5lVbu8e1I=", + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/mz/-/mz-0.0.32.tgz", + "integrity": "sha512-cy3yebKhrHuOcrJGkfwNHhpTXQLgmXSv1BX+4p32j+VUQ6aP2eJ5cL7OvGcAQx75fCTFaAIIAKewvqL+iwSd4g==", "dev": true, "requires": { "@types/node": "*" @@ -281,7 +524,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.2.tgz", "integrity": "sha1-wQI3G27Dp887hHygDCC7D85Mbeo=", - "dev": true, "requires": { "jsonparse": "^1.2.0", "through": ">=2.2.7 <3" @@ -311,6 +553,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -363,7 +606,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -398,14 +640,12 @@ "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", - "dev": true + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=" }, "array-ify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", - "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=", - "dev": true + "integrity": "sha1-nlKHYrSpBmrRY6aWKjZEGOlibs4=" }, "array-union": { "version": "1.0.2", @@ -431,8 +671,7 @@ "arrify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "assertion-error": { "version": "1.1.0", @@ -495,6 +734,32 @@ } } }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "requires": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + } + } + }, + "babel-runtime": { + "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.0", + "regenerator-runtime": "^0.11.0" + } + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -630,8 +895,7 @@ "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", - "dev": true + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" }, "cache-base": { "version": "1.0.1", @@ -682,17 +946,28 @@ "stack-trace": "~0.0.7" } }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=" + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", - "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", - "dev": true + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" }, "camelcase-keys": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", - "dev": true, "requires": { "camelcase": "^4.1.0", "map-obj": "^2.0.0", @@ -970,7 +1245,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.2.tgz", "integrity": "sha1-md0LpFfh+bxyKxLAjsM+6rMfpkg=", - "dev": true, "requires": { "array-ify": "^1.0.0", "dot-prop": "^3.0.0" @@ -1047,7 +1321,6 @@ "version": "2.1.7", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-2.1.7.tgz", "integrity": "sha512-BoMaddIEJ6B4QVMSDu9IkVImlGOSGA1I2BQyOZHeLQ6qVOJLcLKn97+fL6dGbzWEiqDzfH4OkcveULmeq2MHFQ==", - "dev": true, "requires": { "JSONStream": "^1.0.4", "is-text-path": "^1.0.0", @@ -1064,11 +1337,15 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "cosmiconfig": { "version": "5.0.1", @@ -1098,7 +1375,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", - "dev": true, "requires": { "array-find-index": "^1.0.1" } @@ -1116,6 +1392,14 @@ "word-wrap": "^1.0.3" } }, + "dargs": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/dargs/-/dargs-4.1.0.tgz", + "integrity": "sha1-A6nbtLXC8Tm/FK5T8LiipqhvThc=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -1144,7 +1428,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", - "dev": true, "requires": { "decamelize": "^1.1.0", "map-obj": "^1.0.0" @@ -1153,14 +1436,12 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "map-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", - "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", - "dev": true + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" } } }, @@ -1286,7 +1567,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-3.0.0.tgz", "integrity": "sha1-G3CK8JSknJoOfbyteQq6U52sEXc=", - "dev": true, "requires": { "is-obj": "^1.0.0" } @@ -1323,7 +1603,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", - "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -1351,7 +1630,21 @@ "esprima": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", - "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", "dev": true }, "esutils": { @@ -1836,12 +2129,6 @@ "merge": "^1.2.0" } }, - "find-parent-dir": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.0.tgz", - "integrity": "sha1-M8RLQpqysvBkYpnF+fcY83b/jVQ=", - "dev": true - }, "find-root": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.0.0.tgz", @@ -1852,35 +2139,10 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", - "dev": true, "requires": { "locate-path": "^2.0.0" } }, - "findup": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz", - "integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=", - "dev": true, - "requires": { - "colors": "~0.6.0-1", - "commander": "~2.1.0" - }, - "dependencies": { - "colors": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz", - "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=", - "dev": true - }, - "commander": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", - "integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=", - "dev": true - } - } - }, "findup-sync": { "version": "0.4.2", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.2.tgz", @@ -1960,6 +2222,11 @@ "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=" }, + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=" + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -1997,6 +2264,18 @@ } } }, + "git-raw-commits": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-1.3.6.tgz", + "integrity": "sha512-svsK26tQ8vEKnMshTDatSIQSMDdz8CxIIqKsvPqbtV23Etmw6VNaFAitu8zwZ0VrOne7FztwPyRLxK7/DIUTQg==", + "requires": { + "dargs": "^4.0.1", + "lodash.template": "^4.0.2", + "meow": "^4.0.0", + "split2": "^2.0.0", + "through2": "^2.0.0" + } + }, "git-up": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/git-up/-/git-up-2.0.10.tgz", @@ -2055,6 +2334,14 @@ "integrity": "sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs=", "dev": true }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "requires": { + "ini": "^1.3.4" + } + }, "global-modules": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", @@ -2095,8 +2382,7 @@ "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", - "dev": true + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, "growl": { "version": "1.10.3", @@ -2225,8 +2511,7 @@ "hosted-git-info": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", - "dev": true + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==" }, "http-proxy-agent": { "version": "2.1.0", @@ -2293,8 +2578,7 @@ "indent-string": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", - "dev": true + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=" }, "inflight": { "version": "1.0.6", @@ -2313,8 +2597,7 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "inquirer": { "version": "1.2.3", @@ -2399,8 +2682,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-buffer": { "version": "1.1.6", @@ -2412,7 +2694,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, "requires": { "builtin-modules": "^1.0.0" } @@ -2457,8 +2738,7 @@ "is-directory": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", - "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", - "dev": true + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=" }, "is-dotfile": { "version": "1.0.3", @@ -2526,8 +2806,7 @@ "is-obj": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" }, "is-odd": { "version": "2.0.0", @@ -2549,8 +2828,7 @@ "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", - "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", - "dev": true + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" }, "is-plain-object": { "version": "2.0.4", @@ -2612,7 +2890,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz", "integrity": "sha1-Thqg+1G/vLPpJogAE5cgLBd1tm4=", - "dev": true, "requires": { "text-extensions": "^1.0.0" } @@ -2626,8 +2903,7 @@ "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" }, "isexe": { "version": "2.0.0", @@ -2692,7 +2968,6 @@ "version": "3.11.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", - "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -2701,8 +2976,7 @@ "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", - "dev": true + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, "json-stringify-safe": { "version": "5.0.1", @@ -2722,13 +2996,12 @@ "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", - "dev": true + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=" }, "just-extend": { - "version": "1.1.27", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-1.1.27.tgz", - "integrity": "sha512-mJVp13Ix6gFo3SBAy9U/kL+oeZqzlYYYLQBwXVBlVzIsZwBqGREnOro24oC/8s8aox+rJhtZ2DiQof++IrkA+g==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-3.0.0.tgz", + "integrity": "sha512-Fu3T6pKBuxjWT/p4DkqGHFRsysc8OauWr4ZRTY9dIx07Y9O0RkoR5jcv28aeD1vuAwhm3nLkDurwLXoALp4DpQ==", "dev": true }, "kind-of": { @@ -2769,7 +3042,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", - "dev": true, "requires": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", @@ -2781,7 +3053,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", - "dev": true, "requires": { "p-locate": "^2.0.0", "path-exists": "^3.0.0" @@ -2790,8 +3061,7 @@ "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" } } }, @@ -2800,34 +3070,106 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=" + }, "lodash.assign": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", "dev": true }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=" + }, "lodash.map": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/lodash.map/-/lodash.map-4.6.0.tgz", "integrity": "sha1-dx7Hg540c9nEzeKLGTlMNWL09tM=", "dev": true }, + "lodash.merge": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.1.tgz", + "integrity": "sha512-AOYza4+Hf5z1/0Hztxpm2/xiPZgi/cjMqdnKTUWTBSKchJlxXXuUSxCCl8rJlf4g6yww/j6mA8nC8Hw/EZWxKQ==" + }, + "lodash.mergewith": { + "version": "4.6.1", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", + "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==" + }, + "lodash.omit": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", + "integrity": "sha1-brGa5aHuHdnfC5aeZs4Lf6MLXmA=" + }, + "lodash.pick": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", + "integrity": "sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM=" + }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=" + }, + "lodash.startcase": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.startcase/-/lodash.startcase-4.4.0.tgz", + "integrity": "sha1-lDbjTtJgk+1/+uGTYUQ1CRXZrdg=" + }, + "lodash.template": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", + "integrity": "sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A=", + "requires": { + "lodash._reinterpolate": "~3.0.0", + "lodash.templatesettings": "^4.0.0" + } + }, + "lodash.templatesettings": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz", + "integrity": "sha1-K01OlbpEDZFf8IvImeRVNmZxMxY=", + "requires": { + "lodash._reinterpolate": "~3.0.0" + } + }, "lodash.toarray": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.toarray/-/lodash.toarray-4.4.0.tgz", "integrity": "sha1-JMS/zWsvuji/0FlNsRedjptlZWE=", "dev": true }, + "lodash.topairs": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.topairs/-/lodash.topairs-4.3.0.tgz", + "integrity": "sha1-O23qo31g+xFnE8RsXxfqGQ7EjWQ=" + }, + "lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=" + }, "lolex": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.3.2.tgz", - "integrity": "sha512-A5pN2tkFj7H0dGIAM6MFvHKMJcPnjZsOMvR7ujCjfgW5TbV6H9vb1PgxLtHvjqNZTHsUolz+6/WEO0N1xNx2ng==", + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-2.7.4.tgz", + "integrity": "sha512-Gh6Vffq/piTeHwunLNFR1jFVaqlwK9GMNUxFcsO1cwHyvbRKHwX8UDkxmrDnbcPdHNmpv7z2kxtkkSx5xkNpMw==", "dev": true }, "long": { @@ -2845,7 +3187,6 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", - "dev": true, "requires": { "currently-unhandled": "^0.4.1", "signal-exit": "^3.0.0" @@ -2870,8 +3211,7 @@ "map-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", - "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", - "dev": true + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=" }, "map-visit": { "version": "1.0.0", @@ -2941,7 +3281,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", - "dev": true, "requires": { "camelcase-keys": "^4.0.0", "decamelize-keys": "^1.0.0", @@ -3010,14 +3349,12 @@ "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, "minimist-options": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", - "dev": true, "requires": { "arrify": "^1.0.1", "is-plain-obj": "^1.1.0" @@ -3048,7 +3385,6 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, "requires": { "minimist": "0.0.8" }, @@ -3056,8 +3392,7 @@ "minimist": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" } } }, @@ -3199,13 +3534,13 @@ "dev": true }, "nise": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.3.3.tgz", - "integrity": "sha512-v1J/FLUB9PfGqZLGDBhQqODkbLotP0WtLo9R4EJY2PPu5f5Xg4o0rA8FDlmrjFSv9vBBKcfnOSpfYYuu5RTHqg==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/nise/-/nise-1.4.4.tgz", + "integrity": "sha512-pxE0c9PzgrUTyhfv5p+5eMIdfU2bLEsq8VQEuE0kxM4zP7SujSar7rk9wpI2F7RyyCEvLyj5O7Is3RER5F36Fg==", "dev": true, "requires": { "@sinonjs/formatio": "^2.0.0", - "just-extend": "^1.1.27", + "just-extend": "^3.0.0", "lolex": "^2.3.2", "path-to-regexp": "^1.7.0", "text-encoding": "^0.6.4" @@ -3235,7 +3570,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", - "dev": true, "requires": { "hosted-git-info": "^2.1.4", "is-builtin-module": "^1.0.0", @@ -3275,8 +3609,7 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nyc": { "version": "11.7.1", @@ -3317,6 +3650,7 @@ "version": "0.1.4", "bundled": true, "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -4473,7 +4807,8 @@ "longest": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.3.1", @@ -6153,7 +6488,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", - "dev": true, "requires": { "p-try": "^1.0.0" } @@ -6162,7 +6496,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, "requires": { "p-limit": "^1.1.0" } @@ -6191,8 +6524,7 @@ "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, "pad-right": { "version": "0.2.2", @@ -6231,7 +6563,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", - "dev": true, "requires": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" @@ -6312,7 +6643,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", - "dev": true, "requires": { "pify": "^3.0.0" } @@ -6325,8 +6655,7 @@ "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", - "dev": true + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, "pinkie": { "version": "2.0.4", @@ -6362,16 +6691,15 @@ "dev": true }, "prettier": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.12.1.tgz", - "integrity": "sha1-wa0g6APndJ+vkFpAnSNn4Gu+cyU=", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.14.2.tgz", + "integrity": "sha512-McHPg0n1pIke+A/4VcaS2en+pTNjy4xF+Uuq86u/5dyDO59/TtFZtQ708QIRkEZ3qwKz3GVkVa6mpxK/CpB8Rg==", "dev": true }, "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==", - "dev": true + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "protocols": { "version": "1.4.6", @@ -6388,8 +6716,7 @@ "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" }, "query-string": { "version": "5.1.1", @@ -6405,8 +6732,7 @@ "quick-lru": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", - "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", - "dev": true + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=" }, "randomatic": { "version": "1.1.7", @@ -6465,7 +6791,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", - "dev": true, "requires": { "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", @@ -6476,7 +6801,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", - "dev": true, "requires": { "find-up": "^2.0.0", "read-pkg": "^3.0.0" @@ -6486,7 +6810,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -6510,7 +6833,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", - "dev": true, "requires": { "indent-string": "^3.0.0", "strip-indent": "^2.0.0" @@ -6533,6 +6855,11 @@ } } }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", @@ -6595,12 +6922,33 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "dev": true }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=" + } + } + }, "resolve": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", @@ -6623,8 +6971,15 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + }, + "resolve-global": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/resolve-global/-/resolve-global-0.1.0.tgz", + "integrity": "sha1-j7As/Vt9sgEY6IYxHxWvlb0V+9k=", + "requires": { + "global-dirs": "^0.1.0" + } }, "resolve-url": { "version": "0.2.1", @@ -6674,7 +7029,6 @@ "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, "requires": { "glob": "^7.0.5" } @@ -6703,21 +7057,22 @@ } }, "rxjs-tslint-rules": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/rxjs-tslint-rules/-/rxjs-tslint-rules-3.17.0.tgz", - "integrity": "sha512-iFau1P9Cd51jA4GkJZo1xQasFYImnP3mpA8mtSxKyyE/GPxEmr+Crjuf4TPGWwTqNPzrVB/4EqvfKnXjhtj9Kw==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/rxjs-tslint-rules/-/rxjs-tslint-rules-4.8.0.tgz", + "integrity": "sha512-ouk50f5Epj/l2E/5p2extPjFyQ7r+Zoax4inENsMqAi7kdvYjiET4qMCdKq1dTiyCWOJruLhovlJ8oc8NfnV8w==", "dev": true, "requires": { + "@phenomnomnominal/tsquery": "^2.0.0", "decamelize": "^2.0.0", "resolve": "^1.4.0", - "tslib": "^1.8.0" + "tslib": "^1.8.0", + "tsutils": "^3.0.0" } }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-regex": { "version": "1.1.0", @@ -6775,14 +7130,7 @@ "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", - "dev": true - }, - "semver-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-1.0.0.tgz", - "integrity": "sha1-kqSWkGX5xwxpR1PVUkj8aPj2Usk=", - "dev": true + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" }, "set-blocking": { "version": "2.0.0", @@ -6842,22 +7190,34 @@ "signal-exit": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "sinon": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-5.0.4.tgz", - "integrity": "sha512-FBWjLLxSpsdoVM+5FrE0dOlANLRbEoaxwahyXvrOxIfqKN5D+dYUS8AKWNVDDjtQaiBo/tzbVoi4AKve8G2+iw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-6.2.0.tgz", + "integrity": "sha512-gLFZz5UYvOhYzQ+DBzw/OCkmWaLAHlAyQiE2wxUOmAGVdasP9Yw93E+OwZ0UuhW3ReMu1FKniuNsL6VukvC77w==", "dev": true, "requires": { + "@sinonjs/commons": "^1.0.2", "@sinonjs/formatio": "^2.0.0", - "diff": "^3.1.0", + "@sinonjs/samsam": "^2.0.0", + "diff": "^3.5.0", "lodash.get": "^4.4.2", - "lolex": "^2.2.0", - "nise": "^1.2.0", - "supports-color": "^5.1.0", - "type-detect": "^4.0.5" + "lolex": "^2.7.2", + "nise": "^1.4.4", + "supports-color": "^5.5.0", + "type-detect": "^4.0.8" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } } }, "slash": { @@ -7055,7 +7415,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", - "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -7064,14 +7423,12 @@ "spdx-exceptions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", - "dev": true + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==" }, "spdx-expression-parse": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", - "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -7080,8 +7437,7 @@ "spdx-license-ids": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", - "dev": true + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==" }, "split": { "version": "1.0.1", @@ -7105,7 +7461,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", - "dev": true, "requires": { "through2": "^2.0.2" } @@ -7113,8 +7468,7 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "stack-trace": { "version": "0.0.10", @@ -7187,7 +7541,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, "requires": { "safe-buffer": "~5.1.0" } @@ -7204,8 +7557,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-eof": { "version": "1.0.0", @@ -7216,8 +7568,7 @@ "strip-indent": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", - "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", - "dev": true + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=" }, "strip-json-comments": { "version": "2.0.1", @@ -7265,8 +7616,7 @@ "text-extensions": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.7.0.tgz", - "integrity": "sha512-AKXZeDq230UaSzaO5s3qQUZOaC7iKbzq0jOFL614R7d9R593HLqAOL0cYoqLdkNrjBSOdmoQI06yigq1TSBXAg==", - "dev": true + "integrity": "sha512-AKXZeDq230UaSzaO5s3qQUZOaC7iKbzq0jOFL614R7d9R593HLqAOL0cYoqLdkNrjBSOdmoQI06yigq1TSBXAg==" }, "thenify": { "version": "3.3.0", @@ -7297,14 +7647,12 @@ "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, "through2": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", - "dev": true, "requires": { "readable-stream": "^2.1.5", "xtend": "~4.0.1" @@ -7370,14 +7718,12 @@ "trim-newlines": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", - "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", - "dev": true + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=" }, "trim-off-newlines": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", - "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", - "dev": true + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=" }, "tslib": { "version": "1.9.0", @@ -7417,9 +7763,9 @@ } }, "tslint-config-prettier": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.12.0.tgz", - "integrity": "sha512-7zugK8NWpoDPYT6UNGLDGpQOhk0CSodjkyrTNiHOCjwIAleYKlyQunxpsSXBIoGEs/kFVppd6YzZeQZtrJnyRg==", + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.15.0.tgz", + "integrity": "sha512-06CgrHJxJmNYVgsmeMoa1KXzQRoOdvfkqnJth6XUkNeOz707qxN0WfxfhYwhL5kXHHbYJRby2bqAPKwThlZPhw==", "dev": true }, "tslint-language-service": { @@ -7432,18 +7778,29 @@ } }, "tslint-react": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-3.5.1.tgz", - "integrity": "sha512-ndS/iOOGrasATcf5YU3JxoIwPGVykjrKhzmlVsRdT1xzl/RbNg9n627rtAGbCjkQepyiaQYgxWQT5G/qUpQCaA==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-3.6.0.tgz", + "integrity": "sha512-AIv1QcsSnj7e9pFir6cJ6vIncTqxfqeFF3Lzh8SuuBljueYzEAtByuB6zMaD27BL0xhMEqsZ9s5eHuCONydjBw==", "dev": true, "requires": { "tsutils": "^2.13.1" + }, + "dependencies": { + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } } }, "tsutils": { - "version": "2.26.2", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.26.2.tgz", - "integrity": "sha512-uzwnhmrSbyinPCiwfzGsOY3IulBTwoky7r83HmZdz9QNCjhSCzavkh47KLWuU0zF2F2WbpmmzoJUIEiYyd+jEQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.0.0.tgz", + "integrity": "sha512-LjHBWR0vWAUHWdIAoTjoqi56Kz+FDKBgVEuL+gVPG/Pv7QW5IdaDDeK9Txlr6U0Cmckp5EgCIq1T25qe3J6hyw==", "dev": true, "requires": { "tslib": "^1.8.1" @@ -7461,9 +7818,9 @@ "dev": true }, "typescript": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.1.tgz", - "integrity": "sha512-zQIMOmC+372pC/CCVLqnQ0zSBiY7HHodU7mpQdjiZddek4GMj31I3dUJ7gAs9o65X7mnRma6OokOkc6f9jjfBg==" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.3.tgz", + "integrity": "sha512-kk80vLW9iGtjMnIv11qyxLqZm20UklzuR2tL0QAnDIygIUIemcZMxlMWudl9OOt76H3ntVzcTiddQ1/pAAJMYg==" }, "uglify-js": { "version": "2.8.29", @@ -7638,26 +7995,12 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true - }, - "validate-commit-msg": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/validate-commit-msg/-/validate-commit-msg-2.14.0.tgz", - "integrity": "sha1-5Tg2kQEsuycNzAvCpO/+vhSJDqw=", - "dev": true, - "requires": { - "conventional-commit-types": "^2.0.0", - "find-parent-dir": "^0.3.0", - "findup": "0.1.5", - "semver-regex": "1.0.0" - } + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "validate-npm-package-license": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", - "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -7669,21 +8012,21 @@ "integrity": "sha512-+Eb+Dxf2kC2h079msx61hkblxAKE0S2j78+8QpnigLAO2aIIjkCwTIH34etBrU8E8VItRinec7YEwULx9at5bQ==" }, "vscode-languageserver": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-4.2.1.tgz", - "integrity": "sha512-5WAxaK1nEpe52ZaWNMqmd6rO5CIE72J/7UkGKPUTdGa0l0haWHS69tpRz+LetBlgTpP7PYacl4xhDaLZv82a+g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-5.0.3.tgz", + "integrity": "sha512-itOImvZfDueQXMhy4pm2SwPKa3AShZvILXFcK/5X3ruiYdZozmx3OeD5Y92dVBt0OzTdbVD9MZcEelH4E7Eu3g==", "requires": { - "vscode-languageserver-protocol": "^3.8.1", - "vscode-uri": "^1.0.3" + "vscode-languageserver-protocol": "^3.10.3", + "vscode-uri": "^1.0.5" } }, "vscode-languageserver-protocol": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.8.1.tgz", - "integrity": "sha512-KdeetvQ2JavRiuE9afNrV5+xJZocj7NGPQwH4kpSFw5cp+0wijv87qgXfSEvmwPUaknhMBoSuSrSIG/LRrzWJQ==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.12.0.tgz", + "integrity": "sha512-evY6hmyzLnwQrqlQWPrNBq1z8wrSNjLesmgPzeS6Zv11mVS5UJRel26hbM/DH5tHdn45huNzRW0eFHRmIm8LpA==", "requires": { "vscode-jsonrpc": "^3.6.2", - "vscode-languageserver-types": "^3.8.1" + "vscode-languageserver-types": "^3.12.0" }, "dependencies": { "vscode-jsonrpc": { @@ -7692,9 +8035,9 @@ "integrity": "sha512-T24Jb5V48e4VgYliUXMnZ379ItbrXgOimweKaJshD84z+8q7ZOZjJan0MeDe+Ugb+uqERDVV8SBmemaGMSMugA==" }, "vscode-languageserver-types": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.8.2.tgz", - "integrity": "sha512-2RMkyt1O1czGPCnkjKZWSio2D8oh3XlQ4zi4W2xL8q2Dvi4hB3/DEt+wYyzo4hmE2ZFP0RB8PXyzHyed7p1hbw==" + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.12.0.tgz", + "integrity": "sha512-UxqnpzBToPO7Mi2tr/s5JeyPOSKSJtLB8lIdxCg9ZNdvP2cU8wS7iTDtwQKz91Ne4CUmTdf85ddR5SIZKXmMjQ==" } } }, @@ -7704,9 +8047,9 @@ "integrity": "sha512-ftGfU79AnnI3OHCG7kzCCN47jNI7BjECPAH2yhddtYTiQk0bnFbuFeQKvpXQcyNI3GsKEx5b6kSiBYshTiep6w==" }, "vscode-uri": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.5.tgz", - "integrity": "sha1-O4majvccN/MFTXm9vdoxx7828g0=" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.6.tgz", + "integrity": "sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==" }, "which": { "version": "1.3.0", diff --git a/package.json b/package.json index cea4ce9f3..a57ee536d 100644 --- a/package.json +++ b/package.json @@ -33,9 +33,16 @@ "build": "tsc", "watch": "tsc -w", "semantic-release": "semantic-release", - "commitmsg": "validate-commit-msg" + "commitmsg": "commitlint -e $GIT_PARAMS" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] }, "dependencies": { + "@commitlint/cli": "^7.1.2", + "@commitlint/config-conventional": "^7.1.2", "chai": "^4.0.1", "chai-as-promised": "^7.0.0", "chalk": "^2.2.0", @@ -51,40 +58,39 @@ "rxjs": "^5.5.0", "semaphore-async-await": "^1.5.1", "string-similarity": "^1.1.0", - "typescript": "3.0.1", + "typescript": "~3.0.3", "vscode-jsonrpc": "^3.3.1", - "vscode-languageserver": "^4.2.1", + "vscode-languageserver": "^5.0.0", "vscode-languageserver-types": "^3.0.3" }, "devDependencies": { - "@sourcegraph/prettierrc": "^2.0.0", + "@sourcegraph/prettierrc": "^2.2.0", "@sourcegraph/tsconfig": "^3.0.0", - "@sourcegraph/tslint-config": "^11.0.1", - "@types/chai": "4.0.6", - "@types/chai-as-promised": "^7.1.0", - "@types/glob": "^5.0.30", - "@types/lodash": "^4.14.76", - "@types/mocha": "^5.0.0", - "@types/mz": "^0.0.31", - "@types/node": "^7.0.32", - "@types/object-hash": "^1.1.0", - "@types/rimraf": "^2.0.2", - "@types/sinon": "^4.0.0", - "@types/temp": "^0.8.29", + "@sourcegraph/tslint-config": "^12.0.0", + "@types/chai": "4.1.4", + "@types/chai-as-promised": "7.1.0", + "@types/glob": "5.0.35", + "@types/lodash": "4.14.116", + "@types/mocha": "5.2.5", + "@types/mz": "0.0.32", + "@types/node": "7.0.63", + "@types/object-hash": "1.2.0", + "@types/rimraf": "2.0.2", + "@types/sinon": "4.3.1", + "@types/temp": "0.8.32", "commitizen": "^2.9.6", "cz-conventional-changelog": "^2.0.0", "husky": "^0.14.0", "mocha": "^5.0.0", "nyc": "^11.0.2", - "prettier": "1.12.1", + "prettier": "1.14.2", "rimraf": "^2.6.1", "semantic-release": "^15.1.8", - "sinon": "^5.0.0", + "sinon": "^6.0.0", "source-map-support": "^0.5.0", "temp": "^0.8.3", "tslint": "^5.11.0", - "tslint-language-service": "^0.9.9", - "validate-commit-msg": "^2.12.2" + "tslint-language-service": "^0.9.9" }, "bin": { "javascript-typescript-langserver": "./lib/language-server.js", @@ -98,11 +104,6 @@ "lib/test/**/*.js" ] }, - "config": { - "commitizen": { - "path": "./node_modules/cz-conventional-changelog" - } - }, "greenkeeper": { "ignore": [ "@types/node" diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..ba277b3b0 --- /dev/null +++ b/renovate.json @@ -0,0 +1,10 @@ +{ + "extends": ["github>sourcegraph/renovate-config"], + "semanticCommits": true, + "travis": { + "enabled": true + }, + "node": { + "supportPolicy": ["lts"] + } +} diff --git a/src/lang-handler.ts b/src/lang-handler.ts index c4a00c244..0f1d7922f 100644 --- a/src/lang-handler.ts +++ b/src/lang-handler.ts @@ -107,13 +107,15 @@ export class RemoteLanguageClient { .filter(msg => isResponseMessage(msg) && msg.id === id) .take(1) // Emit result or error - .map((msg: ResponseMessage): any => { - receivedResponse = true - if (msg.error) { - throw Object.assign(new Error(msg.error.message), msg.error) + .map( + (msg: ResponseMessage): any => { + receivedResponse = true + if (msg.error) { + throw Object.assign(new Error(msg.error.message), msg.error) + } + return msg.result } - return msg.result - }) + ) // Forward events to subscriber .subscribe(subscriber) // Handler for unsubscribe() diff --git a/src/test/typescript-service-helpers.ts b/src/test/typescript-service-helpers.ts index 3377b3342..4f553c4ad 100644 --- a/src/test/typescript-service-helpers.ts +++ b/src/test/typescript-service-helpers.ts @@ -1,7 +1,7 @@ import * as chai from 'chai' import chaiAsPromised = require('chai-as-promised') import { applyReducer, Operation } from 'fast-json-patch' -import { IBeforeAndAfterContext, ISuiteCallbackContext, ITestCallbackContext } from 'mocha' +import { Context } from 'mocha' import { Observable } from 'rxjs' import * as sinon from 'sinon' import * as ts from 'typescript' @@ -63,26 +63,27 @@ export const initializeTypeScriptService = ( files: Map, clientCapabilities: ClientCapabilities = DEFAULT_CAPABILITIES ) => - async function(this: TestContext & IBeforeAndAfterContext): Promise { + async function(this: TestContext & Context): Promise { // Stub client this.client = sinon.createStubInstance(RemoteLanguageClient) - this.client.textDocumentXcontent.callsFake((params: TextDocumentContentParams): Observable< - TextDocumentItem - > => { - if (!files.has(params.textDocument.uri)) { - return Observable.throw(new Error(`Text document ${params.textDocument.uri} does not exist`)) + this.client.textDocumentXcontent.callsFake( + (params: TextDocumentContentParams): Observable => { + if (!files.has(params.textDocument.uri)) { + return Observable.throw(new Error(`Text document ${params.textDocument.uri} does not exist`)) + } + return Observable.of({ + uri: params.textDocument.uri, + text: files.get(params.textDocument.uri)!, + version: 1, + languageId: '', + }) } - return Observable.of({ - uri: params.textDocument.uri, - text: files.get(params.textDocument.uri)!, - version: 1, - languageId: '', - }) - }) - this.client.workspaceXfiles.callsFake((params: WorkspaceFilesParams): Observable => - observableFromIterable(files.keys()) - .map(uri => ({ uri })) - .toArray() + ) + this.client.workspaceXfiles.callsFake( + (params: WorkspaceFilesParams): Observable => + observableFromIterable(files.keys()) + .map(uri => ({ uri })) + .toArray() ) this.client.xcacheGet.callsFake(() => Observable.of(null)) this.client.workspaceApplyEdit.callsFake(() => Observable.of({ applied: true })) @@ -106,7 +107,7 @@ export const initializeTypeScriptService = ( /** * Shuts the TypeScriptService down (to be used in `afterEach()`) */ -export async function shutdownTypeScriptService(this: TestContext & IBeforeAndAfterContext): Promise { +export async function shutdownTypeScriptService(this: Context): Promise { await this.service.shutdown().toPromise() } @@ -120,7 +121,7 @@ export function describeTypeScriptService( shutdownService = shutdownTypeScriptService, rootUri: string ): void { - describe('Workspace without project files', function(this: TestContext & ISuiteCallbackContext): void { + describe('Workspace without project files', () => { beforeEach( initializeTypeScriptService( createService, @@ -151,8 +152,8 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('textDocumentDefinition()', function(this: TestContext & ISuiteCallbackContext): void { - specify('in same file', async function(this: TestContext & ITestCallbackContext): Promise { + describe('textDocumentDefinition()', () => { + specify('in same file', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -181,7 +182,7 @@ export function describeTypeScriptService( }, ]) }) - specify('on keyword (non-null)', async function(this: TestContext & ITestCallbackContext): Promise { + specify('on keyword (non-null)', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -196,7 +197,7 @@ export function describeTypeScriptService( .toPromise() assert.deepEqual(result, []) }) - specify('in other file', async function(this: TestContext & ITestCallbackContext): Promise { + specify('in other file', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -227,8 +228,8 @@ export function describeTypeScriptService( }) }) - describe('textDocumentTypeDefinition()', function(this: TestContext & ISuiteCallbackContext): void { - specify('in other file', async function(this: TestContext & ITestCallbackContext): Promise { + describe('textDocumentTypeDefinition()', () => { + specify('in other file', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentTypeDefinition({ textDocument: { @@ -257,7 +258,7 @@ export function describeTypeScriptService( }, ]) }) - specify('in same file', async function(this: TestContext & ITestCallbackContext): Promise { + specify('in same file', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentTypeDefinition({ textDocument: { @@ -288,10 +289,8 @@ export function describeTypeScriptService( }) }) - describe('textDocumentXdefinition()', function(this: TestContext & ISuiteCallbackContext): void { - specify('on interface field reference', async function( - this: TestContext & ITestCallbackContext - ): Promise { + describe('textDocumentXdefinition()', () => { + specify('on interface field reference', async function(this: TestContext & Context): Promise { const result: SymbolLocationInformation[] = await this.service .textDocumentXdefinition({ textDocument: { @@ -329,7 +328,7 @@ export function describeTypeScriptService( }, ]) }) - specify('in same file', async function(this: TestContext & ITestCallbackContext): Promise { + specify('in same file', async function(this: TestContext & Context): Promise { const result: SymbolLocationInformation[] = await this.service .textDocumentXdefinition({ textDocument: { @@ -368,8 +367,8 @@ export function describeTypeScriptService( ]) }) }) - describe('textDocumentHover()', function(this: TestContext & ISuiteCallbackContext): void { - specify('in same file', async function(this: TestContext & ITestCallbackContext): Promise { + describe('textDocumentHover()', () => { + specify('in same file', async function(this: TestContext & Context): Promise { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -397,7 +396,7 @@ export function describeTypeScriptService( }) }) specify('local function with callback argument', async function( - this: TestContext & ITestCallbackContext + this: TestContext & Context ): Promise { const result: Hover = await this.service .textDocumentHover({ @@ -428,7 +427,7 @@ export function describeTypeScriptService( ], }) }) - specify('in other file', async function(this: TestContext & ITestCallbackContext): Promise { + specify('in other file', async function(this: TestContext & Context): Promise { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -455,7 +454,7 @@ export function describeTypeScriptService( contents: [{ language: 'typescript', value: 'class Foo\nimport Foo' }, '**alias**'], }) }) - specify('over keyword (non-null)', async function(this: TestContext & ITestCallbackContext): Promise { + specify('over keyword (non-null)', async function(this: TestContext & Context): Promise { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -470,7 +469,7 @@ export function describeTypeScriptService( .toPromise() assert.deepEqual(result, { contents: [] }) }) - specify('over non-existent file', async function(this: TestContext & ITestCallbackContext): Promise { + specify('over non-existent file', async function(this: TestContext & Context): Promise { await Promise.resolve( assert.isRejected( this.service @@ -490,7 +489,7 @@ export function describeTypeScriptService( }) }) - describe('Workspace with typings directory', function(this: TestContext & ISuiteCallbackContext): void { + describe('Workspace with typings directory', () => { beforeEach( initializeTypeScriptService( createService, @@ -521,8 +520,8 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('textDocumentDefinition()', function(this: TestContext & ISuiteCallbackContext): void { - specify('with tsd.d.ts', async function(this: TestContext & ITestCallbackContext): Promise { + describe('textDocumentDefinition()', () => { + specify('with tsd.d.ts', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -551,8 +550,8 @@ export function describeTypeScriptService( }, ]) }) - describe('on file in project root', function(this: TestContext & ISuiteCallbackContext): void { - specify('on import alias', async function(this: TestContext & ITestCallbackContext): Promise { + describe('on file in project root', () => { + specify('on import alias', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -581,7 +580,7 @@ export function describeTypeScriptService( }, ]) }) - specify('on module name', async function(this: TestContext & ITestCallbackContext): Promise { + specify('on module name', async function(this: TestContext & Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -614,7 +613,7 @@ export function describeTypeScriptService( }) }) - describe('DefinitelyTyped', function(this: TestContext & ISuiteCallbackContext): void { + describe('DefinitelyTyped', () => { beforeEach( initializeTypeScriptService( createService, @@ -717,9 +716,9 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('workspaceSymbol()', function(this: TestContext & ISuiteCallbackContext): void { + describe('workspaceSymbol()', () => { it('should find a symbol by SymbolDescriptor query with name and package name', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ symbol: { name: 'resolveCallback', package: { name: '@types/resolve' } }, @@ -747,7 +746,7 @@ export function describeTypeScriptService( ]) }) it('should find a symbol by SymbolDescriptor query with name, containerKind and package name', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ symbol: { @@ -781,7 +780,7 @@ export function describeTypeScriptService( }) }) - describe('Workspace with root package.json', function(this: TestContext & ISuiteCallbackContext): void { + describe('Workspace with root package.json', () => { beforeEach( initializeTypeScriptService( createService, @@ -802,10 +801,10 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('workspaceSymbol()', function(this: TestContext & ISuiteCallbackContext): void { - describe('with SymbolDescriptor query', function(this: TestContext & ISuiteCallbackContext): void { + describe('workspaceSymbol()', () => { + describe('with SymbolDescriptor query', () => { it('should find a symbol by name, kind and package name', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ symbol: { @@ -837,7 +836,7 @@ export function describeTypeScriptService( }) }) it('should find a symbol by name, kind, package name and ignore package version', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ symbol: { name: 'a', kind: 'class', package: { name: 'mypkg', version: '203940234' } }, @@ -862,9 +861,7 @@ export function describeTypeScriptService( name: 'a', }) }) - it('should find a symbol by name', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('should find a symbol by name', async function(this: TestContext & Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ symbol: { @@ -894,7 +891,7 @@ export function describeTypeScriptService( ]) }) it('should return no result if the PackageDescriptor does not match', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ symbol: { @@ -910,8 +907,8 @@ export function describeTypeScriptService( assert.deepEqual(result, []) }) }) - describe('with text query', function(this: TestContext & ISuiteCallbackContext): void { - it('should find a symbol', async function(this: TestContext & ITestCallbackContext): Promise { + describe('with text query', () => { + it('should find a symbol', async function(this: TestContext & Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ query: 'a' }) .reduce(applyReducer, null as any) @@ -937,7 +934,7 @@ export function describeTypeScriptService( ]) }) it('should return all symbols for an empty query excluding dependencies', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SymbolInformation[] = await this.service .workspaceSymbol({ query: '' }) .reduce(applyReducer, null as any) @@ -1106,9 +1103,8 @@ export function describeTypeScriptService( }) }) - describe('workspaceXreferences()', function(this: TestContext & ISuiteCallbackContext): void { - it('should return all references to a method', async function(this: TestContext & - ITestCallbackContext): Promise { + describe('workspaceXreferences()', () => { + it('should return all references to a method', async function(this: TestContext & Context): Promise { const result: ReferenceInformation[] = await this.service .workspaceXreferences({ query: { name: 'foo', kind: 'method', containerName: 'a' } }) .reduce(applyReducer, null as any) @@ -1139,7 +1135,7 @@ export function describeTypeScriptService( ]) }) it('should return all references to a method with hinted dependee package name', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: ReferenceInformation[] = await this.service .workspaceXreferences({ query: { @@ -1179,7 +1175,7 @@ export function describeTypeScriptService( ]) }) it('should return no references to a method if hinted dependee package name was not found', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result = await this.service .workspaceXreferences({ query: { @@ -1196,7 +1192,7 @@ export function describeTypeScriptService( assert.deepEqual(result, []) }) it('should return all references to a symbol from a dependency', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: ReferenceInformation[] = await this.service .workspaceXreferences({ query: { name: 'x' } }) .reduce(applyReducer, null as any) @@ -1227,7 +1223,7 @@ export function describeTypeScriptService( ]) }) it('should return all references to a symbol from a dependency with PackageDescriptor query', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: ReferenceInformation[] = await this.service .workspaceXreferences({ query: { name: 'x', package: { name: 'dep' } } }) .reduce(applyReducer, null as any) @@ -1263,7 +1259,7 @@ export function describeTypeScriptService( ]) }) it('should return all references to all symbols if empty SymbolDescriptor query is passed', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: ReferenceInformation[] = await this.service .workspaceXreferences({ query: {} }) .reduce(applyReducer, null as any) @@ -1472,7 +1468,7 @@ export function describeTypeScriptService( }) }) - describe('Dependency detection', function(this: TestContext & ISuiteCallbackContext): void { + describe('Dependency detection', () => { beforeEach( initializeTypeScriptService( createService, @@ -1527,10 +1523,8 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('workspaceXdependencies()', function(this: TestContext & ISuiteCallbackContext): void { - it('should account for all dependencies', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + describe('workspaceXdependencies()', () => { + it('should account for all dependencies', async function(this: TestContext & Context): Promise { const result: DependencyReference[] = await this.service .workspaceXdependencies() .reduce(applyReducer, null as any) @@ -1629,10 +1623,8 @@ export function describeTypeScriptService( ]) }) }) - describe('workspaceXpackages()', function(this: TestContext & ISuiteCallbackContext): void { - it('should accournt for all packages', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + describe('workspaceXpackages()', () => { + it('should accournt for all packages', async function(this: TestContext & Context): Promise { const result: PackageInformation[] = await this.service .workspaceXpackages() .reduce(applyReducer, null as any) @@ -1746,16 +1738,14 @@ export function describeTypeScriptService( }) }) - describe('TypeScript library', function(this: TestContext & ISuiteCallbackContext): void { + describe('TypeScript library', () => { beforeEach( initializeTypeScriptService(createService, rootUri, new Map([[rootUri + 'a.ts', 'let parameters = [];']])) ) afterEach(shutdownService) - specify('type of parameters should be any[]', async function( - this: TestContext & ITestCallbackContext - ): Promise { + specify('type of parameters should be any[]', async function(this: TestContext & Context): Promise { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -1784,7 +1774,7 @@ export function describeTypeScriptService( }) }) - describe('Live updates', function(this: TestContext & ISuiteCallbackContext): void { + describe('Live updates', () => { beforeEach( initializeTypeScriptService(createService, rootUri, new Map([[rootUri + 'a.ts', 'let parameters = [];']])) ) @@ -1792,7 +1782,7 @@ export function describeTypeScriptService( afterEach(shutdownService) it('should handle didChange when configuration is not yet initialized', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const hoverParams = { textDocument: { uri: rootUri + 'a.ts', @@ -1837,7 +1827,7 @@ export function describeTypeScriptService( }) it('should handle didClose when configuration is not yet initialized', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const hoverParams = { textDocument: { uri: rootUri + 'a.ts', @@ -1875,7 +1865,7 @@ export function describeTypeScriptService( }) }) - it('should reflect updated content', async function(this: TestContext & ITestCallbackContext): Promise { + it('should reflect updated content', async function(this: TestContext & Context): Promise { const hoverParams = { textDocument: { uri: rootUri + 'a.ts', @@ -1970,7 +1960,7 @@ export function describeTypeScriptService( }) }) - describe('Diagnostics', function(this: TestContext & ISuiteCallbackContext): void { + describe('Diagnostics', () => { beforeEach( initializeTypeScriptService( createService, @@ -1981,9 +1971,7 @@ export function describeTypeScriptService( afterEach(shutdownService) - it('should publish diagnostics on didOpen', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('should publish diagnostics on didOpen', async function(this: TestContext & Context): Promise { await this.service.textDocumentDidOpen({ textDocument: { uri: rootUri + 'src/errors.ts', @@ -2008,9 +1996,7 @@ export function describeTypeScriptService( }) }) - it('should publish diagnostics on didChange', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('should publish diagnostics on didChange', async function(this: TestContext & Context): Promise { await this.service.textDocumentDidOpen({ textDocument: { uri: rootUri + 'src/errors.ts', @@ -2046,7 +2032,7 @@ export function describeTypeScriptService( }) it('should publish empty diagnostics on didChange if error was fixed', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { await this.service.textDocumentDidOpen({ textDocument: { uri: rootUri + 'src/errors.ts', @@ -2073,9 +2059,7 @@ export function describeTypeScriptService( }) }) - it('should clear diagnostics on didClose', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('should clear diagnostics on didClose', async function(this: TestContext & Context): Promise { await this.service.textDocumentDidClose({ textDocument: { uri: rootUri + 'src/errors.ts', @@ -2090,7 +2074,7 @@ export function describeTypeScriptService( }) }) - describe('References and imports', function(this: TestContext & ISuiteCallbackContext): void { + describe('References and imports', () => { beforeEach( initializeTypeScriptService( createService, @@ -2128,9 +2112,9 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('textDocumentDefinition()', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentDefinition()', () => { it('should resolve symbol imported with tripe-slash reference', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -2168,7 +2152,7 @@ export function describeTypeScriptService( ]) }) it('should resolve symbol imported with import statement', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -2197,8 +2181,9 @@ export function describeTypeScriptService( }, ]) }) - it('should resolve definition with missing reference', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should resolve definition with missing reference', async function(this: TestContext & Context): Promise< + void + > { const result: Location[] = await this.service .textDocumentDefinition({ textDocument: { @@ -2227,9 +2212,7 @@ export function describeTypeScriptService( }, ]) }) - it('should resolve deep definitions', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('should resolve deep definitions', async function(this: TestContext & Context): Promise { // This test passes only because we expect no response from LSP server // for definition located in file references with depth 3 or more (a -> b -> c -> d (...)) // This test will fail once we'll increase (or remove) depth limit @@ -2264,7 +2247,7 @@ export function describeTypeScriptService( }) }) - describe('TypeScript libraries', function(this: TestContext & ISuiteCallbackContext): void { + describe('TypeScript libraries', () => { beforeEach( initializeTypeScriptService( createService, @@ -2285,10 +2268,8 @@ export function describeTypeScriptService( afterEach(shutdownService) - describe('textDocumentHover()', function(this: TestContext & ISuiteCallbackContext): void { - it('should load local library file', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + describe('textDocumentHover()', () => { + it('should load local library file', async function(this: TestContext & Context): Promise { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -2335,9 +2316,8 @@ export function describeTypeScriptService( }) }) }) - describe('textDocumentDefinition()', function(this: TestContext & ISuiteCallbackContext): void { - it('should resolve TS libraries to github URL', async function(this: TestContext & - ITestCallbackContext): Promise { + describe('textDocumentDefinition()', () => { + it('should resolve TS libraries to github URL', async function(this: TestContext & Context): Promise { assert.deepEqual( await this.service .textDocumentDefinition({ @@ -2414,7 +2394,7 @@ export function describeTypeScriptService( }) }) - describe('textDocumentReferences()', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentReferences()', () => { beforeEach( initializeTypeScriptService( createService, @@ -2451,7 +2431,7 @@ export function describeTypeScriptService( afterEach(shutdownService) it('should provide an empty response when no reference is found', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result = await this.service .textDocumentReferences({ textDocument: { @@ -2468,8 +2448,7 @@ export function describeTypeScriptService( assert.deepEqual(result, []) }) - it('should include the declaration if requested', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should include the declaration if requested', async function(this: TestContext & Context): Promise { const result = await this.service .textDocumentReferences({ textDocument: { @@ -2500,8 +2479,9 @@ export function describeTypeScriptService( ]) }) - it('should provide a reference within the same file', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should provide a reference within the same file', async function(this: TestContext & Context): Promise< + void + > { const result = await this.service .textDocumentReferences({ textDocument: { @@ -2531,8 +2511,7 @@ export function describeTypeScriptService( }, ]) }) - it('should provide two references from imports', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should provide two references from imports', async function(this: TestContext & Context): Promise { const result = await this.service .textDocumentReferences({ textDocument: { @@ -2577,7 +2556,7 @@ export function describeTypeScriptService( }) }) - describe('textDocumentSignatureHelp()', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentSignatureHelp()', () => { beforeEach( initializeTypeScriptService( createService, @@ -2622,7 +2601,7 @@ export function describeTypeScriptService( afterEach(shutdownService) it('should provide a valid empty response when no signature is found', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SignatureHelp = await this.service .textDocumentSignatureHelp({ textDocument: { @@ -2643,7 +2622,7 @@ export function describeTypeScriptService( }) it('should provide signature help with parameters in the same file', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: SignatureHelp = await this.service .textDocumentSignatureHelp({ textDocument: { @@ -2678,8 +2657,9 @@ export function describeTypeScriptService( }) }) - it('should provide signature help from imported symbols', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should provide signature help from imported symbols', async function(this: TestContext & Context): Promise< + void + > { const result: SignatureHelp = await this.service .textDocumentSignatureHelp({ textDocument: { @@ -2706,7 +2686,7 @@ export function describeTypeScriptService( }) }) - describe('textDocumentCompletion() with snippets', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentCompletion() with snippets', () => { beforeEach( initializeTypeScriptService( createService, @@ -2745,7 +2725,7 @@ export function describeTypeScriptService( afterEach(shutdownService) - it('should produce completions', async function(this: TestContext & ITestCallbackContext): Promise { + it('should produce completions', async function(this: TestContext & Context): Promise { const result: CompletionList = await this.service .textDocumentCompletion({ textDocument: { @@ -2803,8 +2783,7 @@ export function describeTypeScriptService( ]) }) - it('should resolve completions with snippets', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should resolve completions with snippets', async function(this: TestContext & Context): Promise { const result: CompletionList = await this.service .textDocumentCompletion({ textDocument: { @@ -2879,7 +2858,7 @@ export function describeTypeScriptService( }) }) - describe('textDocumentCompletion()', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentCompletion()', () => { beforeEach( initializeTypeScriptService( createService, @@ -2919,9 +2898,7 @@ export function describeTypeScriptService( afterEach(shutdownService) - it('produces completions in the same file', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('produces completions in the same file', async function(this: TestContext & Context): Promise { const result: CompletionList = await this.service .textDocumentCompletion({ textDocument: { @@ -2979,9 +2956,7 @@ export function describeTypeScriptService( ]) }) - it('resolves completions in the same file', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('resolves completions in the same file', async function(this: TestContext & Context): Promise { const result: CompletionList = await this.service .textDocumentCompletion({ textDocument: { @@ -3048,8 +3023,7 @@ export function describeTypeScriptService( ]) }) - it('produces completions for imported symbols', async function(this: TestContext & - ITestCallbackContext): Promise { + it('produces completions for imported symbols', async function(this: TestContext & Context): Promise { const result: CompletionList = await this.service .textDocumentCompletion({ textDocument: { @@ -3078,8 +3052,7 @@ export function describeTypeScriptService( ], }) }) - it('produces completions for referenced symbols', async function(this: TestContext & - ITestCallbackContext): Promise { + it('produces completions for referenced symbols', async function(this: TestContext & Context): Promise { const result: CompletionList = await this.service .textDocumentCompletion({ textDocument: { @@ -3108,9 +3081,7 @@ export function describeTypeScriptService( ], }) }) - it('produces completions for empty files', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('produces completions for empty files', async function(this: TestContext & Context): Promise { this.timeout(10000) const result: CompletionList = await this.service .textDocumentCompletion({ @@ -3128,7 +3099,7 @@ export function describeTypeScriptService( }) }) - describe('textDocumentRename()', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentRename()', () => { beforeEach( initializeTypeScriptService( createService, @@ -3160,9 +3131,7 @@ export function describeTypeScriptService( afterEach(shutdownService) - it('should error on an invalid symbol', async function(this: TestContext & ITestCallbackContext): Promise< - void - > { + it('should error on an invalid symbol', async function(this: TestContext & Context): Promise { await Promise.resolve( assert.isRejected( this.service @@ -3183,7 +3152,7 @@ export function describeTypeScriptService( ) }) it('should return a correct WorkspaceEdit to rename a class', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: WorkspaceEdit = await this.service .textDocumentRename({ textDocument: { @@ -3231,7 +3200,7 @@ export function describeTypeScriptService( }) }) it('should return a correct WorkspaceEdit to rename an imported function', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result: WorkspaceEdit = await this.service .textDocumentRename({ textDocument: { @@ -3295,7 +3264,7 @@ export function describeTypeScriptService( }) }) - describe('textDocumentCodeAction()', function(this: TestContext & ISuiteCallbackContext): void { + describe('textDocumentCodeAction()', () => { beforeEach( initializeTypeScriptService( createService, @@ -3319,7 +3288,7 @@ export function describeTypeScriptService( afterEach(shutdownService) - it('suggests a missing this', async function(this: TestContext & ITestCallbackContext): Promise { + it('suggests a missing this', async function(this: TestContext & Context): Promise { await this.service.textDocumentDidOpen({ textDocument: { uri: rootUri + 'a.ts', @@ -3379,7 +3348,7 @@ export function describeTypeScriptService( }) }) - describe('workspaceExecuteCommand()', function(this: TestContext & ISuiteCallbackContext): void { + describe('workspaceExecuteCommand()', () => { beforeEach( initializeTypeScriptService( createService, @@ -3405,7 +3374,7 @@ export function describeTypeScriptService( describe('codeFix', () => { it('should apply a WorkspaceEdit for the passed FileTextChanges', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { await this.service .workspaceExecuteCommand({ command: 'codeFix', @@ -3451,7 +3420,7 @@ export function describeTypeScriptService( }) }) - describe('Special file names', function(this: TestContext & ISuiteCallbackContext): void { + describe('Special file names', () => { beforeEach( initializeTypeScriptService( createService, @@ -3468,8 +3437,9 @@ export function describeTypeScriptService( afterEach(shutdownService) - it('should accept files with TypeScript keywords in path', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should accept files with TypeScript keywords in path', async function(this: TestContext & Context): Promise< + void + > { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -3496,8 +3466,9 @@ export function describeTypeScriptService( contents: [{ language: 'typescript', value: 'function a(): void' }, '**function** _(exported)_'], }) }) - it('should accept files with special characters in path', async function(this: TestContext & - ITestCallbackContext): Promise { + it('should accept files with special characters in path', async function(this: TestContext & Context): Promise< + void + > { const result: Hover = await this.service .textDocumentHover({ textDocument: { @@ -3525,7 +3496,7 @@ export function describeTypeScriptService( }) }) it('should handle Windows-style paths in triple slash references', async function(this: TestContext & - ITestCallbackContext): Promise { + Context): Promise { const result = await this.service .textDocumentDefinition({ textDocument: { diff --git a/src/typescript-service.ts b/src/typescript-service.ts index 38a14267a..5b1f055e9 100644 --- a/src/typescript-service.ts +++ b/src/typescript-service.ts @@ -413,24 +413,28 @@ export class TypeScriptService { ? configuration.getService().getTypeDefinitionAtPosition(fileName, offset) : configuration.getService().getDefinitionAtPosition(fileName, offset) - return Observable.from(definitions || []).map((definition): Location => { - const sourceFile = this._getSourceFile(configuration, definition.fileName, span) - if (!sourceFile) { - throw new Error('expected source file "' + definition.fileName + '" to exist in configuration') - } - const start = ts.getLineAndCharacterOfPosition(sourceFile, definition.textSpan.start) - const end = ts.getLineAndCharacterOfPosition( - sourceFile, - definition.textSpan.start + definition.textSpan.length - ) - return { - uri: locationUri(definition.fileName), - range: { - start, - end, - }, + return Observable.from(definitions || []).map( + (definition): Location => { + const sourceFile = this._getSourceFile(configuration, definition.fileName, span) + if (!sourceFile) { + throw new Error( + 'expected source file "' + definition.fileName + '" to exist in configuration' + ) + } + const start = ts.getLineAndCharacterOfPosition(sourceFile, definition.textSpan.start) + const end = ts.getLineAndCharacterOfPosition( + sourceFile, + definition.textSpan.start + definition.textSpan.length + ) + return { + uri: locationUri(definition.fileName), + range: { + start, + end, + }, + } } - }) + ) }) } @@ -484,35 +488,44 @@ export class TypeScriptService { // Query TypeScript for references return Observable.from( configuration.getService().getDefinitionAtPosition(fileName, offset) || [] - ).mergeMap((definition: ts.DefinitionInfo): Observable => { - const definitionUri = locationUri(definition.fileName) - // Get the PackageDescriptor - return this._getPackageDescriptor(definitionUri) - .defaultIfEmpty(undefined) - .map((packageDescriptor: PackageDescriptor | undefined): SymbolLocationInformation => { - const sourceFile = this._getSourceFile(configuration, definition.fileName, span) - if (!sourceFile) { - throw new Error(`Expected source file ${definition.fileName} to exist in configuration`) - } - const symbol = definitionInfoToSymbolDescriptor(definition, this.root) - if (packageDescriptor) { - symbol.package = packageDescriptor - } - return { - symbol, - location: { - uri: definitionUri, - range: { - start: ts.getLineAndCharacterOfPosition(sourceFile, definition.textSpan.start), - end: ts.getLineAndCharacterOfPosition( - sourceFile, - definition.textSpan.start + definition.textSpan.length - ), - }, - }, - } - }) - }) + ).mergeMap( + (definition: ts.DefinitionInfo): Observable => { + const definitionUri = locationUri(definition.fileName) + // Get the PackageDescriptor + return this._getPackageDescriptor(definitionUri) + .defaultIfEmpty(undefined) + .map( + (packageDescriptor: PackageDescriptor | undefined): SymbolLocationInformation => { + const sourceFile = this._getSourceFile(configuration, definition.fileName, span) + if (!sourceFile) { + throw new Error( + `Expected source file ${definition.fileName} to exist in configuration` + ) + } + const symbol = definitionInfoToSymbolDescriptor(definition, this.root) + if (packageDescriptor) { + symbol.package = packageDescriptor + } + return { + symbol, + location: { + uri: definitionUri, + range: { + start: ts.getLineAndCharacterOfPosition( + sourceFile, + definition.textSpan.start + ), + end: ts.getLineAndCharacterOfPosition( + sourceFile, + definition.textSpan.start + definition.textSpan.length + ), + }, + }, + } + } + ) + } + ) }) } @@ -542,24 +555,28 @@ export class TypeScriptService { }) // Fetch the package.json of the dependency return this.updater.ensure(packageJsonUri, span).concat( - Observable.defer((): Observable => { - const packageJson: PackageJson = JSON.parse(this.inMemoryFileSystem.getContent(packageJsonUri)) - const { name, version } = packageJson - if (!name) { - return Observable.empty() - } - // Used by the LSP proxy to shortcut database lookup of repo URL for PackageDescriptor - let repoURL: string | undefined - if (name.startsWith('@types/')) { - // if the dependency package is an @types/ package, point the repo to DefinitelyTyped - repoURL = 'https://github.com/DefinitelyTyped/DefinitelyTyped' - } else { - // else use repository field from package.json - repoURL = - typeof packageJson.repository === 'object' ? packageJson.repository.url : undefined + Observable.defer( + (): Observable => { + const packageJson: PackageJson = JSON.parse( + this.inMemoryFileSystem.getContent(packageJsonUri) + ) + const { name, version } = packageJson + if (!name) { + return Observable.empty() + } + // Used by the LSP proxy to shortcut database lookup of repo URL for PackageDescriptor + let repoURL: string | undefined + if (name.startsWith('@types/')) { + // if the dependency package is an @types/ package, point the repo to DefinitelyTyped + repoURL = 'https://github.com/DefinitelyTyped/DefinitelyTyped' + } else { + // else use repository field from package.json + repoURL = + typeof packageJson.repository === 'object' ? packageJson.repository.url : undefined + } + return Observable.of({ name, version, repoURL }) } - return Observable.of({ name, version, repoURL }) - }) + ) ) } else { // The symbol is defined in the root package of the workspace, not in a dependency @@ -606,72 +623,74 @@ export class TypeScriptService { return this.projectManager .ensureReferencedFiles(uri, undefined, undefined, span) .toArray() - .map((): Hover => { - const fileName: string = uri2path(uri) - const configuration = this.projectManager.getConfiguration(fileName) - configuration.ensureBasicFiles(span) + .map( + (): Hover => { + const fileName: string = uri2path(uri) + const configuration = this.projectManager.getConfiguration(fileName) + configuration.ensureBasicFiles(span) - const sourceFile = this._getSourceFile(configuration, fileName, span) - if (!sourceFile) { - throw new Error(`Unknown text document ${uri}`) - } - const offset: number = ts.getPositionOfLineAndCharacter( - sourceFile, - params.position.line, - params.position.character - ) - const info = configuration.getService().getQuickInfoAtPosition(fileName, offset) - if (!info) { - return { contents: [] } - } - const contents: (MarkedString | string)[] = [] - // Add declaration without the kind - const declaration = ts.displayPartsToString(info.displayParts).replace(/^\(.+?\)\s+/, '') - contents.push({ language: 'typescript', value: declaration }) - // Add kind with modifiers, e.g. "method (private, ststic)", "class (exported)" - if (info.kind) { - let kind = '**' + info.kind + '**' - const modifiers = info.kindModifiers - .split(',') - // Filter out some quirks like "constructor (exported)" - .filter( - mod => - mod && - (mod !== ts.ScriptElementKindModifier.exportedModifier || - info.kind !== ts.ScriptElementKind.constructorImplementationElement) - ) - // Make proper adjectives - .map(mod => { - switch (mod) { - case ts.ScriptElementKindModifier.ambientModifier: - return 'ambient' - case ts.ScriptElementKindModifier.exportedModifier: - return 'exported' - default: - return mod - } - }) - if (modifiers.length > 0) { - kind += ' _(' + modifiers.join(', ') + ')_' + const sourceFile = this._getSourceFile(configuration, fileName, span) + if (!sourceFile) { + throw new Error(`Unknown text document ${uri}`) + } + const offset: number = ts.getPositionOfLineAndCharacter( + sourceFile, + params.position.line, + params.position.character + ) + const info = configuration.getService().getQuickInfoAtPosition(fileName, offset) + if (!info) { + return { contents: [] } + } + const contents: (MarkedString | string)[] = [] + // Add declaration without the kind + const declaration = ts.displayPartsToString(info.displayParts).replace(/^\(.+?\)\s+/, '') + contents.push({ language: 'typescript', value: declaration }) + // Add kind with modifiers, e.g. "method (private, ststic)", "class (exported)" + if (info.kind) { + let kind = '**' + info.kind + '**' + const modifiers = info.kindModifiers + .split(',') + // Filter out some quirks like "constructor (exported)" + .filter( + mod => + mod && + (mod !== ts.ScriptElementKindModifier.exportedModifier || + info.kind !== ts.ScriptElementKind.constructorImplementationElement) + ) + // Make proper adjectives + .map(mod => { + switch (mod) { + case ts.ScriptElementKindModifier.ambientModifier: + return 'ambient' + case ts.ScriptElementKindModifier.exportedModifier: + return 'exported' + default: + return mod + } + }) + if (modifiers.length > 0) { + kind += ' _(' + modifiers.join(', ') + ')_' + } + contents.push(kind) + } + // Add documentation + const documentation = ts.displayPartsToString(info.documentation) + if (documentation) { + contents.push(documentation) + } + const start = ts.getLineAndCharacterOfPosition(sourceFile, info.textSpan.start) + const end = ts.getLineAndCharacterOfPosition(sourceFile, info.textSpan.start + info.textSpan.length) + + return { + contents, + range: { + start, + end, + }, } - contents.push(kind) - } - // Add documentation - const documentation = ts.displayPartsToString(info.documentation) - if (documentation) { - contents.push(documentation) - } - const start = ts.getLineAndCharacterOfPosition(sourceFile, info.textSpan.start) - const end = ts.getLineAndCharacterOfPosition(sourceFile, info.textSpan.start + info.textSpan.length) - - return { - contents, - range: { - start, - end, - }, } - }) + ) } /** @@ -725,25 +744,27 @@ export class TypeScriptService { // Filter references in node_modules !reference.fileName.includes('/node_modules/') ) - .map((reference): Location => { - const sourceFile = program.getSourceFile(reference.fileName) - if (!sourceFile) { - throw new Error(`Source file ${reference.fileName} does not exist`) - } - // Convert offset to line/character position - const start = ts.getLineAndCharacterOfPosition(sourceFile, reference.textSpan.start) - const end = ts.getLineAndCharacterOfPosition( - sourceFile, - reference.textSpan.start + reference.textSpan.length - ) - return { - uri: path2uri(reference.fileName), - range: { - start, - end, - }, + .map( + (reference): Location => { + const sourceFile = program.getSourceFile(reference.fileName) + if (!sourceFile) { + throw new Error(`Source file ${reference.fileName} does not exist`) + } + // Convert offset to line/character position + const start = ts.getLineAndCharacterOfPosition(sourceFile, reference.textSpan.start) + const end = ts.getLineAndCharacterOfPosition( + sourceFile, + reference.textSpan.start + reference.textSpan.length + ) + return { + uri: path2uri(reference.fileName), + range: { + start, + end, + }, + } } - }) + ) }) ) .map((location: Location): Operation => ({ op: 'add', path: '/-', value: location })) @@ -769,87 +790,91 @@ export class TypeScriptService { const scores: number[] = [] let observable = this.isDefinitelyTyped - .mergeMap((isDefinitelyTyped: boolean): Observable<[number, SymbolInformation]> => { - // Use special logic for DefinitelyTyped - // Search only in the correct subdirectory for the given PackageDescriptor - if (isDefinitelyTyped) { - // Error if not passed a SymbolDescriptor query with an `@types` PackageDescriptor - if ( - !params.symbol || - !params.symbol.package || - !params.symbol.package.name || - !params.symbol.package.name.startsWith('@types/') - ) { - return Observable.throw( - new Error( - 'workspace/symbol on DefinitelyTyped is only supported with a SymbolDescriptor query with an @types PackageDescriptor' + .mergeMap( + (isDefinitelyTyped: boolean): Observable<[number, SymbolInformation]> => { + // Use special logic for DefinitelyTyped + // Search only in the correct subdirectory for the given PackageDescriptor + if (isDefinitelyTyped) { + // Error if not passed a SymbolDescriptor query with an `@types` PackageDescriptor + if ( + !params.symbol || + !params.symbol.package || + !params.symbol.package.name || + !params.symbol.package.name.startsWith('@types/') + ) { + return Observable.throw( + new Error( + 'workspace/symbol on DefinitelyTyped is only supported with a SymbolDescriptor query with an @types PackageDescriptor' + ) ) - ) - } + } - // Fetch all files in the package subdirectory - // All packages are in the types/ subdirectory - const normRootUri = this.rootUri.endsWith('/') ? this.rootUri : this.rootUri + '/' - const packageRootUri = normRootUri + params.symbol.package.name.substr(1) + '/' - - return this.updater - .ensureStructure(span) - .concat(Observable.defer(() => observableFromIterable(this.inMemoryFileSystem.uris()))) - .filter(uri => uri.startsWith(packageRootUri)) - .mergeMap(uri => this.updater.ensure(uri, span)) - .concat( - Observable.defer(() => { - span.log({ event: 'fetched package files' }) - const config = this.projectManager.getParentConfiguration(packageRootUri, 'ts') - if (!config) { - throw new Error(`Could not find tsconfig for ${packageRootUri}`) - } - // Don't match PackageDescriptor on symbols - return this._getSymbolsInConfig(config, omit(params.symbol!, 'package'), span) - }) - ) - } - // Regular workspace symbol search - // Search all symbols in own code, but not in dependencies - return ( - this.projectManager - .ensureOwnFiles(span) - .concat( - Observable.defer(() => { - if (params.symbol && params.symbol.package && params.symbol.package.name) { - // If SymbolDescriptor query with PackageDescriptor, search for package.jsons with matching package name - return ( - observableFromIterable(this.packageManager.packageJsonUris()) - .filter( - packageJsonUri => - (JSON.parse( - this.inMemoryFileSystem.getContent(packageJsonUri) - ) as PackageJson).name === params.symbol!.package!.name - ) - // Find their parent and child tsconfigs - .mergeMap(packageJsonUri => - Observable.merge( - castArray( - this.projectManager.getParentConfiguration(packageJsonUri) || [] - ), - // Search child directories starting at the directory of the package.json - observableFromIterable( - this.projectManager.getChildConfigurations( - url.resolve(packageJsonUri, '.') + // Fetch all files in the package subdirectory + // All packages are in the types/ subdirectory + const normRootUri = this.rootUri.endsWith('/') ? this.rootUri : this.rootUri + '/' + const packageRootUri = normRootUri + params.symbol.package.name.substr(1) + '/' + + return this.updater + .ensureStructure(span) + .concat(Observable.defer(() => observableFromIterable(this.inMemoryFileSystem.uris()))) + .filter(uri => uri.startsWith(packageRootUri)) + .mergeMap(uri => this.updater.ensure(uri, span)) + .concat( + Observable.defer(() => { + span.log({ event: 'fetched package files' }) + const config = this.projectManager.getParentConfiguration(packageRootUri, 'ts') + if (!config) { + throw new Error(`Could not find tsconfig for ${packageRootUri}`) + } + // Don't match PackageDescriptor on symbols + return this._getSymbolsInConfig(config, omit(params.symbol!, 'package'), span) + }) + ) + } + // Regular workspace symbol search + // Search all symbols in own code, but not in dependencies + return ( + this.projectManager + .ensureOwnFiles(span) + .concat( + Observable.defer(() => { + if (params.symbol && params.symbol.package && params.symbol.package.name) { + // If SymbolDescriptor query with PackageDescriptor, search for package.jsons with matching package name + return ( + observableFromIterable(this.packageManager.packageJsonUris()) + .filter( + packageJsonUri => + (JSON.parse( + this.inMemoryFileSystem.getContent(packageJsonUri) + ) as PackageJson).name === params.symbol!.package!.name + ) + // Find their parent and child tsconfigs + .mergeMap(packageJsonUri => + Observable.merge( + castArray( + this.projectManager.getParentConfiguration( + packageJsonUri + ) || [] + ), + // Search child directories starting at the directory of the package.json + observableFromIterable( + this.projectManager.getChildConfigurations( + url.resolve(packageJsonUri, '.') + ) ) ) ) - ) - ) - } - // Else search all tsconfigs in the workspace - return observableFromIterable(this.projectManager.configurations()) - }) - ) - // If PackageDescriptor is given, only search project with the matching package name - .mergeMap(config => this._getSymbolsInConfig(config, params.query || params.symbol, span)) - ) - }) + ) + } + // Else search all tsconfigs in the workspace + return observableFromIterable(this.projectManager.configurations()) + }) + ) + // If PackageDescriptor is given, only search project with the matching package name + .mergeMap(config => this._getSymbolsInConfig(config, params.query || params.symbol, span)) + ) + } + ) // Filter duplicate symbols // There may be few configurations that contain the same file(s) // or files from different configurations may refer to the same file(s) @@ -1003,16 +1028,18 @@ export class TypeScriptService { return symbol }) }) - .map((symbol: SymbolDescriptor): ReferenceInformation => ({ - symbol, - reference: { - uri: locationUri(source.fileName), - range: { - start: ts.getLineAndCharacterOfPosition(source, node.pos), - end: ts.getLineAndCharacterOfPosition(source, node.end), + .map( + (symbol: SymbolDescriptor): ReferenceInformation => ({ + symbol, + reference: { + uri: locationUri(source.fileName), + range: { + start: ts.getLineAndCharacterOfPosition(source, node.pos), + end: ts.getLineAndCharacterOfPosition(source, node.end), + }, }, - }, - })) + }) + ) } catch (err) { // Continue with next node on error // Workaround for https://github.com/Microsoft/TypeScript/issues/15219 @@ -1053,72 +1080,82 @@ export class TypeScriptService { */ public workspaceXpackages(params = {}, span = new Span()): Observable { return this.isDefinitelyTyped - .mergeMap((isDefinitelyTyped: boolean): Observable => { - // In DefinitelyTyped, report all @types/ packages - if (isDefinitelyTyped) { - const typesUri = url.resolve(this.rootUri, 'types/') + .mergeMap( + (isDefinitelyTyped: boolean): Observable => { + // In DefinitelyTyped, report all @types/ packages + if (isDefinitelyTyped) { + const typesUri = url.resolve(this.rootUri, 'types/') + return ( + observableFromIterable(this.inMemoryFileSystem.uris()) + // Find all types/ subdirectories + .filter(uri => uri.startsWith(typesUri)) + // Get the directory names + .map( + (uri): PackageInformation => ({ + package: { + name: + '@types/' + + decodeURIComponent(uri.substr(typesUri.length).split('/')[0]), + // TODO report a version by looking at subfolders like v6 + }, + // TODO parse /// comments in .d.ts files for collecting dependencies between @types packages + dependencies: [], + }) + ) + ) + } + // For other workspaces, search all package.json files return ( - observableFromIterable(this.inMemoryFileSystem.uris()) - // Find all types/ subdirectories - .filter(uri => uri.startsWith(typesUri)) - // Get the directory names - .map((uri): PackageInformation => ({ - package: { - name: '@types/' + decodeURIComponent(uri.substr(typesUri.length).split('/')[0]), - // TODO report a version by looking at subfolders like v6 - }, - // TODO parse /// comments in .d.ts files for collecting dependencies between @types packages - dependencies: [], - })) + this.projectManager + .ensureModuleStructure(span) + // Iterate all files + .concat(Observable.defer(() => observableFromIterable(this.inMemoryFileSystem.uris()))) + // Filter own package.jsons + .filter(uri => uri.includes('/package.json') && !uri.includes('/node_modules/')) + // Map to contents of package.jsons + .mergeMap(uri => this.packageManager.getPackageJson(uri)) + // Map each package.json to a PackageInformation + .mergeMap(packageJson => { + if (!packageJson.name) { + return [] + } + const packageDescriptor: PackageDescriptor = { + name: packageJson.name, + version: packageJson.version, + repoURL: + (typeof packageJson.repository === 'object' && packageJson.repository.url) || + undefined, + } + // Collect all dependencies for this package.json + return ( + Observable.from(DEPENDENCY_KEYS) + .filter(key => !!packageJson[key]) + // Get [name, version] pairs + .mergeMap(key => toPairs(packageJson[key])) + // Map to DependencyReferences + .map( + ([name, version]): DependencyReference => ({ + attributes: { + name, + version, + }, + hints: { + dependeePackageName: packageJson.name, + }, + }) + ) + .toArray() + .map( + (dependencies): PackageInformation => ({ + package: packageDescriptor, + dependencies, + }) + ) + ) + }) ) } - // For other workspaces, search all package.json files - return ( - this.projectManager - .ensureModuleStructure(span) - // Iterate all files - .concat(Observable.defer(() => observableFromIterable(this.inMemoryFileSystem.uris()))) - // Filter own package.jsons - .filter(uri => uri.includes('/package.json') && !uri.includes('/node_modules/')) - // Map to contents of package.jsons - .mergeMap(uri => this.packageManager.getPackageJson(uri)) - // Map each package.json to a PackageInformation - .mergeMap(packageJson => { - if (!packageJson.name) { - return [] - } - const packageDescriptor: PackageDescriptor = { - name: packageJson.name, - version: packageJson.version, - repoURL: - (typeof packageJson.repository === 'object' && packageJson.repository.url) || - undefined, - } - // Collect all dependencies for this package.json - return ( - Observable.from(DEPENDENCY_KEYS) - .filter(key => !!packageJson[key]) - // Get [name, version] pairs - .mergeMap(key => toPairs(packageJson[key])) - // Map to DependencyReferences - .map(([name, version]): DependencyReference => ({ - attributes: { - name, - version, - }, - hints: { - dependeePackageName: packageJson.name, - }, - })) - .toArray() - .map((dependencies): PackageInformation => ({ - package: packageDescriptor, - dependencies, - })) - ) - }) - ) - }) + ) .map((packageInfo): Operation => ({ op: 'add', path: '/-', value: packageInfo })) .startWith({ op: 'add', path: '', value: [] }) } @@ -1146,15 +1183,17 @@ export class TypeScriptService { .filter(key => !!packageJson[key]) // Get [name, version] pairs .mergeMap(key => toPairs(packageJson[key])) - .map(([name, version]): DependencyReference => ({ - attributes: { - name, - version, - }, - hints: { - dependeePackageName: packageJson.name, - }, - })) + .map( + ([name, version]): DependencyReference => ({ + attributes: { + name, + version, + }, + hints: { + dependeePackageName: packageJson.name, + }, + }) + ) ) .map((dependency): Operation => ({ op: 'add', path: '/-', value: dependency })) .startWith({ op: 'add', path: '', value: [] }) @@ -1292,49 +1331,55 @@ export class TypeScriptService { return this.projectManager .ensureReferencedFiles(uri, undefined, undefined, span) .toArray() - .map((): SignatureHelp => { - const filePath = uri2path(uri) - const configuration = this.projectManager.getConfiguration(filePath) - configuration.ensureBasicFiles(span) + .map( + (): SignatureHelp => { + const filePath = uri2path(uri) + const configuration = this.projectManager.getConfiguration(filePath) + configuration.ensureBasicFiles(span) - const sourceFile = this._getSourceFile(configuration, filePath, span) - if (!sourceFile) { - throw new Error(`expected source file ${filePath} to exist in configuration`) - } - const offset: number = ts.getPositionOfLineAndCharacter( - sourceFile, - params.position.line, - params.position.character - ) + const sourceFile = this._getSourceFile(configuration, filePath, span) + if (!sourceFile) { + throw new Error(`expected source file ${filePath} to exist in configuration`) + } + const offset: number = ts.getPositionOfLineAndCharacter( + sourceFile, + params.position.line, + params.position.character + ) - const signatures: ts.SignatureHelpItems | undefined = configuration - .getService() - .getSignatureHelpItems(filePath, offset, undefined) - if (!signatures) { - return { signatures: [], activeParameter: 0, activeSignature: 0 } - } + const signatures: + | ts.SignatureHelpItems + | undefined = configuration.getService().getSignatureHelpItems(filePath, offset, undefined) + if (!signatures) { + return { signatures: [], activeParameter: 0, activeSignature: 0 } + } + + const signatureInformations = signatures.items.map( + (item): SignatureInformation => { + const prefix = ts.displayPartsToString(item.prefixDisplayParts) + const params = item.parameters.map(p => ts.displayPartsToString(p.displayParts)).join(', ') + const suffix = ts.displayPartsToString(item.suffixDisplayParts) + const parameters = item.parameters.map( + (p): ParameterInformation => ({ + label: ts.displayPartsToString(p.displayParts), + documentation: ts.displayPartsToString(p.documentation), + }) + ) + return { + label: prefix + params + suffix, + documentation: ts.displayPartsToString(item.documentation), + parameters, + } + } + ) - const signatureInformations = signatures.items.map((item): SignatureInformation => { - const prefix = ts.displayPartsToString(item.prefixDisplayParts) - const params = item.parameters.map(p => ts.displayPartsToString(p.displayParts)).join(', ') - const suffix = ts.displayPartsToString(item.suffixDisplayParts) - const parameters = item.parameters.map((p): ParameterInformation => ({ - label: ts.displayPartsToString(p.displayParts), - documentation: ts.displayPartsToString(p.documentation), - })) return { - label: prefix + params + suffix, - documentation: ts.displayPartsToString(item.documentation), - parameters, + signatures: signatureInformations, + activeSignature: signatures.selectedItemIndex, + activeParameter: signatures.argumentIndex, } - }) - - return { - signatures: signatureInformations, - activeSignature: signatures.selectedItemIndex, - activeParameter: signatures.argumentIndex, } - }) + ) .map(signatureHelp => ({ op: 'add', path: '', value: signatureHelp } as Operation)) } @@ -1385,15 +1430,17 @@ export class TypeScriptService { .getCodeFixesAtPosition(filePath, start, end, errorCodes, this.settings.format || {}, {}) || [] ) }) - .map((action: ts.CodeAction): Operation => ({ - op: 'add', - path: '/-', - value: { - title: action.description, - command: 'codeFix', - arguments: action.changes, - } as Command, - })) + .map( + (action: ts.CodeAction): Operation => ({ + op: 'add', + path: '/-', + value: { + title: action.description, + command: 'codeFix', + arguments: action.changes, + } as Command, + }) + ) .startWith({ op: 'add', path: '', value: [] } as Operation) } @@ -1445,13 +1492,15 @@ export class TypeScriptService { throw new Error(`Expected source file ${change.fileName} to exist in configuration`) } const uri = path2uri(change.fileName) - changes[uri] = change.textChanges.map(({ span, newText }): TextEdit => ({ - range: { - start: ts.getLineAndCharacterOfPosition(sourceFile, span.start), - end: ts.getLineAndCharacterOfPosition(sourceFile, span.start + span.length), - }, - newText, - })) + changes[uri] = change.textChanges.map( + ({ span, newText }): TextEdit => ({ + range: { + start: ts.getLineAndCharacterOfPosition(sourceFile, span.start), + end: ts.getLineAndCharacterOfPosition(sourceFile, span.start + span.length), + }, + newText, + }) + ) } return this.client.workspaceApplyEdit({ edit: { changes } }, span) @@ -1497,31 +1546,35 @@ export class TypeScriptService { return Observable.from( configuration.getService().findRenameLocations(filePath, position, false, true) || [] - ).map((location: ts.RenameLocation): [string, TextEdit] => { - const sourceFile = this._getSourceFile(configuration, location.fileName, span) - if (!sourceFile) { - throw new Error(`expected source file ${location.fileName} to exist in configuration`) + ).map( + (location: ts.RenameLocation): [string, TextEdit] => { + const sourceFile = this._getSourceFile(configuration, location.fileName, span) + if (!sourceFile) { + throw new Error(`expected source file ${location.fileName} to exist in configuration`) + } + const editUri = path2uri(location.fileName) + const start = ts.getLineAndCharacterOfPosition(sourceFile, location.textSpan.start) + const end = ts.getLineAndCharacterOfPosition( + sourceFile, + location.textSpan.start + location.textSpan.length + ) + const edit: TextEdit = { range: { start, end }, newText: params.newName } + return [editUri, edit] } - const editUri = path2uri(location.fileName) - const start = ts.getLineAndCharacterOfPosition(sourceFile, location.textSpan.start) - const end = ts.getLineAndCharacterOfPosition( - sourceFile, - location.textSpan.start + location.textSpan.length - ) - const edit: TextEdit = { range: { start, end }, newText: params.newName } - return [editUri, edit] - }) + ) }) ) - .map(([uri, edit]): Operation => { - // if file has no edit yet, initialize array - if (!editUris.has(uri)) { - editUris.add(uri) - return { op: 'add', path: JSONPTR`/changes/${uri}`, value: [edit] } + .map( + ([uri, edit]): Operation => { + // if file has no edit yet, initialize array + if (!editUris.has(uri)) { + editUris.add(uri) + return { op: 'add', path: JSONPTR`/changes/${uri}`, value: [edit] } + } + // else append to array + return { op: 'add', path: JSONPTR`/changes/${uri}/-`, value: edit } } - // else append to array - return { op: 'add', path: JSONPTR`/changes/${uri}/-`, value: edit } - }) + ) .startWith({ op: 'add', path: '', value: { changes: {} } as WorkspaceEdit } as Operation) }