diff --git a/lib/autofix.js b/lib/autofix.js index cfb0d8f4f..d9c742c27 100644 --- a/lib/autofix.js +++ b/lib/autofix.js @@ -3,6 +3,7 @@ const fs = require('fs-extra'); const chalk = require('chalk'); const prompts = require('prompts'); const spawn = require('cross-spawn'); +const getPathKey = require('path-key'); const AppState = require('./state'); const ErrorMessage = require('./error-message'); const promisifyPort = require('./promisify-port'); @@ -103,47 +104,33 @@ function checkIfAFixConfirmationIsStillExpected(app) { } function formatFileContent(options, file, filePath) { - if (options.elmFormatPath) { - const spawnedUsingPathFromArgs = spawn.sync( - options.elmFormatPath, - ['--elm-version=0.19', '--stdin', '--output', filePath], - { - input: file.source - } - ); + const hasElmFormatPathFlag = Boolean(options.elmFormatPath); + const elmFormatPath = options.elmFormatPath || 'elm-format'; + + const result = spawn.sync( + elmFormatPath, + ['--elm-version=0.19', '--stdin', '--output', filePath], + { + input: file.source, + env: hasElmFormatPathFlag + ? process.env + : backwardsCompatibleElmFormatEnv() + } + ); - if (spawnedUsingPathFromArgs.status !== 0) { - const error = spawnedUsingPathFromArgs.stderr.toString(); - if (error.includes('not found')) { + if (result.error) { + if (result.error.code === 'ENOENT') { + if (hasElmFormatPathFlag) { throw new ErrorMessage.CustomError( /* eslint-disable prettier/prettier */ 'ELM-FORMAT NOT FOUND', `I could not find the executable for ${chalk.magentaBright('elm-format')} at the location you specified: + ${options.elmFormatPath}`, options.elmJsonPath /* eslint-enable prettier/prettier */ ); - } - } - } else { - const spawnedUsingNpx = spawn.sync( - 'npx', - [ - '--no-install', - 'elm-format', - '--elm-version=0.19', - '--stdin', - '--output', - filePath - ], - { - input: file.source - } - ); - - if (spawnedUsingNpx.status !== 0) { - const error = spawnedUsingNpx.stderr.toString(); - if (error.includes('not found')) { + } else { throw new ErrorMessage.CustomError( /* eslint-disable prettier/prettier */ 'ELM-FORMAT NOT FOUND', @@ -157,27 +144,21 @@ A few options: /* eslint-enable prettier/prettier */ ); } + } else { + throw result.error; + } + } - const spawnedUsingGlobal = spawn.sync( - 'elm-format', - ['--yes', '--elm-version=0.19', '--stdin', '--output', filePath], - { - input: file.source - } - ); - - if (spawnedUsingGlobal.status !== 0) { - throw new ErrorMessage.CustomError( - /* eslint-disable prettier/prettier */ - 'ERROR WHEN RUNNING ELM-FORMAT', - `I got an unexpected error when running ${chalk.magentaBright('elm-format')}: + if (result.status !== 0) { + throw new ErrorMessage.CustomError( + /* eslint-disable prettier/prettier */ + 'ERROR WHEN RUNNING ELM-FORMAT', + `I got an unexpected error when running ${chalk.magentaBright('elm-format')}: - ${spawnedUsingGlobal.stderr.toString()}`, - options.elmJsonPath - /* eslint-enable prettier/prettier */ - ); - } - } +${result.stderr.toString()}`, + options.elmJsonPath + /* eslint-enable prettier/prettier */ + ); } return { @@ -187,3 +168,61 @@ A few options: source: fs.readFileSync(filePath, 'utf8') }; } + +// When `--elm-format-path` was _not_ provided, we used to execute +// `elm-format` like this: +// +// 1. Try `npx elm-format` +// 2. Try `elm-format` +// +// Just starting `npx` takes 200 ms though. Luckily `npx` isn’t even +// necessary, because the common ways of running `elm-review` are: +// +// 1. Install everything globally and run just `elm-review`. +// 2. Install everything locally and run `npx elm-review`. +// 3. Use the `--elm-format-path`. +// +// That’s also the only supported ways we have for the `elm` binary – there we +// have never tried to execute `npx elm`. +// +// `npx` adds all potential `node_modules/.bin` up to current directory to the +// beginning of PATH, for example: +// +// ❯ npx node -p 'process.env.PATH.split(require("path").delimiter)' +// [ +// '/Users/you/stuff/node_modules/.bin', +// '/Users/you/node_modules/.bin', +// '/Users/node_modules/.bin', +// '/node_modules/.bin', +// '/usr/bin', +// 'etc' +// ] +// +// So if a user runs `npx elm-review`, when we later try to spawn just +// `elm-format`, it’ll be found since when spawning we inherit the same PATH. +// +// The `npx elm-format` approach has been removed to avoid those unnessary 200 ms, +// but to stay backwards compatible we prepend the same paths to the beginning +// of PATH just like `npx` would (see above). This is needed when: +// +// - Executing `elm-review` _without_ `npx`. +// - And expecting a _local_ `elm-format` to be used. That’s an odd use case, +// but was supported due to the `npx` approach. +// +// This can be removed in a major version. +function backwardsCompatibleElmFormatEnv() { + const pathKey = getPathKey(); + return { + ...process.env, + [pathKey]: [ + ...process + .cwd() + .split(path.sep) + .map((_, index, parts) => + [...parts.slice(0, index + 1), 'node_modules', '.bin'].join(path.sep) + ) + .reverse(), + process.env[pathKey] + ].join(path.delimiter) + }; +} diff --git a/package-lock.json b/package-lock.json index 2b9085ef6..37c919b94 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,6 +21,7 @@ "got": "^10.7.0", "minimist": "^1.2.0", "ora": "^5.4.0", + "path-key": "^3.1.1", "prompts": "^2.2.1", "strip-ansi": "^6.0.0", "temp": "^0.9.1", @@ -233,12 +234,6 @@ "node": ">=4" } }, - "node_modules/@babel/traverse/node_modules/lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, "node_modules/@babel/types": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", @@ -250,12 +245,6 @@ "to-fast-properties": "^2.0.0" } }, - "node_modules/@babel/types/node_modules/lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, "node_modules/@mrmlnc/readdir-enhanced": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", @@ -1875,14 +1864,6 @@ "node": ">= 8" } }, - "node_modules/cross-spawn/node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, "node_modules/cross-spawn/node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2567,18 +2548,6 @@ "node": ">=8" } }, - "node_modules/eslint-formatter-pretty/node_modules/log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "dependencies": { - "chalk": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/eslint-formatter-pretty/node_modules/string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -3303,16 +3272,13 @@ "node": ">=4" } }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", + "node_modules/eslint/node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, "engines": { - "node": ">= 6" + "node": ">=4" } }, "node_modules/eslint/node_modules/semver": { @@ -3336,15 +3302,6 @@ "node": ">=6" } }, - "node_modules/eslint/node_modules/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, - "engines": { - "node": ">=8" - } - }, "node_modules/espree": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/espree/-/espree-6.1.1.tgz", @@ -3359,12 +3316,6 @@ "node": ">=6.0.0" } }, - "node_modules/espree/node_modules/acorn-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", - "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", - "dev": true - }, "node_modules/espree/node_modules/eslint-visitor-keys": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", @@ -3808,14 +3759,6 @@ "node": ">=8" } }, - "node_modules/find-up/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, "node_modules/flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", @@ -3830,18 +3773,6 @@ "node": ">=4" } }, - "node_modules/flat-cache/node_modules/rimraf": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - } - }, "node_modules/flatted": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz", @@ -6209,7 +6140,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -6223,12 +6153,11 @@ } }, "node_modules/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==", "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/path-parse": { @@ -8199,14 +8128,6 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "engines": { - "node": ">=8" - } - }, "node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", @@ -8261,17 +8182,6 @@ "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dependencies": { - "ansi-regex": "^5.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -8541,12 +8451,6 @@ "node": ">= 0.8.0" } }, - "node_modules/xo/node_modules/lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, "node_modules/xo/node_modules/optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", @@ -8839,12 +8743,6 @@ "escape-string-regexp": "^1.0.5", "supports-color": "^5.3.0" } - }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true } } }, @@ -8857,14 +8755,6 @@ "@babel/helper-validator-identifier": "^7.10.4", "lodash": "^4.17.19", "to-fast-properties": "^2.0.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - } } }, "@mrmlnc/readdir-enhanced": { @@ -10226,11 +10116,6 @@ "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", @@ -10486,24 +10371,24 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, "elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", "dev": true, "requires": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", + "bn.js": "^4.4.0", + "brorand": "^1.0.1", "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" }, "dependencies": { "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==", "dev": true } } @@ -10761,14 +10646,11 @@ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, - "glob-parent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", - "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true }, "semver": { "version": "6.3.0", @@ -10784,12 +10666,6 @@ "requires": { "ansi-regex": "^4.1.0" } - }, - "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 } } }, @@ -10871,15 +10747,6 @@ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, - "log-symbols": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", - "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", - "dev": true, - "requires": { - "chalk": "^4.0.0" - } - }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", @@ -11426,12 +11293,6 @@ "eslint-visitor-keys": "^1.1.0" }, "dependencies": { - "acorn-jsx": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", - "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", - "dev": true - }, "eslint-visitor-keys": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", @@ -11799,13 +11660,6 @@ "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" - }, - "dependencies": { - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - } } }, "flat-cache": { @@ -11817,17 +11671,6 @@ "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==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - } } }, "flatted": { @@ -13738,8 +13581,7 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", @@ -13747,10 +13589,9 @@ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "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==" }, "path-parse": { "version": "1.0.6", @@ -15362,11 +15203,6 @@ "strip-ansi": "^6.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" - }, "ansi-styles": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", @@ -15408,14 +15244,6 @@ "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.0" } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "requires": { - "ansi-regex": "^5.0.0" - } } } }, @@ -15636,12 +15464,6 @@ "type-check": "~0.4.0" } }, - "lodash": { - "version": "4.17.19", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz", - "integrity": "sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==", - "dev": true - }, "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", diff --git a/package.json b/package.json index 458030844..216b0e052 100644 --- a/package.json +++ b/package.json @@ -79,6 +79,7 @@ "got": "^10.7.0", "minimist": "^1.2.0", "ora": "^5.4.0", + "path-key": "^3.1.1", "prompts": "^2.2.1", "strip-ansi": "^6.0.0", "temp": "^0.9.1",