diff --git a/.cirrus.yml b/.cirrus.yml index 13518b55..50e102bd 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,5 +1,5 @@ container: - image: node:10 + image: node:12 windows_task: windows_container: @@ -16,11 +16,19 @@ lint_task: install_script: npm ci test_script: npm run lint +license_task: + install_script: npm ci + test_script: npm run license-check + +system_test_task: + install_script: npm ci + test_script: npm run system-test + test_task: container: matrix: + image: node:13 image: node:12 - image: node:11 image: node:10 image: node:8 install_script: npm ci diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..f0f2a1aa --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +build/ +test/fixtures/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 00000000..cb20a268 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,42 @@ +{ + "extends": [ + "eslint:recommended", + "plugin:node/recommended", + "prettier" + ], + "plugins": [ + "node", + "prettier" + ], + "rules": { + "prettier/prettier": "error", + "block-scoped-var": "error", + "eqeqeq": "error", + "no-warning-comments": "warn", + "no-var": "error", + "prefer-const": "error" + }, + "overrides": [ + { + "files": "**/*.ts", + "parser": "@typescript-eslint/parser", + "extends": [ + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "@typescript-eslint/no-non-null-assertion": "off", + "node/no-missing-import": "off", + "node/no-unsupported-features/es-syntax": "off", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/camelcase": "off", + "node/no-missing-require": "off", + "no-dupe-class-members": "off", + "node/shebang": "off" + }, + "parserOptions": { + "ecmaVersion": 2018, + "sourceType": "module" + } + } + ] +} diff --git a/README.md b/README.md index eac81a78..d43af9c5 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ To borrow from [standardjs][standardjs-url]: - **Catch style issues & programmer errors early**. Save precious code review time by eliminating back-and-forth between reviewer & contributor. - **Opinionated, but not to a fault**. We recommend you use the default configuration, but if you *need* to customize compiler or linter config, you can. -Under the covers, we use [tslint][tslint-url] to enforce the style guide and provide automated fixes, and [prettier][prettier-url] to re-format code. +Under the covers, we use [eslint][eslint-url] to enforce the style guide and provide automated fixes, and [prettier][prettier-url] to re-format code. ## Getting Started @@ -77,4 +77,4 @@ Made with ❤️ by the Google Node.js team. [snyk-image]: https://snyk.io/test/github/google/gts/badge.svg [snyk-url]: https://snyk.io/test/github/google/gts [standardjs-url]: https://www.npmjs.com/package/standard -[tslint-url]: https://palantir.github.io/tslint/ +[eslint-url]: https://eslint.org/ diff --git a/gts-1.1.2.tgz b/gts-1.1.2.tgz new file mode 100644 index 00000000..52e7035b Binary files /dev/null and b/gts-1.1.2.tgz differ diff --git a/package-lock.json b/package-lock.json index 4ba8af72..3b37bda8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,17 +5,17 @@ "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.0.tgz", - "integrity": "sha512-AN2IR/wCUYsM+PdErq6Bp3RFTXl8W0p9Nmymm7zkpsCmh+r/YYcckaCGpU8Q/mEKmST19kkGRaG42A/jxOWwBA==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", "requires": { - "@babel/highlight": "^7.8.0" + "@babel/highlight": "^7.0.0" } }, "@babel/highlight": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.8.0.tgz", - "integrity": "sha512-OsdTJbHlPtIk2mmtwXItYrdmalJ8T0zpVzNAbKSkHshuywj7zb29Y09McV/jQsQunc/nEyHiPV2oy9llYMLqxw==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", "requires": { "chalk": "^2.0.0", "esutils": "^2.0.2", @@ -111,9 +111,9 @@ } }, "@sinonjs/samsam": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.2.tgz", - "integrity": "sha512-z9o4LZUzSD9Hl22zV38aXNykgFeVj8acqfFabCY6FY83n/6s/XwNJyYYldz6/9lBJanpno9h+oL6HTISkviweA==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-4.2.1.tgz", + "integrity": "sha512-7+5S4C4wpug5pzHS+z/63+XUwsH7dtyYELDafoT1QnfruFh7eFjlDWwZXltUB0GLk6y5eMeAt34Bjx8wJ4KfSA==", "dev": true, "requires": { "@sinonjs/commons": "^1.6.0", @@ -135,6 +135,12 @@ "defer-to-connect": "^1.0.1" } }, + "@types/chai": { + "version": "4.2.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz", + "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==", + "dev": true + }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -149,10 +155,25 @@ "@types/node": "*" } }, - "@types/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-mIenTfsIe586/yzsyfql69KRnA75S8SVXQbTLpDejRrjH0QSJcpu3AUOi/Vjnt9IOsXKxPhJfGpQUNMueIU1fQ==", + "@types/eslint": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-6.1.3.tgz", + "integrity": "sha512-llYf1QNZaDweXtA7uY6JczcwHmFwJL9TpK3E6sY0B18l6ulDT6VWNMAdEjYccFHiDfxLPxffd8QmSDV4QUUspA==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "@types/eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==" + }, + "@types/estree": { + "version": "0.0.41", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.41.tgz", + "integrity": "sha512-rIAmXyJlqw4KEBO7+u9gxZZSQHaCNnIzYrnNmYVpgfJhxTqO0brCX0SYpqUTkVI5mwwUwzmtspLBGBKroMeynA==", "dev": true }, "@types/events": { @@ -203,6 +224,11 @@ "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", "dev": true }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==" + }, "@types/meow": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/meow/-/meow-5.0.0.tgz", @@ -297,6 +323,62 @@ "integrity": "sha512-YV+ZcSIiv30GhLM7WwxI+bsbcW34d3Yhl2JSFBNFL6qtfsoI9++hogxz+jTqeS86ynKcMUE0AsnLWQynfJnsfA==", "dev": true }, + "@types/write-file-atomic": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/write-file-atomic/-/write-file-atomic-2.1.2.tgz", + "integrity": "sha512-/P4wq72qka9+JNqDgHe7Kr2Gpu1kmhA0H8tLlKi9G0eXmePiuT9k0izZAdkXXNA6Nb27xnzdgjRv2jZWO3+2oQ==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@typescript-eslint/eslint-plugin": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.14.0.tgz", + "integrity": "sha512-sneOJ3Hu0m5whJiVIxGBZZZMxMJ7c0LhAJzeMJgHo+n5wFs+/6rSR/gl7crkdR2kNwfOOSdzdc0gMvatG4dX2Q==", + "requires": { + "@typescript-eslint/experimental-utils": "2.14.0", + "eslint-utils": "^1.4.3", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.14.0.tgz", + "integrity": "sha512-KcyKS7G6IWnIgl3ZpyxyBCxhkBPV+0a5Jjy2g5HxlrbG2ZLQNFeneIBVXdaBCYOVjvGmGGFKom1kgiAY75SDeQ==", + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.14.0", + "eslint-scope": "^5.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.14.0.tgz", + "integrity": "sha512-haS+8D35fUydIs+zdSf4BxpOartb/DjrZ2IxQ5sR8zyGfd77uT9ZJZYF8+I0WPhzqHmfafUBx8MYpcp8pfaoSA==", + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "2.14.0", + "@typescript-eslint/typescript-estree": "2.14.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.14.0.tgz", + "integrity": "sha512-pnLpUcMNG7GfFFfNQbEX6f1aPa5fMnH2G9By+A1yovYI4VIOK2DzkaRuUlIkbagpAcrxQHLqovI1YWqEcXyRnA==", + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash.unescape": "4.0.1", + "semver": "^6.3.0", + "tsutils": "^3.17.1" + } + }, "abort-controller": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", @@ -306,6 +388,16 @@ "event-target-shim": "^5.0.0" } }, + "acorn": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.1.0.tgz", + "integrity": "sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ==" + }, + "acorn-jsx": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.1.0.tgz", + "integrity": "sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw==" + }, "agent-base": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", @@ -315,6 +407,17 @@ "es6-promisify": "^5.0.0" } }, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", @@ -365,9 +468,9 @@ "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.0.tgz", + "integrity": "sha512-7kFQgnEaMdRtwf6uSfUnVr9gSGC7faurn+J/Mv90/W+iTtN0405/nLdopfMWwchyxhbGYl6TC4Sccn9TUkGAgg==", "requires": { "@types/color-name": "^1.1.1", "color-convert": "^2.0.1" @@ -416,6 +519,17 @@ "is-regexp": "^1.0.0" } }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -479,11 +593,6 @@ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, - "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" - }, "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", @@ -537,9 +646,9 @@ } }, "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -592,14 +701,6 @@ "responselike": "^1.0.2" }, "dependencies": { - "get-stream": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", - "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", - "requires": { - "pump": "^3.0.0" - } - }, "lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", @@ -607,6 +708,11 @@ } } }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" + }, "camelcase": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", @@ -622,6 +728,20 @@ "quick-lru": "^1.0.0" } }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, "chalk": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", @@ -636,6 +756,12 @@ "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, "chokidar": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", @@ -731,11 +857,6 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -775,11 +896,38 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.1.tgz", "integrity": "sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" + }, + "dependencies": { + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + } } }, "crypto-random-string": { @@ -796,10 +944,9 @@ } }, "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "requires": { "ms": "^2.1.1" } @@ -833,11 +980,25 @@ "mimic-response": "^1.0.0" } }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + }, "defer-to-connect": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.1.tgz", @@ -853,9 +1014,18 @@ } }, "diff": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", - "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "requires": { + "esutils": "^2.0.2" + } }, "dot-prop": { "version": "5.2.0", @@ -941,11 +1111,223 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==" + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "eslint-config-prettier": { + "version": "6.9.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.9.0.tgz", + "integrity": "sha512-k4E14HBtcLv0uqThaI6I/n1LEqROp8XaPu6SO9Z32u5NlGRC07Enu1Bh2KEFw4FNHbekH8yzbIU9kUGxbiGmCA==", + "requires": { + "get-stdin": "^6.0.0" + } + }, + "eslint-plugin-es": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-2.0.0.tgz", + "integrity": "sha512-f6fceVtg27BR02EYnBhgWLFQfK6bN4Ll0nQFrBHOlCsAyxeZkn0NHns5O0YZOPrV1B3ramd6cgFwaoFLcSkwEQ==", + "requires": { + "eslint-utils": "^1.4.2", + "regexpp": "^3.0.0" + } + }, + "eslint-plugin-node": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-10.0.0.tgz", + "integrity": "sha512-1CSyM/QCjs6PXaT18+zuAXsjXGIGo5Rw630rSKwokSs2jrYURQc4R5JZpoanNCqwNmepg+0eZ9L7YiRUJb8jiQ==", + "requires": { + "eslint-plugin-es": "^2.0.0", + "eslint-utils": "^1.4.2", + "ignore": "^5.1.1", + "minimatch": "^3.0.4", + "resolve": "^1.10.1", + "semver": "^6.1.0" + }, + "dependencies": { + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==" + } + } + }, + "eslint-plugin-prettier": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.2.tgz", + "integrity": "sha512-GlolCC9y3XZfv3RQfwGew7NnuFDKsfI4lbvRK+PIIo23SFH+LemGs4cKwzAaRa+Mdb+lQO/STaIayno8T5sJJA==", + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==" + }, + "espree": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.2.tgz", + "integrity": "sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA==", + "requires": { + "acorn": "^7.1.0", + "acorn-jsx": "^5.1.0", + "eslint-visitor-keys": "^1.1.0" + } + }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "requires": { + "estraverse": "^4.0.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", @@ -958,61 +1340,20 @@ "dev": true }, "execa": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", - "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", - "dev": true, + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-3.4.0.tgz", + "integrity": "sha512-r9vdGQk4bmCuK1yKQu1KTwcT2zwfWdbdaXfCtAh+5nU/4fSX+JAb7vZGvI5naJrQlvONrEB20jeruESI69530g==", "requires": { - "cross-spawn": "^5.0.1", - "get-stream": "^3.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" - }, - "dependencies": { - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", - "dev": true, - "requires": { - "shebang-regex": "^1.0.0" - } - }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", - "dev": true - }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "p-finally": "^2.0.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" } }, "extend": { @@ -1041,6 +1382,26 @@ } } }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==" + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + }, "figures": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz", @@ -1049,6 +1410,14 @@ "escape-string-regexp": "^1.0.5" } }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "requires": { + "flat-cache": "^2.0.1" + } + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -1075,6 +1444,31 @@ "is-buffer": "~2.0.3" } }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", + "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==" + }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", @@ -1114,6 +1508,11 @@ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, "furi": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/furi/-/furi-1.3.0.tgz", @@ -1125,48 +1524,36 @@ } }, "gaxios": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.2.2.tgz", - "integrity": "sha512-fzttYsjvZxCaN+bQK7FtAMgoIlPtHkMwlz7vHD+aNRcU7I7gHgnp6hvGJksoo+dO1TDxaog+dSBycbYhHIStaA==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-2.2.0.tgz", + "integrity": "sha512-54Y7s3yvtEO9CZ0yBVQHI5fzS7TzkjlnuLdDEkeyL1SNYMv877VofvA56E/C3dvj3rS7GFiyMWl833Qrr+nrkg==", "dev": true, "requires": { "abort-controller": "^3.0.0", "extend": "^3.0.2", - "https-proxy-agent": "^4.0.0", + "https-proxy-agent": "^3.0.0", "is-stream": "^2.0.0", "node-fetch": "^2.3.0" }, "dependencies": { - "agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", - "dev": true - }, "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { "ms": "^2.1.1" } }, "https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-3.0.1.tgz", + "integrity": "sha512-+ML2Rbh6DAuee7d07tYGEKOEi2voWPUGan+ExdPbPW6Z3svq+JCqr0v8WmKPOkz1vOVykPCBSuobe7G8GJUtVg==", "dev": true, "requires": { - "agent-base": "5", - "debug": "4" + "agent-base": "^4.3.0", + "debug": "^3.1.0" } - }, - "is-stream": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", - "dev": true } } }, @@ -1176,10 +1563,21 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-stdin": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==" + }, "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", "requires": { "pump": "^3.0.0" } @@ -1201,7 +1599,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -1214,6 +1611,14 @@ "ini": "^1.3.5" } }, + "globals": { + "version": "12.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz", + "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==", + "requires": { + "type-fest": "^0.8.1" + } + }, "got": { "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", @@ -1230,6 +1635,16 @@ "p-cancelable": "^1.0.0", "to-readable-stream": "^1.0.0", "url-parse-lax": "^3.0.0" + }, + "dependencies": { + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + } } }, "graceful-fs": { @@ -1243,323 +1658,6 @@ "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "gts": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/gts/-/gts-1.1.2.tgz", - "integrity": "sha512-WWuagkjlFpSfQfShnlpbiJoKRuFXq9Yoj75Re1KVzd109vWo2RmcxaSe1lDtzNFtQFixcBy5TfV1QirTDfjZRA==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "diff": "^4.0.1", - "inquirer": "^7.0.0", - "meow": "^5.0.0", - "ncp": "^2.0.0", - "prettier": "^1.19.1", - "rimraf": "^3.0.0", - "tslint": "^5.12.0", - "tslint-config-prettier": "^1.18.0", - "update-notifier": "^3.0.0", - "write-file-atomic": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "boxen": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.2.0.tgz", - "integrity": "sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^2.4.2", - "cli-boxes": "^2.2.0", - "string-width": "^3.0.0", - "term-size": "^1.2.0", - "type-fest": "^0.3.0", - "widest-line": "^2.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" - } - } - } - }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "configstore": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", - "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==", - "dev": true, - "requires": { - "dot-prop": "^4.1.0", - "graceful-fs": "^4.1.2", - "make-dir": "^1.0.0", - "unique-string": "^1.0.0", - "write-file-atomic": "^2.0.0", - "xdg-basedir": "^3.0.0" - }, - "dependencies": { - "write-file-atomic": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", - "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "imurmurhash": "^0.1.4", - "signal-exit": "^3.0.2" - } - } - } - }, - "crypto-random-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", - "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", - "dev": true - }, - "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", - "dev": true, - "requires": { - "is-obj": "^1.0.0" - } - }, - "emoji-regex": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true - }, - "global-dirs": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", - "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", - "dev": true, - "requires": { - "ini": "^1.3.4" - } - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true - }, - "is-installed-globally": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", - "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", - "dev": true, - "requires": { - "global-dirs": "^0.1.0", - "is-path-inside": "^1.0.0" - } - }, - "is-npm": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-3.0.0.tgz", - "integrity": "sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA==", - "dev": true - }, - "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", - "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", - "dev": true - }, - "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", - "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", - "dev": true, - "requires": { - "path-is-inside": "^1.0.1" - } - }, - "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", - "dev": true, - "requires": { - "pify": "^3.0.0" - } - }, - "semver-diff": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", - "dev": true, - "requires": { - "semver": "^5.0.3" - } - }, - "string-width": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, - "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" - } - }, - "term-size": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", - "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", - "dev": true, - "requires": { - "execa": "^0.7.0" - } - }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - }, - "unique-string": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", - "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", - "dev": true, - "requires": { - "crypto-random-string": "^1.0.0" - } - }, - "update-notifier": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-3.0.1.tgz", - "integrity": "sha512-grrmrB6Zb8DUiyDIaeRTBCkgISYUgETNe7NglEbVsrLWXeESnlCSP50WfRSj/GmzMPl6Uchj24S/p80nP/ZQrQ==", - "dev": true, - "requires": { - "boxen": "^3.0.0", - "chalk": "^2.0.1", - "configstore": "^4.0.0", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.1.0", - "is-npm": "^3.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "semver-diff": "^2.0.0", - "xdg-basedir": "^3.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" - } - } - } - }, - "widest-line": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", - "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", - "dev": true, - "requires": { - "string-width": "^2.1.1" - }, - "dependencies": { - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "xdg-basedir": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", - "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", - "dev": true - } - } - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1615,8 +1713,24 @@ "requires": { "agent-base": "^4.3.0", "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } } }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -1625,6 +1739,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==" + }, "ignore-walk": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", @@ -1634,6 +1753,15 @@ "minimatch": "^3.0.4" } }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", @@ -1694,6 +1822,12 @@ "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -1706,9 +1840,9 @@ } }, "inquirer": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.3.tgz", - "integrity": "sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.1.tgz", + "integrity": "sha512-V1FFQ3TIO15det8PijPLFR9M9baSlnRs9nL7zWu1MNVA2T9YVl9ZbrHJhYs7e9X8jeMZ3lr2JH/rdHFgNCBdYw==", "requires": { "ansi-escapes": "^4.2.1", "chalk": "^2.4.2", @@ -1814,8 +1948,7 @@ "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -1826,7 +1959,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -1887,10 +2019,9 @@ "dev": true }, "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" }, "is-symbol": { "version": "1.0.3", @@ -1926,8 +2057,7 @@ "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "istanbul-lib-coverage": { "version": "3.0.0", @@ -1969,14 +2099,6 @@ "spdx-correct": "^3.0.0", "spdx-satisfies": "^5.0.0", "strip-json-comments": "^3.0.0" - }, - "dependencies": { - "strip-json-comments": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", - "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", - "dev": true - } } }, "js-tokens": { @@ -2003,6 +2125,16 @@ "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -2034,6 +2166,15 @@ "package-json": "^6.3.0" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -2065,6 +2206,11 @@ "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "lodash.unescape": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.unescape/-/lodash.unescape-4.0.1.tgz", + "integrity": "sha1-vyJJiGzlFM2hEvrpIYzcBlIR/Jw=" + }, "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", @@ -2149,29 +2295,12 @@ "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, "make-dir": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", "requires": { "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } } }, "map-obj": { @@ -2195,6 +2324,11 @@ "yargs-parser": "^10.0.0" } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -2308,11 +2442,14 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } }, "emoji-regex": { "version": "7.0.3", @@ -2406,6 +2543,12 @@ "strip-ansi": "^5.1.0" } }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", @@ -2415,15 +2558,6 @@ "has-flag": "^3.0.0" } }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, "wrap-ansi": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", @@ -2468,19 +2602,28 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, "ncp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", "integrity": "sha1-GVoh1sRuNh0vsSgbo4uR6d9727M=" }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, "nise": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/nise/-/nise-3.0.1.tgz", @@ -2503,6 +2646,14 @@ "requires": { "object.getownpropertydescriptors": "^2.0.3", "semver": "^5.7.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "node-fetch": { @@ -2520,6 +2671,13 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } } }, "normalize-path": { @@ -2543,22 +2701,28 @@ "osenv": "^0.1.5", "semver": "^5.6.0", "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } } }, "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", - "dev": true, + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", "requires": { - "path-key": "^2.0.0" + "path-key": "^3.0.0" }, "dependencies": { "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", - "dev": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" } } }, @@ -2612,6 +2776,19 @@ "mimic-fn": "^2.1.0" } }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -2639,10 +2816,9 @@ "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" }, "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-2.0.1.tgz", + "integrity": "sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw==" }, "p-limit": { "version": "1.3.0", @@ -2674,13 +2850,14 @@ "registry-auth-token": "^4.0.0", "registry-url": "^5.0.0", "semver": "^6.2.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "requires": { + "callsites": "^3.0.0" } }, "parse-json": { @@ -2702,17 +2879,10 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -2736,6 +2906,12 @@ "pify": "^3.0.0" } }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, "picomatch": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz", @@ -2747,6 +2923,11 @@ "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" + }, "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", @@ -2757,11 +2938,18 @@ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.19.1.tgz", "integrity": "sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==" }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", - "dev": true + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "requires": { + "fast-diff": "^1.1.2" + } + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==" }, "pump": { "version": "3.0.0", @@ -2772,6 +2960,11 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, "quick-lru": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", @@ -2792,6 +2985,11 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" } } }, @@ -2832,6 +3030,11 @@ "strip-indent": "^2.0.0" } }, + "regexpp": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.0.0.tgz", + "integrity": "sha512-Z+hNr7RAVWxznLPuA7DIh8UNX1j9CDrUQxskw9IrBE1Dxue2lyXT+shqEIeLUjrokxIP8CMy1WkjgG3rTsd5/g==" + }, "registry-auth-token": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.0.0.tgz", @@ -2862,13 +3065,18 @@ "dev": true }, "resolve": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.2.tgz", - "integrity": "sha512-EjlOBLBO1kxsUxsKjLt7TAECyKW6fOh1VRkykQkKGzcBbjjPIxBqGh0jf7GJ3k/f5mxMqW3htMD3WdTUVtW8HQ==", + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.14.1.tgz", + "integrity": "sha512-fn5Wobh4cxbLzuHaE+nphztHy43/b++4M6SsGFC2gB8uYwf0C8LcarfCz1un7UTW8OFQg9iNjZ4xpcFVGebDPg==", "requires": { "path-parse": "^1.0.6" } }, + "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==" + }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", @@ -2921,9 +3129,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "semver-diff": { "version": "3.1.1", @@ -2931,13 +3139,6 @@ "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", "requires": { "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" - } } }, "set-blocking": { @@ -2947,19 +3148,17 @@ "dev": true }, "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "shebang-regex": "^3.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", @@ -2967,9 +3166,9 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "sinon": { - "version": "8.0.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.0.4.tgz", - "integrity": "sha512-cFsmgmvsgFb87e7SV7IcekogITlHX2KmlplyI9Pda0FH1Z8Ms/kWbpLs25Idp0m6ZJ3HEEjhaYYXbcTtWWUn4w==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-8.0.2.tgz", + "integrity": "sha512-8W1S7BnCyvk7SK+Xi15B1QAVLuS81G/NGmWefPb31+ly6xI3fXaug/g5oUdfc8+7ruC4Ay51AxuLlYm8diq6kA==", "dev": true, "requires": { "@sinonjs/commons": "^1.7.0", @@ -2979,6 +3178,52 @@ "lolex": "^5.1.2", "nise": "^3.0.1", "supports-color": "^7.1.0" + }, + "dependencies": { + "diff": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz", + "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==", + "dev": true + } + } + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + } } }, "source-map": { @@ -3126,11 +3371,10 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", - "dev": true + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==" }, "strip-indent": { "version": "2.0.0", @@ -3138,9 +3382,9 @@ "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=" }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==" }, "supports-color": { "version": "7.1.0", @@ -3150,6 +3394,39 @@ "has-flag": "^4.0.0" } }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } + } + }, "teeny-request": { "version": "3.11.3", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", @@ -3177,6 +3454,11 @@ "minimatch": "^3.0.4" } }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" + }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -3226,83 +3508,20 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==" }, - "tslint": { - "version": "5.20.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", - "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", "requires": { - "@babel/code-frame": "^7.0.0", - "builtin-modules": "^1.1.1", - "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.29.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "requires": { - "has-flag": "^3.0.0" - } - } + "tslib": "^1.8.1" } }, - "tslint-config-prettier": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", - "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==" - }, - "tsutils": { - "version": "2.29.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", - "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "tslib": "^1.8.1" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -3363,6 +3582,14 @@ "xdg-basedir": "^4.0.0" } }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, "url-parse-lax": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", @@ -3383,6 +3610,11 @@ "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", "dev": true }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==" + }, "v8-to-istanbul": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-4.0.1.tgz", @@ -3413,10 +3645,9 @@ } }, "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { "isexe": "^2.0.0" } @@ -3477,6 +3708,11 @@ "string-width": "^4.0.0" } }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -3504,6 +3740,14 @@ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "requires": { + "mkdirp": "^0.5.1" + } + }, "write-file-atomic": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.1.tgz", @@ -3526,16 +3770,10 @@ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", - "dev": true - }, "yargs": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.1.0.tgz", - "integrity": "sha512-T39FNN1b6hCW4SOIk1XyTOWxtXdcen0t+XYrysQmChzSipvhBO8Bj0nK1ozAasdk24dNWuMZvr4k24nz+8HHLg==", + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.0.2.tgz", + "integrity": "sha512-GH/X/hYt+x5hOat4LMnCqMd8r5Cv78heOMIJn1hr7QPPBqfeC6p89Y78+WB9yGDvfpCvgasfmWLzNzEioOUD9Q==", "dev": true, "requires": { "cliui": "^6.0.0", @@ -3577,9 +3815,9 @@ } }, "p-limit": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.2.tgz", - "integrity": "sha512-WGR+xHecKTr7EbUEhyLSh5Dube9JtdiG78ufaeLxTgpudf/20KqyMioIUZJAezlTIi6evxuoUs9YXc11cU+yzQ==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", "dev": true, "requires": { "p-try": "^2.0.0" diff --git a/package.json b/package.json index 28bcb293..ccbf5114 100644 --- a/package.json +++ b/package.json @@ -9,16 +9,12 @@ }, "files": [ "CHANGELOG.md", - "LICENSE", - "README.md", "build/src", - "build/types", "build/template", "prettier.config.js", "tsconfig-google.json", "tsconfig.json", - "tslint-rules.json", - "tslint.json" + ".eslintrc.json" ], "scripts": { "build": "npm run compile", @@ -26,17 +22,14 @@ "codecov": "c8 report --reporter=json && codecov -f coverage/*.json", "compile": "tsc -p .", "postcompile": "ncp template build/template", - "format-check": "prettier --list-different src/*.ts test/*.ts", - "format": "prettier --write src/*.ts test/*.ts", - "lint": "tslint -c tslint.json --project . -t codeFrame", - "lint-fix": "tslint -c tslint.json --project . -t codeFrame --fix", + "lint": "eslint '**/*.ts'", "prepare": "npm run compile", - "test": "c8 mocha build/test", + "test": "c8 mocha build/test/test-*.js", + "system-test": "c8 mocha build/test/kitchen.js", "pretest": "npm run compile", - "posttest": "npm run lint && npm run format-check && npm run license-check", + "presystem-test": "npm run compile", "license-check": "jsgl --local .", - "check": "gts check", - "fix": "gts fix" + "fix": "eslint --fix '**/*.ts'" }, "engines": { "node": ">=8" @@ -45,22 +38,27 @@ "author": "Google Inc.", "license": "Apache-2.0", "dependencies": { + "@typescript-eslint/eslint-plugin": "^2.9.0", + "@typescript-eslint/parser": "^2.9.0", "chalk": "^3.0.0", - "diff": "^4.0.1", + "eslint": "^6.7.1", + "eslint-config-prettier": "^6.7.0", + "eslint-plugin-node": "^10.0.0", + "eslint-plugin-prettier": "^3.1.1", + "execa": "^3.4.0", "inquirer": "^7.0.0", "meow": "^5.0.0", "ncp": "^2.0.0", "prettier": "^1.19.1", "rimraf": "^3.0.0", - "tslint": "^5.12.0", - "tslint-config-prettier": "^1.18.0", "update-notifier": "^4.0.0", "write-file-atomic": "^3.0.0" }, "devDependencies": { "@npm/types": "^1.0.1", + "@types/chai": "^4.2.7", "@types/cross-spawn": "^6.0.0", - "@types/diff": "^4.0.0", + "@types/eslint": "^6.1.3", "@types/fs-extra": "^8.0.0", "@types/inquirer": "^6.0.0", "@types/meow": "^5.0.0", @@ -72,12 +70,13 @@ "@types/sinon": "^7.0.11", "@types/tmp": "^0.1.0", "@types/update-notifier": "^2.2.0", + "@types/write-file-atomic": "^2.1.2", "assert-rejects": "^1.0.0", "c8": "^7.0.0", + "chai": "^4.2.0", "codecov": "^3.0.1", "cross-spawn": "^7.0.0", "fs-extra": "^8.0.0", - "gts": "^1.0.0", "inline-fixtures": "^1.1.0", "js-green-licenses": "^1.0.0", "mocha": "^7.0.0", diff --git a/src/cli.ts b/src/cli.ts index 625cd20d..88d7e071 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,4 +1,5 @@ #!/usr/bin/env node + /** * Copyright 2017 Google Inc. All Rights Reserved. * @@ -14,13 +15,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import * as path from 'path'; import * as meow from 'meow'; import * as updateNotifier from 'update-notifier'; import { init } from './init'; import { clean } from './clean'; import { isYarnUsed } from './util'; +import * as execa from 'execa'; +// eslint-disable-next-line @typescript-eslint/no-var-requires const packageJson = require('../../package.json'); export interface Logger { @@ -105,15 +109,38 @@ async function run(verb: string, files: string[]): Promise { return init(options); } - const lint: VerbFilesFunction = require('./lint').lint; - const format: VerbFilesFunction = require('./format').format; + const flags = Object.assign([], files); + if (flags.length === 0) { + flags.push('**/*.ts', '**/*.js'); + } + switch (verb) { - case 'check': - const passLint = await lint(options, files); - const passFormat = await format(options, files); - return passLint && passFormat; - case 'fix': - return (await lint(options, files, true)) && format(options, files, true); + case 'check': { + try { + await execa('node', ['./node_modules/eslint/bin/eslint', ...flags], { + stdio: 'inherit', + }); + return true; + } catch (e) { + return false; + } + } + case 'fix': { + const fixFlag = options.dryRun ? '--fix-dry-run' : '--fix'; + try { + await execa( + 'node', + ['./node_modules/eslint/bin/eslint', fixFlag, ...flags], + { + stdio: 'inherit', + } + ); + return true; + } catch (e) { + console.error(e); + return false; + } + } case 'clean': return clean(options); default: @@ -130,6 +157,7 @@ if (cli.input.length < 1) { run(cli.input[0], cli.input.slice(1)).then(success => { if (!success) { + // eslint-disable-next-line no-process-exit process.exit(1); } }); diff --git a/src/format.ts b/src/format.ts deleted file mode 100644 index 0e887905..00000000 --- a/src/format.ts +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright 2017 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as prettier from 'prettier'; -import * as fs from 'fs'; -import * as diff from 'diff'; - -import { Options } from './cli'; -import { createProgram } from './lint'; - -const PRETTIER_OPTIONS = require('../../prettier.config.js'); - -export async function format( - options: Options, - files: string[] = [], - fix = false -): Promise { - if (options.dryRun && fix) { - options.logger.log('format: skipping auto fix since --dry-run was passed'); - fix = false; - } - - const program = createProgram(options); - // Obtain a list of source files to format. - // We use program.getRootFileNames to get only the files that match the - // include patterns specified in the given tsconfig.json file (as specified - // through options). This is necessary because we only want to format files - // over which the developer has control (i.e. not auto-generated or - // third-party source files). - const srcFiles = - files.length > 0 - ? files - : program.getRootFileNames().filter(f => !f.endsWith('.d.ts')); - - const result = await checkFormat(srcFiles, options, fix); - if (!result) { - options.logger.log('prettier reported errors... run `gts fix` to address.'); - } - return result; -} - -interface FileConfig { - file: string; - config: prettier.Options | null; -} - -async function mapFilesToFileConfigs( - srcFiles: string[] -): Promise { - const configs = await Promise.all( - srcFiles.map(file => prettier.resolveConfig(file)) - ); - return srcFiles.map((file, index) => { - return { file, config: configs[index] }; - }); -} - -/** - * Checks formatting of the given file list. - * - * @param srcFiles list of source files - * @param options gts options - * @param fix true to auto fix the formatting problems - * @returns false if there are still formatting problems - */ -async function checkFormat(srcFiles: string[], options: Options, fix: boolean) { - const configs = await mapFilesToFileConfigs(srcFiles); - - const checks = configs.map(({ file, config }: FileConfig) => { - config = config || PRETTIER_OPTIONS; - config!.filepath = config!.filepath || file; - const contents = fs.readFileSync(file, 'utf8'); - - let formatted: string; - try { - formatted = prettier.format(contents, config!); - } catch (e) { - options.logger.log(`${file}: ${e}`); - return false; - } - - if (contents === formatted) { - return true; - } - if (fix) { - fs.writeFileSync(file, formatted, 'utf8'); - return true; - } - const patch = diff.createPatch(file, contents, formatted); - options.logger.log(patch); - return false; - }); - - return checks.reduce((sum, flag) => sum && flag, true); -} diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 00000000..916f57c5 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,18 @@ +/** + * Copyright 2019 LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import * as cfg from '../.eslintrc.json'; +module.exports = cfg; diff --git a/src/init.ts b/src/init.ts index e882007c..657c9989 100644 --- a/src/init.ts +++ b/src/init.ts @@ -33,6 +33,7 @@ import { Options } from './cli'; import { PackageJson } from '@npm/types'; import chalk = require('chalk'); +// eslint-disable-next-line @typescript-eslint/no-var-requires const pkg = require('../../package.json'); const ncpp = util.promisify(ncp); @@ -108,6 +109,7 @@ export async function addScripts( } if (install) { + // eslint-disable-next-line require-atomic-updates packageJson.scripts[script] = scripts[script]; edits = true; } @@ -145,6 +147,7 @@ export async function addDependencies( } if (install) { + // eslint-disable-next-line require-atomic-updates packageJson.devDependencies[dep] = deps[dep]; edits = true; } @@ -175,38 +178,10 @@ async function writePackageJson( options.logger.dir(preview); } -export const TSLINT_CONFIG = { - extends: 'gts/tslint.json', - linterOptions: { - exclude: ['**/*.json'], - }, +export const ESLINT_CONFIG = { + extends: './node_modules/gts/build/src/index.js', }; -async function generateTsLintConfig(options: Options): Promise { - return generateConfigFile( - options, - './tslint.json', - formatJson(TSLINT_CONFIG) - ); -} - -async function generateTsConfig(options: Options): Promise { - const config = formatJson({ - extends: './node_modules/gts/tsconfig-google.json', - compilerOptions: { rootDir: '.', outDir: 'build' }, - include: ['src/**/*.ts', 'test/**/*.ts'], - }); - return generateConfigFile(options, './tsconfig.json', config); -} - -async function generatePrettierConfig(options: Options): Promise { - const style = await read( - path.join(__dirname, '../../prettier.config.js'), - 'utf8' - ); - return generateConfigFile(options, './prettier.config.js', style); -} - async function generateConfigFile( options: Options, filename: string, @@ -245,6 +220,31 @@ async function generateConfigFile( } } +async function generateESLintConfig(options: Options): Promise { + return generateConfigFile( + options, + './.eslintrc.json', + formatJson(ESLINT_CONFIG) + ); +} + +async function generateTsConfig(options: Options): Promise { + const config = formatJson({ + extends: './node_modules/gts/tsconfig-google.json', + compilerOptions: { rootDir: '.', outDir: 'build' }, + include: ['src/**/*.ts', 'test/**/*.ts'], + }); + return generateConfigFile(options, './tsconfig.json', config); +} + +async function generatePrettierConfig(options: Options): Promise { + const style = await read( + path.join(__dirname, '../../prettier.config.js'), + 'utf8' + ); + return generateConfigFile(options, './prettier.config.js', style); +} + export async function installDefaultTemplate( options: Options ): Promise { @@ -309,7 +309,7 @@ export async function init(options: Options): Promise { options.logger.log('No edits needed in package.json.'); } await generateTsConfig(options); - await generateTsLintConfig(options); + await generateESLintConfig(options); await generatePrettierConfig(options); await installDefaultTemplate(options); diff --git a/src/lint.ts b/src/lint.ts deleted file mode 100644 index 812a480d..00000000 --- a/src/lint.ts +++ /dev/null @@ -1,98 +0,0 @@ -/** - * Copyright 2017 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import * as fs from 'fs'; -import * as path from 'path'; -import { Configuration, Linter } from 'tslint'; -import * as ts from 'typescript'; - -import { Options } from './cli'; - -/** - * Run tslint with the default configuration. Returns true on success. - * @param options gts options - * @param files files to run linter on - * @param fix automatically fix linter errors. Ignored when options.dryRun is - * set. - */ -export function lint( - options: Options, - files: string[] = [], - fix = false -): boolean { - if (options.dryRun && fix) { - options.logger.log('lint: skipping auto fix since --dry-run was passed'); - fix = false; - } - - if (files.length > 0) { - // manually provided filenames. - const rcs = files.map(file => { - // Different config files may apply to each file. - const configPath = - Configuration.findConfigurationPath(null, file) || - path.join(options.gtsRootDir, 'tslint.json'); - - const configuration = Configuration.loadConfigurationFromPath( - configPath, - '' - ); - const source = fs.readFileSync(file, 'utf8'); - - const linter = new Linter({ fix, formatter: 'codeFrame' }); - linter.lint(file, source, configuration); - const result = linter.getResult(); - if (result.errorCount || result.warningCount) { - options.logger.log(result.output); - return false; - } - return true; - }); - - return rcs.every(rc => rc); // if all files succeeded. - } else { - // Lint the set of files specified by the typescript program config. - const program = createProgram(options); - files = Linter.getFileNames(program); - - const configPath = fs.existsSync( - path.join(options.targetRootDir, 'tslint.json') - ) - ? path.resolve(options.targetRootDir, 'tslint.json') - : path.resolve(options.gtsRootDir, 'tslint.json'); - - const configuration = Configuration.loadConfigurationFromPath(configPath); - - for (const file of files) { - const sourceFile = program.getSourceFile(file); - if (sourceFile) { - const fileContents = sourceFile.getFullText(); - const linter = new Linter({ fix, formatter: 'codeFrame' }, program); - linter.lint(file, fileContents, configuration); - const result = linter.getResult(); - if (result.errorCount || result.warningCount) { - options.logger.log(result.output); - return false; - } - } - } - return true; - } -} - -export function createProgram(options: Options): ts.Program { - const tsconfigPath = path.join(options.targetRootDir, 'tsconfig.json'); - return Linter.createProgram(tsconfigPath); -} diff --git a/src/util.ts b/src/util.ts index 83469312..f04719c8 100644 --- a/src/util.ts +++ b/src/util.ts @@ -19,10 +19,11 @@ import * as path from 'path'; import * as rimraf from 'rimraf'; import { promisify } from 'util'; import * as ncp from 'ncp'; +import * as writeFileAtomic from 'write-file-atomic'; export const readFilep = promisify(fs.readFile); export const rimrafp = promisify(rimraf); -export const writeFileAtomicp = promisify(require('write-file-atomic')); +export const writeFileAtomicp = promisify(writeFileAtomic); export const ncpp = promisify(ncp.ncp); export interface Bag { @@ -48,22 +49,6 @@ export function nop() { /* empty */ } -/** - * Find the tsconfig.json, read it, and return parsed contents. - * @param rootDir Directory where the tsconfig.json should be found. - * If the tsconfig.json file has an "extends" field hop down the dependency tree - * until it ends or a circular reference is found in which case an error will be - * thrown - */ -export async function getTSConfig( - rootDir: string, - customReadFilep?: ReadFileP -): Promise { - customReadFilep = customReadFilep || readFilep; - const readArr = new Set(); - return getBase('tsconfig.json', customReadFilep, readArr, rootDir); -} - /** * Recursively iterate through the dependency chain until we reach the end of * the dependency chain or encounter a circular reference @@ -100,6 +85,7 @@ async function getBase( readFiles, path.dirname(filePath) ); + // eslint-disable-next-line @typescript-eslint/no-use-before-define contents = combineTSConfig(nextFile, contents); } @@ -155,3 +141,19 @@ export function getPkgManagerCommand(isYarnUsed?: boolean): string { (isYarnUsed ? 'yarn' : 'npm') + (process.platform === 'win32' ? '.cmd' : '') ); } + +/** + * Find the tsconfig.json, read it, and return parsed contents. + * @param rootDir Directory where the tsconfig.json should be found. + * If the tsconfig.json file has an "extends" field hop down the dependency tree + * until it ends or a circular reference is found in which case an error will be + * thrown + */ +export async function getTSConfig( + rootDir: string, + customReadFilep?: ReadFileP +): Promise { + customReadFilep = customReadFilep || readFilep; + const readArr = new Set(); + return getBase('tsconfig.json', customReadFilep, readArr, rootDir); +} diff --git a/template/index.ts b/template/index.ts index dca15f39..827e9e33 100644 --- a/template/index.ts +++ b/template/index.ts @@ -1,16 +1,23 @@ -console.log("Try npm run check/fix!"); +console.log('Try npm run check/fix!'); -const longString = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut aliquet diam.'; +const longString = + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ut aliquet diam.'; -const trailing = 'Semicolon' +const trailing = 'Semicolon'; - const why = 'am I tabbed?'; +const why = 'am I tabbed?'; -export function doSomeStuff(withThis: string, andThat: string, andThose: string[]) { - //function on one line - if(!andThose.length) {return false;} - console.log(withThis); - console.log(andThat); - console.dir(andThose); +export function doSomeStuff( + withThis: string, + andThat: string, + andThose: string[] +) { + //function on one line + if (!andThose.length) { + return false; + } + console.log(withThis); + console.log(andThat); + console.dir(andThose); } -// TODO: more examples \ No newline at end of file +// TODO: more examples diff --git a/test/fixtures/kitchen/src/server.ts b/test/fixtures/kitchen/src/server.ts index da0e69a3..f463fff9 100644 --- a/test/fixtures/kitchen/src/server.ts +++ b/test/fixtures/kitchen/src/server.ts @@ -1 +1 @@ - const isThisTypeScript = true +const isThisTypeScript = true diff --git a/test/test-kitchen.ts b/test/kitchen.ts similarity index 86% rename from test/test-kitchen.ts rename to test/kitchen.ts index e58d6056..10474e82 100644 --- a/test/test-kitchen.ts +++ b/test/kitchen.ts @@ -2,10 +2,13 @@ import chalk = require('chalk'); import * as cp from 'child_process'; import * as fs from 'fs-extra'; import * as tmp from 'tmp'; -import * as assert from 'assert'; +import { assert } from 'chai'; import * as path from 'path'; +import { describe, it, before, after } from 'mocha'; -const spawn = require('cross-spawn'); +import spawn = require('cross-spawn'); +import execa = require('execa'); +// eslint-disable-next-line @typescript-eslint/no-var-requires const pkg = require('../../package.json'); const keep = !!process.env.GTS_KEEP_TEMPDIRS; const stagingDir = tmp.dirSync({ keep, unsafeCleanup: true }); @@ -15,8 +18,6 @@ const execOpts = { encoding: 'utf8', }; -console.log(`${chalk.blue(`${__filename} staging area: ${stagingPath}`)}`); - describe('🚰 kitchen sink', () => { const fixturesPath = path.join('test', 'fixtures'); const gtsPath = path.join('node_modules', '.bin', 'gts'); @@ -24,7 +25,7 @@ describe('🚰 kitchen sink', () => { // Create a staging directory with temp fixtures used to test on a fresh application. before(() => { - console.log('running before hook.'); + console.log(`${chalk.blue(`${__filename} staging area: ${stagingPath}`)}`); cp.execSync('npm pack'); const tarball = `${pkg.name}-${pkg.version}.tgz`; fs.renameSync(tarball, 'gts.tgz'); @@ -32,8 +33,6 @@ describe('🚰 kitchen sink', () => { console.log('moving packed tar to ', targetPath); fs.moveSync('gts.tgz', targetPath); fs.copySync(fixturesPath, path.join(stagingPath, path.sep)); - console.log(fs.readdirSync(stagingPath)); - console.log(fs.readdirSync(path.join(stagingPath, 'kitchen'))); }); // CLEAN UP - remove the staging directory when done. after('cleanup staging', () => { @@ -60,7 +59,7 @@ describe('🚰 kitchen sink', () => { // Ensure config files got generated. fs.accessSync(path.join(kitchenPath, 'tsconfig.json')); - fs.accessSync(path.join(kitchenPath, 'tslint.json')); + fs.accessSync(path.join(kitchenPath, '.eslintrc.json')); fs.accessSync(path.join(kitchenPath, 'prettier.config.js')); // Compilation shouldn't have happened. Hence no `build` directory. @@ -120,23 +119,19 @@ describe('🚰 kitchen sink', () => { ); assert.ok( fs - .readFileSync(path.join(kitchenPath, 'tslint.json'), 'utf8') + .readFileSync(path.join(kitchenPath, '.eslintrc.json'), 'utf8') .endsWith('\n') ); }); - it('should check before fix', () => { - assert.throws( - () => { - cp.execSync('npm run check', execOpts); - }, - // tslint:disable-next-line no-any - (err: any) => { - assert.strictEqual(err.status, 1); - assert.ok(err.stdout.includes('prettier reported errors')); - return true; - } + it('should check before fix', async () => { + const res = await execa( + 'npm', + ['run', 'check'], + Object.assign({}, { reject: false }, execOpts) ); + assert.strictEqual(res.exitCode, 1); + assert.include(res.stdout, 'assigned a value but'); }); it('should fix', () => { diff --git a/test/test-clean.ts b/test/test-clean.ts index 85bc5521..9b8f0b09 100644 --- a/test/test-clean.ts +++ b/test/test-clean.ts @@ -19,13 +19,13 @@ import * as fs from 'fs'; import * as path from 'path'; import { clean } from '../src/clean'; -import { Options } from '../src/cli'; import { nop } from '../src/util'; import { withFixtures } from 'inline-fixtures'; +import { describe, it } from 'mocha'; describe('clean', () => { - const OPTIONS: Options = { + const OPTIONS = { gtsRootDir: path.resolve(__dirname, '../..'), targetRootDir: './', dryRun: false, @@ -35,6 +35,7 @@ describe('clean', () => { }; it('should gracefully error if tsconfig is missing', () => { + // eslint-disable-next-line node/no-unsupported-features/node-builtins return assert.rejects(() => withFixtures({}, async () => { await clean(OPTIONS); @@ -60,6 +61,7 @@ describe('clean', () => { }); it('should ensure that outDir is local to targetRoot', () => { + // eslint-disable-next-line node/no-unsupported-features/node-builtins return assert.rejects(() => withFixtures( { diff --git a/test/test-format.ts b/test/test-format.ts deleted file mode 100644 index 59964180..00000000 --- a/test/test-format.ts +++ /dev/null @@ -1,332 +0,0 @@ -/** - * Copyright 2017 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as assert from 'assert'; -import * as fs from 'fs'; -import * as path from 'path'; - -import { Options } from '../src/cli'; -import * as format from '../src/format'; -import { nop } from '../src/util'; - -import { withFixtures } from 'inline-fixtures'; - -describe('format', () => { - const BAD_CODE = 'export const foo = [ "2" ];'; - const GOOD_CODE = "export const foo = ['2'];\n"; - const CODE_WITH_TABS = `module.exports = { -\treallyLongIdentified: 4, -\tanotherSuperLongIdentifier, -\tthisCannotFitOnTheSameLine -};\n`; - const PRETTIER_FORMAT_MESSAGE = - 'prettier reported errors... run `gts fix` to address.'; - - const OPTIONS: Options = { - gtsRootDir: path.resolve(__dirname, '../..'), - targetRootDir: './', - dryRun: false, - yes: false, - no: false, - logger: { log: console.log, error: console.error, dir: nop }, - }; - - it('format should return true for well-formatted files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': GOOD_CODE, - }, - async () => { - const result = await format.format(OPTIONS, [], false); - assert.strictEqual(result, true); - } - ); - }); - - it('format should return false for ill-formatted files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - }, - async () => { - const result = await format.format(OPTIONS, [], false); - assert.strictEqual(result, false); - } - ); - }); - - it('format should only look in root files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': "import { foo } from './b';\n", - 'b.ts': BAD_CODE, - }, - async () => { - const result = await format.format(OPTIONS, [], false); - assert.strictEqual(result, true); - } - ); - }); - - it('format should auto fix problems', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - }, - async fixturesDir => { - const result = await format.format(OPTIONS, [], true); - assert.strictEqual(result, true); - const contents = fs.readFileSync( - path.join(fixturesDir, 'a.ts'), - 'utf8' - ); - assert.deepStrictEqual(contents, GOOD_CODE); - } - ); - }); - - it('format should format files listed in tsconfig.files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': GOOD_CODE, - 'b.ts': BAD_CODE, - }, - async () => { - const okay = await format.format(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - it('format should format *.ts files when no files or include has been specified', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({}), - 'a.ts': GOOD_CODE, - 'b.ts': BAD_CODE, - }, - async () => { - const okay = await format.format(OPTIONS); - assert.strictEqual(okay, false); - } - ); - }); - - it('format files listed in tsconfig.files when empty list is provided', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - 'b.ts': BAD_CODE, - }, - async fixturesDir => { - const okay = await format.format(OPTIONS, [], true); - assert.strictEqual(okay, true); - const contents = fs.readFileSync( - path.join(fixturesDir, 'a.ts'), - 'utf8' - ); - assert.deepStrictEqual(contents, GOOD_CODE); - } - ); - }); - - it('skip files listed in exclude', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ exclude: ['b.*'] }), - 'a.ts': GOOD_CODE, - 'b.ts': BAD_CODE, - }, - async () => { - const okay = await format.format(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - it('format globs listed in include', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ include: ['dirb/*'] }), - dira: { 'a.ts': GOOD_CODE }, - dirb: { 'b.ts': BAD_CODE }, - }, - async () => { - const okay = await format.format(OPTIONS); - assert.strictEqual(okay, false); - } - ); - }); - - it('format should not auto fix on dry-run', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - }, - async fixturesDir => { - const optionsWithDryRun = Object.assign({}, OPTIONS, { dryRun: true }); - const okay = await format.format(optionsWithDryRun, [], true); - assert.strictEqual(okay, false); - const contents = fs.readFileSync( - path.join(fixturesDir, 'a.ts'), - 'utf8' - ); - assert.deepStrictEqual(contents, BAD_CODE); - } - ); - }); - - it('format should return false on code with tabs', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['tabs.ts'] }), - 'tabs.ts': CODE_WITH_TABS, - }, - async () => { - const result = await format.format(OPTIONS, [], false); - assert.strictEqual(result, false); - } - ); - }); - - it('format should use user provided prettier.config.js', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['tabs.ts'] }), - 'prettier.config.js': `module.exports = { useTabs: true }`, - 'tabs.ts': CODE_WITH_TABS, - }, - async () => { - const result = await format.format(OPTIONS, [], false); - assert.strictEqual(result, true); - } - ); - }); - - it('format should use user provided .prettierrc', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['tabs.ts'] }), - '.prettierrc': `useTabs: true\n`, - 'tabs.ts': CODE_WITH_TABS, - }, - async () => { - const result = await format.format(OPTIONS, [], false); - assert.strictEqual(result, true); - } - ); - }); - - it('format should prefer the files parameter over options', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - 'good.ts': GOOD_CODE, - }, - async () => { - const result = await format.format(OPTIONS, ['good.ts'], false); - assert.strictEqual(result, true); - } - ); - }); - - it('format should print suggestions for fixes for ill-formatted file', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - }, - async () => { - let output = ''; - const newLogger = Object.assign({}, OPTIONS.logger, { - log: (n: string) => { - output += n; - }, - }); - const options = Object.assign({}, OPTIONS, { logger: newLogger }); - - await format.format(options, [], false); - assert.notStrictEqual(output.search(PRETTIER_FORMAT_MESSAGE), -1); - assert.notStrictEqual(output.indexOf("+export const foo = ['2'];"), -1); - assert.notStrictEqual( - output.indexOf('-export const foo = [ "2" ];'), - -1 - ); - } - ); - }); - - it('formatting output should display unicode characters correctly', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': "//🦄 This is a comment 🌷🏳️‍🌈 — /\nconst variable = '5'", - }, - async () => { - let output = ''; - const newLogger = Object.assign({}, OPTIONS.logger, { - log: (n: string) => { - output += n; - }, - }); - const options = Object.assign({}, OPTIONS, { logger: newLogger }); - - await format.format(options, [], false); - assert.notStrictEqual(output.search(PRETTIER_FORMAT_MESSAGE), -1); - assert.notStrictEqual( - output.indexOf('//🦄 This is a comment 🌷🏳️‍🌈 —'), - -1 - ); - assert.notStrictEqual(output.indexOf("const variable = '5'"), -1); - } - ); - }); - - // Files that cannot be formatted should be left untouched. - it('format should leave the kitty unharmed', () => { - const KITTY = ` - /\\**/\\ - ( o_o )_) - ,(u u ,), - {}{}{}{}{}{}`; - - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - 'kitty.kitty': KITTY, - }, - async fixturesDir => { - const result = await format.format(OPTIONS, ['kitty.kitty'], true); - assert.strictEqual(result, false); // Well structured JS, the kitty is not. - // Well structured or not, the kitty should be left alone. - const contents = fs.readFileSync( - path.join(fixturesDir, 'kitty.kitty'), - 'utf8' - ); - assert.deepStrictEqual(contents, KITTY); - } - ); - }); -}); diff --git a/test/test-init.ts b/test/test-init.ts index af281f7d..35f63295 100644 --- a/test/test-init.ts +++ b/test/test-init.ts @@ -20,13 +20,13 @@ import * as assert from 'assert'; import * as fs from 'fs'; import * as path from 'path'; import { accessSync } from 'fs'; -import { nop, readJsonp as readJson, DefaultPackage } from '../src/util'; -import { Options } from '../src/cli'; import { PackageJson } from '@npm/types'; import { withFixtures, Fixtures } from 'inline-fixtures'; -import * as init from '../src/init'; +import { describe, it, beforeEach, afterEach } from 'mocha'; -const assertRejects = require('assert-rejects'); +import { nop, readJsonp as readJson, DefaultPackage } from '../src/util'; +import { Options } from '../src/cli'; +import * as init from '../src/init'; const OPTIONS: Options = { gtsRootDir: path.resolve(__dirname, '../..'), diff --git a/test/test-lint.ts b/test/test-lint.ts deleted file mode 100644 index 05ce0dd8..00000000 --- a/test/test-lint.ts +++ /dev/null @@ -1,354 +0,0 @@ -/** - * Copyright 2017 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import * as assert from 'assert'; -import * as fs from 'fs'; -import * as path from 'path'; - -import { Options } from '../src/cli'; -import { TSLINT_CONFIG } from '../src/init'; -import * as lint from '../src/lint'; -import * as format from '../src/format'; -import { nop } from '../src/util'; - -import { withFixtures } from 'inline-fixtures'; - -describe('lint', () => { - const OPTIONS: Options = { - gtsRootDir: path.resolve(__dirname, '../..'), - targetRootDir: './', - dryRun: false, - yes: false, - no: false, - logger: { log: nop, error: nop, dir: nop }, - }; - - const BAD_CODE = `throw 'hello world';`; - const GOOD_CODE = `throw new Error('hello world');`; - - // missing semicolon, array-type simple. - const FIXABLE_CODE = 'const x : Array = [];'; - const FIXABLE_CODE_FIXED = 'const x : string[] = [];'; - - it('createProgram should return an object', () => { - return withFixtures({ 'tsconfig.json': '{}' }, async () => { - const program = lint.createProgram(OPTIONS); - assert.ok(program); - }); - }); - - it('lint should return true on good code', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': GOOD_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - it('lint should return false on bad code', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': BAD_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, false); - } - ); - }); - - it('lint should auto fix fixable errors', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': FIXABLE_CODE, - }, - async fixturesDir => { - const okay = lint.lint(OPTIONS, [], true); - assert.strictEqual(okay, true); - const contents = fs.readFileSync( - path.join(fixturesDir, 'a.ts'), - 'utf8' - ); - assert.deepStrictEqual(contents, FIXABLE_CODE_FIXED); - } - ); - }); - - it('lint should not auto fix on dry-run', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': FIXABLE_CODE, - }, - async fixturesDir => { - const optionsWithDryRun = Object.assign({}, OPTIONS, { dryRun: true }); - const okay = lint.lint(optionsWithDryRun, [], true); - assert.strictEqual(okay, false); - const contents = fs.readFileSync( - path.join(fixturesDir, 'a.ts'), - 'utf8' - ); - assert.deepStrictEqual(contents, FIXABLE_CODE); - } - ); - }); - - it('lint should lint files listed in tsconfig.files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': GOOD_CODE, - 'b.ts': BAD_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - it('lint should lint *.ts files when no files or include has been specified', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({}), - 'a.ts': GOOD_CODE, - 'b.ts': BAD_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, false); - } - ); - }); - - it('lint should lint files listed in tsconfig.files when empty list is provided', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': FIXABLE_CODE, - 'b.ts': BAD_CODE, - }, - async fixturesDir => { - const okay = lint.lint(OPTIONS, [], true); - assert.strictEqual(okay, true); - const contents = fs.readFileSync( - path.join(fixturesDir, 'a.ts'), - 'utf8' - ); - assert.deepStrictEqual(contents, FIXABLE_CODE_FIXED); - } - ); - }); - - it('lint should not lint files listed in exclude', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ exclude: ['b.*'] }), - 'a.ts': GOOD_CODE, - 'b.ts': BAD_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - it('lint should lint globs listed in include', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ include: ['dirb/*'] }), - dira: { 'a.ts': GOOD_CODE }, - dirb: { 'b.ts': BAD_CODE }, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, false); - } - ); - }); - - it('lint should lint only specified files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({}), - dira: { 'a.ts': GOOD_CODE }, - dirb: { 'b.ts': BAD_CODE }, - }, - async () => { - const aOkay = lint.lint(OPTIONS, ['dira/a.ts']); - assert.strictEqual(aOkay, true); - const bOkay = lint.lint(OPTIONS, ['dirb/b.ts']); - assert.strictEqual(bOkay, false); - } - ); - }); - - it('lint should throw for unrecognized files', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({}), - 'a.ts': GOOD_CODE, - }, - async () => { - assert.throws(() => { - lint.lint(OPTIONS, ['z.ts']); - }); - } - ); - }); - - it('lint should prefer user config file over default', async () => { - const CUSTOM_LINT_CODE = 'debugger;'; - - // By default the above should fail lint. - await withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'a.ts': CUSTOM_LINT_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, false); - } - ); - - // User should be able to override the default config. - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ files: ['a.ts'] }), - 'tslint.json': JSON.stringify({}), - 'a.ts': CUSTOM_LINT_CODE, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - it('lint for specific files should use file-specific config', () => { - const CODE_WITH_PARSEINT = 'parseInt(42);'; - let logBuffer = ''; - const optionsWithLog = Object.assign({}, OPTIONS, { - logger: { - log: (...args: string[]) => { - logBuffer += args.join(' '); - }, - error: nop, - dir: nop, - }, - }); - return withFixtures( - { - dira: { - 'a.ts': CODE_WITH_PARSEINT, - // no tslint, so default should apply. - }, - dirb: { 'b.ts': CODE_WITH_PARSEINT, 'tslint.json': JSON.stringify({}) }, - }, - async () => { - const okay = lint.lint(optionsWithLog, ['dira/a.ts', 'dirb/b.ts']); - assert.strictEqual(okay, false); - assert.ok(/dira\/a\.ts/.test(logBuffer)); - assert.ok(!/dirb\/b\.ts/.test(logBuffer)); - } - ); - }); - - it('should not conflict with format', async () => { - const FIXTURE = { - 'tsconfig.json': JSON.stringify({ files: ['far.ts'] }), - 'far.ts': `export function far( - ceiling: string, - vines: string, - sailed: number, - ocean: number, - tumbled: string, -): string { - return 'where the wild things are'; -} -`, - }; - - // tslint should not complain about the trailing comma in functions, - // and let prettier complain. - await withFixtures(FIXTURE, async () => { - const lintOkay = await lint.lint(OPTIONS, [], false); - assert.strictEqual(lintOkay, true); - const formatOkay = await format.format(OPTIONS, [], false); - assert.strictEqual(formatOkay, false); - }); - - const fixtureWithPrettierConfig = { - ...FIXTURE, - 'prettier.config.js': `module.exports = { - singleQuote: true, - trailingComma: 'all', -};`, - }; - - // Both the linter and the formatter should be okay with this. - await withFixtures(fixtureWithPrettierConfig, async () => { - const lintOkay = await lint.lint(OPTIONS, [], false); - assert.strictEqual(lintOkay, true); - const formatOkay = await format.format(OPTIONS, [], false); - assert.strictEqual(formatOkay, true); - }); - }); - - it('should handle json files correctly resolveJsonModule', () => { - return withFixtures( - { - 'tsconfig.json': JSON.stringify({ - include: ['src'], - compilerOptions: { - module: 'commonjs', - resolveJsonModule: true, - esModuleInterop: true, - }, - }), - 'tslint.json': JSON.stringify(TSLINT_CONFIG), - node_modules: { - gts: { - 'tslint-rules.json': fs.readFileSync('tslint-rules.json', 'utf8'), - 'tslint.json': fs.readFileSync('tslint.json', 'utf8'), - }, - }, - src: { - 'a.ts': `import settings from "./test.json";`, - 'test.json': JSON.stringify({ - dry: false, - debug: false, - }), - }, - }, - async () => { - const okay = lint.lint(OPTIONS); - assert.strictEqual(okay, true); - } - ); - }); - - // TODO: test for when tsconfig.json is missing. -}); diff --git a/test/test-util.ts b/test/test-util.ts index d6af8a45..b4998c9b 100644 --- a/test/test-util.ts +++ b/test/test-util.ts @@ -15,8 +15,8 @@ */ import * as assert from 'assert'; import * as path from 'path'; -import { accessSync, PathLike, readFileSync } from 'fs'; - +import { PathLike } from 'fs'; +import { describe, it } from 'mocha'; import { ConfigFile, getTSConfig, @@ -24,8 +24,6 @@ import { getPkgManagerCommand, } from '../src/util'; -import { withFixtures, Fixtures } from 'inline-fixtures'; - /** * Creates a fake promisified readFile function from a map * @param myMap contains a filepath as the key and a ConfigFile object as the @@ -80,6 +78,7 @@ describe('util', () => { myMap.set(PATH_TO_CONFIG2, FAKE_CONFIG2); myMap.set(PATH_TO_CONFIG3, FAKE_CONFIG3); + // eslint-disable-next-line node/no-unsupported-features/node-builtins return assert.rejects( () => getTSConfig(FAKE_DIRECTORY, createFakeReadFilep(myMap)), Error, @@ -159,6 +158,7 @@ describe('util', () => { it('function throws an error when reading a file that does not exist', () => { const myMap = new Map(); + // eslint-disable-next-line node/no-unsupported-features/node-builtins return assert.rejects( () => getTSConfig(FAKE_DIRECTORY, createFakeReadFilep(myMap)), Error, diff --git a/tsconfig.json b/tsconfig.json index b643ac98..dfb3be02 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,8 @@ "extends": "./tsconfig-google.json", "compilerOptions": { "rootDir": ".", - "outDir": "build" + "outDir": "build", + "resolveJsonModule": true }, "include": [ "src/**/*.ts", @@ -12,4 +13,4 @@ "test/fixtures/**/*.*", "template/**/*.*", ] -} \ No newline at end of file +} diff --git a/tslint-rules.json b/tslint-rules.json deleted file mode 100644 index 234de72c..00000000 --- a/tslint-rules.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "rules": { - "array-type": [true, "array-simple"], - "arrow-return-shorthand": true, - "ban": [true, - {"name": ["it", "skip"]}, - {"name": ["it", "only"]}, - {"name": ["it", "async", "skip"]}, - {"name": ["it", "async", "only"]}, - {"name": ["describe", "skip"]}, - {"name": ["describe", "only"]}, - {"name": "parseInt", "message": "tsstyle#type-coercion"}, - {"name": "parseFloat", "message": "tsstyle#type-coercion"}, - {"name": "Array", "message": "tsstyle#array-constructor"}, - {"name": ["*", "innerText"], "message": "Use .textContent instead. tsstyle#browser-oddities"} - ], - "ban-ts-ignore": true, - "ban-types": [true, - ["Object", "Use {} instead."], - ["String", "Use 'string' instead."], - ["Number", "Use 'number' instead."], - ["Boolean", "Use 'boolean' instead."] - ], - "class-name": true, - "curly": [true, "ignore-same-line"], - "deprecation": true, - "forin": true, - "interface-name": [true, "never-prefix"], - "interface-over-type-literal": true, - "jsdoc-format": true, - "label-position": true, - "member-access": [true, "no-public"], - "new-parens": true, - "no-angle-bracket-type-assertion": true, - "no-any": true, - "no-arg": true, - "no-conditional-assignment": true, - "no-construct": true, - "no-debugger": true, - "no-default-export": true, - "no-duplicate-variable": true, - "no-inferrable-types": true, - "no-namespace": [true, "allow-declarations"], - "no-reference": true, - "no-string-throw": true, - "no-return-await": true, - "no-unsafe-finally": true, - "no-unused-expression": true, - "no-var-keyword": true, - "object-literal-shorthand": true, - "only-arrow-functions": [true, "allow-declarations", "allow-named-functions"], - "prefer-const": true, - "radix": true, - "semicolon": [true, "always", "ignore-bound-class-methods"], - "switch-default": true, - "trailing-comma": [ - true, - { - "multiline": { - "objects": "always", - "arrays": "always", - "functions": "never", - "typeLiterals": "ignore" - }, - "esSpecCompliant": true - } - ], - "triple-equals": [true, "allow-null-check"], - "use-isnan": true, - "variable-name": [ - true, - "check-format", - "ban-keywords", - "allow-leading-underscore", - "allow-trailing-underscore" - ] - } -} diff --git a/tslint.json b/tslint.json deleted file mode 100644 index e6584553..00000000 --- a/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "./tslint-rules.json", - "tslint-config-prettier" - ] -} \ No newline at end of file