diff --git a/package-lock.json b/package-lock.json index b3205f9d2f..8ec555df23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -278,22 +278,35 @@ } }, "@commitlint/cli": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-8.1.0.tgz", - "integrity": "sha512-83K5C2nIAgoZlzMegf0/MEBjX+ampUyc/u79RxgX9ZYjzos+RQtNyO7I43dztVxPXSwAnX9XRgoOfkGWA4nbig==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-8.2.0.tgz", + "integrity": "sha512-8fJ5pmytc38yw2QWbTTJmXLfSiWPwMkHH4govo9zJ/+ERPBF2jvlxD/dQvk24ezcizjKc6LFka2edYC4OQ+Dgw==", "dev": true, "requires": { - "@commitlint/format": "^8.1.0", - "@commitlint/lint": "^8.1.0", - "@commitlint/load": "^8.1.0", - "@commitlint/read": "^8.1.0", + "@commitlint/format": "^8.2.0", + "@commitlint/lint": "^8.2.0", + "@commitlint/load": "^8.2.0", + "@commitlint/read": "^8.2.0", "babel-polyfill": "6.26.0", - "chalk": "2.3.1", + "chalk": "2.4.2", "get-stdin": "7.0.0", "lodash": "4.17.14", "meow": "5.0.0", "resolve-from": "5.0.0", "resolve-global": "1.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } } }, "@commitlint/config-conventional": { @@ -303,68 +316,68 @@ "dev": true }, "@commitlint/ensure": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-8.1.0.tgz", - "integrity": "sha512-dBU4CcjN0vJSDNOeSpaHNgQ1ra444u4USvI6PTaHVAS4aeDpZ5Cds1rxkZNsocu48WNycUu0jP84+zjcw2pPLQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-8.2.0.tgz", + "integrity": "sha512-XZZih/kcRrqK7lEORbSYCfqQw6byfsFbLygRGVdJMlCPGu9E2MjpwCtoj5z7y/lKfUB3MJaBhzn2muJqS1gC6A==", "dev": true, "requires": { "lodash": "4.17.14" } }, "@commitlint/execute-rule": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.1.0.tgz", - "integrity": "sha512-+vpH3RFuO6ypuCqhP2rSqTjFTQ7ClzXtUvXphpROv9v9+7zH4L+Ex+wZLVkL8Xj2cxefSLn/5Kcqa9XyJTn3kg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-8.2.0.tgz", + "integrity": "sha512-9MBRthHaulbWTa8ReG2Oii2qc117NuvzhZdnkuKuYLhker7sUXGFcVhLanuWUKGyfyI2o9zVr/NHsNbCCsTzAA==", "dev": true }, "@commitlint/format": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-8.1.0.tgz", - "integrity": "sha512-D0cmabUTQIKdABgt08d9JAvO9+lMRAmkcsZx8TMScY502R67HCw77JhzRDcw1RmqX5rN8JO6ZjDHO92Pbwlt+Q==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-8.2.0.tgz", + "integrity": "sha512-sA77agkDEMsEMrlGhrLtAg8vRexkOofEEv/CZX+4xlANyAz2kNwJvMg33lcL65CBhqKEnRRJRxfZ1ZqcujdKcQ==", "dev": true, "requires": { "chalk": "^2.0.1" } }, "@commitlint/is-ignored": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-8.1.0.tgz", - "integrity": "sha512-HUSxx6kuLbqrQ8jb5QRzo+yR+CIXgA9HNcIcZ1qWrb+O9GOixt3mlW8li1IcfIgfODlaWoxIz0jYCxR08IoQLg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-8.2.0.tgz", + "integrity": "sha512-ADaGnKfbfV6KD1pETp0Qf7XAyc75xTy3WJlbvPbwZ4oPdBMsXF0oXEEGMis6qABfU2IXan5/KAJgAFX3vdd0jA==", "dev": true, "requires": { "@types/semver": "^6.0.1", - "semver": "6.1.1" + "semver": "6.2.0" }, "dependencies": { "semver": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.1.tgz", - "integrity": "sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.2.0.tgz", + "integrity": "sha512-jdFC1VdUGT/2Scgbimf7FSx9iJLXoqfglSF+gJeuNWVpiE37OIbc1jywR/GJyFdz3mnkz2/id0L0J/cr0izR5A==", "dev": true } } }, "@commitlint/lint": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-8.1.0.tgz", - "integrity": "sha512-WYjbUgtqvnlVH3S3XPZMAa+N7KO0yQ+GuUG20Qra+EtER6SRYawykmEs4wAyrmY8VcFXUnKgSlIQUsqmGKwNZQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-8.2.0.tgz", + "integrity": "sha512-ch9JN8aR37ufdjoWv50jLfvFz9rWMgLW5HEkMGLsM/51gjekmQYS5NJg8S2+6F5+jmralAO7VkUMI6FukXKX0A==", "dev": true, "requires": { - "@commitlint/is-ignored": "^8.1.0", - "@commitlint/parse": "^8.1.0", - "@commitlint/rules": "^8.1.0", + "@commitlint/is-ignored": "^8.2.0", + "@commitlint/parse": "^8.2.0", + "@commitlint/rules": "^8.2.0", "babel-runtime": "^6.23.0", "lodash": "4.17.14" } }, "@commitlint/load": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.1.0.tgz", - "integrity": "sha512-ra02Dvmd7Gp1+uFLzTY3yGOpHjPzl5T9wYg/xrtPJNiOWXvQ0Mw7THw+ucd1M5iLUWjvdavv2N87YDRc428wHg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-8.2.0.tgz", + "integrity": "sha512-EV6PfAY/p83QynNd1llHxJiNxKmp43g8+7dZbyfHFbsGOdokrCnoelAVZ+WGgktXwLN/uXyfkcIAxwac015UYw==", "dev": true, "requires": { - "@commitlint/execute-rule": "^8.1.0", - "@commitlint/resolve-extends": "^8.1.0", + "@commitlint/execute-rule": "^8.2.0", + "@commitlint/resolve-extends": "^8.2.0", "babel-runtime": "^6.23.0", "chalk": "2.4.2", "cosmiconfig": "^5.2.0", @@ -386,15 +399,15 @@ } }, "@commitlint/message": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-8.1.0.tgz", - "integrity": "sha512-AjHq022G8jQQ/3YrBOjwVBD4xF75hvC3vcvFoBIb7cC8vad1QWq+1w+aks0KlEK5IW+/+7ORZXIH+oyW7h3+8A==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-8.2.0.tgz", + "integrity": "sha512-LNsSwDLIFgE3nb/Sb1PIluYNy4Q8igdf4tpJCdv5JJDf7CZCZt3ZTglj0YutZZorpRRuHJsVIB2+dI4bVH3bFw==", "dev": true }, "@commitlint/parse": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-8.1.0.tgz", - "integrity": "sha512-n4fEbZ5kdK5HChvne7Mj8rGGkKMfA4H11IuWiWmmMzgmZTNb/B04LPrzdUm4lm3f10XzM2JMM7PLXqofQJOGvA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-8.2.0.tgz", + "integrity": "sha512-vzouqroTXG6QXApkrps0gbeSYW6w5drpUk7QAeZIcaCSPsQXDM8eqqt98ZzlzLJHo5oPNXPX1AAVSTrssvHemA==", "dev": true, "requires": { "conventional-changelog-angular": "^1.3.3", @@ -403,21 +416,21 @@ } }, "@commitlint/read": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-8.1.0.tgz", - "integrity": "sha512-PKsGMQFEr2sX/+orI71b82iyi8xFqb7F4cTvsLxzB5x6/QutxPVM3rg+tEVdi6rBKIDuqRIp2puDZQuREZs3vg==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-8.2.0.tgz", + "integrity": "sha512-1tBai1VuSQmsOTsvJr3Fi/GZqX3zdxRqYe/yN4i3cLA5S2Y4QGJ5I3l6nGZlKgm/sSelTCVKHltrfWU8s5H7SA==", "dev": true, "requires": { - "@commitlint/top-level": "^8.1.0", + "@commitlint/top-level": "^8.2.0", "@marionebl/sander": "^0.6.0", "babel-runtime": "^6.23.0", "git-raw-commits": "^1.3.0" } }, "@commitlint/resolve-extends": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.1.0.tgz", - "integrity": "sha512-r/y+CeKW72Oa9BUctS1+I/MFCDiI3lfhwfQ65Tpfn6eZ4CuBYKzrCRi++GTHeAFKE3y8q1epJq5Rl/1GBejtBw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-8.2.0.tgz", + "integrity": "sha512-cwi0HUsDcD502HBP8huXfTkVuWmeo1Fiz3GKxNwMBBsJV4+bKa7QrtxbNpXhVuarX7QjWfNTvmW6KmFS7YK9uw==", "dev": true, "requires": { "@types/node": "^12.0.2", @@ -428,35 +441,35 @@ }, "dependencies": { "@types/node": { - "version": "12.7.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.3.tgz", - "integrity": "sha512-3SiLAIBkDWDg6vFo0+5YJyHPWU9uwu40Qe+v+0MH8wRKYBimHvvAOyk3EzMrD/TrIlLYfXrqDqrg913PynrMJQ==", + "version": "12.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.5.tgz", + "integrity": "sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w==", "dev": true } } }, "@commitlint/rules": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-8.1.0.tgz", - "integrity": "sha512-hlM8VfNjsOkbvMteFyqn0c3akiUjqG09Iid28MBLrXl/d+8BR3eTzwJ4wMta4oz/iqGyrIywvg1FpHrV977MPA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-8.2.0.tgz", + "integrity": "sha512-FlqSBBP2Gxt5Ibw+bxdYpzqYR6HI8NIBpaTBhAjSEAduQtdWFMOhF0zsgkwH7lHN7opaLcnY2fXxAhbzTmJQQA==", "dev": true, "requires": { - "@commitlint/ensure": "^8.1.0", - "@commitlint/message": "^8.1.0", - "@commitlint/to-lines": "^8.1.0", + "@commitlint/ensure": "^8.2.0", + "@commitlint/message": "^8.2.0", + "@commitlint/to-lines": "^8.2.0", "babel-runtime": "^6.23.0" } }, "@commitlint/to-lines": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-8.1.0.tgz", - "integrity": "sha512-Lh4OH1bInI8GME/7FggS0/XkIMEJdTObMbXRyPRGaPcWH5S7zpB6y+b4qjzBHXAbEv2O46QAAMjZ+ywPQCpmYQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-8.2.0.tgz", + "integrity": "sha512-LXTYG3sMenlN5qwyTZ6czOULVcx46uMy+MEVqpvCgptqr/MZcV/C2J+S2o1DGwj1gOEFMpqrZaE3/1R2Q+N8ng==", "dev": true }, "@commitlint/top-level": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-8.1.0.tgz", - "integrity": "sha512-EvQuofuA/+0l1w9pkG/PRyIwACmZdIh9qxyax7w7mR8qqmSHscqf2jARIylh1TOx0uI9egO8MuPLiwC1RwyREA==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-8.2.0.tgz", + "integrity": "sha512-Yaw4KmYNy31/HhRUuZ+fupFcDalnfpdu4JGBgGAqS9aBHdMSSWdWqtAaDaxdtWjTZeN3O0sA2gOhXwvKwiDwvw==", "dev": true, "requires": { "find-up": "^4.0.0" @@ -1005,9 +1018,9 @@ } }, "@types/node": { - "version": "10.14.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.18.tgz", - "integrity": "sha512-ryO3Q3++yZC/+b8j8BdKd/dn9JlzlHBPdm80656xwYUdmPkpTGTjkAdt6BByiNupGPE8w0FhBgvYy/fX9hRNGQ==", + "version": "10.14.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.19.tgz", + "integrity": "sha512-j6Sqt38ssdMKutXBUuAcmWF8QtHW1Fwz/mz4Y+Wd9mzpBiVFirjpNQf363hG5itkG+yGaD+oiLyb50HxJ36l9Q==", "dev": true }, "@types/resolve": { @@ -1032,9 +1045,9 @@ "dev": true }, "@types/yargs": { - "version": "13.0.2", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.2.tgz", - "integrity": "sha512-lwwgizwk/bIIU+3ELORkyuOgDjCh7zuWDFqRtPPhhVgq9N1F7CvLNKg1TX4f2duwtKQ0p044Au9r1PLIXHrIzQ==", + "version": "13.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.3.tgz", + "integrity": "sha512-K8/LfZq2duW33XW/tFwEAfnZlqIfVsoyRB3kfXdPXYhl0nfM8mmh7GS0jg7WrX2Dgq/0Ha/pR1PaR+BvmWwjiQ==", "dev": true, "requires": { "@types/yargs-parser": "*" @@ -2268,14 +2281,14 @@ "dev": true }, "cosmiconfig": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.0.tgz", - "integrity": "sha512-nxt+Nfc3JAqf4WIWd0jXLjTJZmsPLrA9DDc4nRw2KFJQJK7DNooqSXrNI7tzLG50CF8axczly5UV929tBmh/7g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", "dev": true, "requires": { "import-fresh": "^2.0.0", "is-directory": "^0.3.1", - "js-yaml": "^3.13.0", + "js-yaml": "^3.13.1", "parse-json": "^4.0.0" }, "dependencies": { @@ -5909,9 +5922,9 @@ "dev": true }, "lint-staged": { - "version": "9.2.5", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.2.5.tgz", - "integrity": "sha512-d99gTBFMJ29159+9iRvaMEQstmNcPAbQbhHSYw6D/1FncvFdIj8lWHztaq3Uq+tbZPABHXQ/fyN7Rp1QwF8HIw==", + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-9.3.0.tgz", + "integrity": "sha512-OuL3xo6XpBErl16+3W9PdnFmgeGp12lM8I1Ii/B56S8Edy1kyrf4W8VD4IBn9v17QlutRQEWUJ54YF/VVQ7J2A==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -5947,18 +5960,6 @@ "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, - "cosmiconfig": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", - "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", - "dev": true, - "requires": { - "import-fresh": "^2.0.0", - "is-directory": "^0.3.1", - "js-yaml": "^3.13.1", - "parse-json": "^4.0.0" - } - }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -6008,6 +6009,12 @@ "resolve-from": "^3.0.0" } }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", @@ -6057,6 +6064,15 @@ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } } } }, @@ -8354,9 +8370,9 @@ } }, "text-extensions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.8.0.tgz", - "integrity": "sha512-mVzjRxuWnDKs/qH1rbOJEVHLlSX9kty9lpi7lMvLgU9S74mQ8/Ozg9UPcKxShh0qG2NZ+NyPOPpcZU4C1Eld9A==", + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true }, "text-table": { diff --git a/src/compiler.ts b/src/compiler.ts index 92ff6f5ca8..d327155199 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -35,7 +35,7 @@ import stableStringify = require('fast-json-stable-stringify') import { readFileSync, writeFileSync } from 'fs' import memoize = require('lodash.memoize') import mkdirp = require('mkdirp') -import { basename, extname, join, relative } from 'path' +import { basename, extname, join, normalize, relative } from 'path' import { ConfigSet } from './config/config-set' import { MemoryCache, TsCompiler, TypeInfo } from './types' @@ -136,7 +136,8 @@ export function createCompiler(configs: ConfigSet): TsCompiler { const serviceHost = { getScriptFileNames: () => Object.keys(memoryCache.versions), getScriptVersion: (fileName: string) => { - const version = memoryCache.versions[fileName] + const normalizedFileName = normalize(fileName) + const version = memoryCache.versions[normalizedFileName] // We need to return `undefined` and not a string here because TypeScript will use // `getScriptVersion` and compare against their own version - which can be `undefined`. @@ -146,14 +147,15 @@ export function createCompiler(configs: ConfigSet): TsCompiler { return version === undefined ? ((undefined as any) as string) : String(version) }, getScriptSnapshot(fileName: string) { - const hit = hasOwn.call(memoryCache.contents, fileName) - logger.trace({ fileName, cacheHit: hit }, `getScriptSnapshot():`, 'cache', hit ? 'hit' : 'miss') + const normalizedFileName = normalize(fileName) + const hit = hasOwn.call(memoryCache.contents, normalizedFileName) + logger.trace({ normalizedFileName, cacheHit: hit }, `getScriptSnapshot():`, 'cache', hit ? 'hit' : 'miss') // Read contents from TypeScript memory cache. if (!hit) { - memoryCache.contents[fileName] = ts.sys.readFile(fileName) + memoryCache.contents[normalizedFileName] = ts.sys.readFile(normalizedFileName) } - const contents = memoryCache.contents[fileName] + const contents = memoryCache.contents[normalizedFileName] if (contents === undefined) { return }