From c43c6cff059f327f56048ef17b767fe11af2b83e Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Thu, 29 Oct 2020 15:56:10 +0100 Subject: [PATCH] Upgrade dependencies --- package.json | 60 +++++++++++++++++++++++----------------------- source/cli.js | 6 ++--- source/git-util.js | 8 +++---- source/index.js | 2 +- source/npm/util.js | 4 ++-- source/util.js | 4 ++-- test/hyperlinks.js | 8 +++---- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/package.json b/package.json index 1ee9d715..f51f5cb6 100644 --- a/package.json +++ b/package.json @@ -30,52 +30,52 @@ "commit" ], "dependencies": { - "@samverschueren/stream-to-observable": "^0.3.0", - "any-observable": "^0.5.0", + "@samverschueren/stream-to-observable": "^0.3.1", + "any-observable": "^0.5.1", "async-exit-hook": "^2.0.1", - "chalk": "^3.0.0", - "cosmiconfig": "^6.0.0", - "del": "^4.1.0", + "chalk": "^4.1.0", + "cosmiconfig": "^7.0.0", + "del": "^6.0.0", "escape-goat": "^3.0.0", - "escape-string-regexp": "^2.0.0", - "execa": "^4.0.0", + "escape-string-regexp": "^4.0.0", + "execa": "^4.1.0", "github-url-from-git": "^1.5.0", "has-yarn": "^2.1.0", - "hosted-git-info": "^3.0.0", + "hosted-git-info": "^3.0.7", "ignore-walk": "^3.0.3", "import-local": "^3.0.2", - "inquirer": "^7.0.0", - "is-installed-globally": "^0.3.1", + "inquirer": "^7.3.3", + "is-installed-globally": "^0.3.2", "is-scoped": "^2.1.0", "issue-regex": "^3.1.0", "listr": "^0.14.3", "listr-input": "^0.2.1", - "log-symbols": "^3.0.0", - "meow": "^6.0.0", + "log-symbols": "^4.0.0", + "meow": "^8.0.0", "minimatch": "^3.0.4", "new-github-release-url": "^1.0.0", - "npm-name": "^6.0.0", - "onetime": "^5.1.0", - "open": "^7.0.0", - "ow": "^0.15.0", - "p-memoize": "^3.1.0", - "p-timeout": "^3.1.0", - "pkg-dir": "^4.1.0", - "read-pkg-up": "^7.0.0", - "rxjs": "^6.5.4", - "semver": "^7.1.1", - "split": "^1.0.0", - "symbol-observable": "^1.2.0", - "terminal-link": "^2.0.0", - "update-notifier": "^4.0.0" + "npm-name": "^6.0.1", + "onetime": "^5.1.2", + "open": "^7.3.0", + "ow": "^0.18.0", + "p-memoize": "^4.0.1", + "p-timeout": "^3.2.0", + "pkg-dir": "^5.0.0", + "read-pkg-up": "^7.0.1", + "rxjs": "^6.6.3", + "semver": "^7.3.2", + "split": "^1.0.1", + "symbol-observable": "^2.0.3", + "terminal-link": "^2.1.1", + "update-notifier": "^5.0.0" }, "devDependencies": { "ava": "^2.3.0", - "execa_test_double": "^4.0.0", + "execa_test_double": "^4.0.1", "mockery": "^2.1.0", - "proxyquire": "^2.1.0", - "sinon": "^8.0.1", - "xo": "^0.25.3" + "proxyquire": "^2.1.3", + "sinon": "^9.2.1", + "xo": "^0.34.1" }, "ava": { "files": [ diff --git a/source/cli.js b/source/cli.js index 3bab28fc..f79dcc86 100755 --- a/source/cli.js +++ b/source/cli.js @@ -1,15 +1,15 @@ #!/usr/bin/env node 'use strict'; -const util = require('util'); +const {debuglog} = require('util'); const importLocal = require('import-local'); const isInstalledGlobally = require('is-installed-globally'); -const debuglog = util.debuglog('np'); +const log = debuglog('np'); // Prefer the local installation if (!importLocal(__filename)) { if (isInstalledGlobally) { - debuglog('Using global install of np.'); + log('Using global install of np.'); } // eslint-disable-next-line import/no-unassigned-import diff --git a/source/git-util.js b/source/git-util.js index 9ebfbf5f..0ed63395 100644 --- a/source/git-util.js +++ b/source/git-util.js @@ -15,7 +15,7 @@ exports.newFilesSinceLastRelease = async () => { const {stdout} = await execa('git', ['diff', '--stat', '--diff-filter=A', await this.latestTag(), 'HEAD']); const result = stdout.trim().split('\n').slice(0, -1).map(row => row.slice(0, row.indexOf('|')).trim()); return result; - } catch (_) { + } catch { // Get all files under version control return ignoreWalker({ path: pkgDir.sync(), @@ -34,7 +34,7 @@ exports.latestTagOrFirstCommit = async () => { try { // In case a previous tag exists, we use it to compare the current repo status to. latest = await exports.latestTag(); - } catch (_) { + } catch { // Otherwise, we fallback to using the first commit for comparison. latest = await firstCommit(); } @@ -70,7 +70,7 @@ exports.isWorkingTreeClean = async () => { } return true; - } catch (_) { + } catch { return false; } }; @@ -86,7 +86,7 @@ exports.isRemoteHistoryClean = async () => { try { // Gracefully handle no remote set up. const {stdout} = await execa('git', ['rev-list', '--count', '--left-only', '@{u}...HEAD']); history = stdout; - } catch (_) {} + } catch {} if (history && history !== '0') { return false; diff --git a/source/index.js b/source/index.js index f0209fbb..bc629844 100644 --- a/source/index.js +++ b/source/index.js @@ -1,5 +1,5 @@ 'use strict'; -require('any-observable/register/rxjs-all'); // eslint-disable-line import/no-unassigned-import +require('any-observable/register/rxjs-all'); const fs = require('fs'); const path = require('path'); const execa = require('execa'); diff --git a/source/npm/util.js b/source/npm/util.js index 93371291..fb92552b 100644 --- a/source/npm/util.js +++ b/source/npm/util.js @@ -16,7 +16,7 @@ exports.checkConnection = () => pTimeout( try { await execa('npm', ['ping']); return true; - } catch (_) { + } catch { throw new Error('Connection to npm registry failed'); } })(), @@ -147,7 +147,7 @@ function getFilesNotIncludedInFilesProperty(pkg, fileList) { if (fs.statSync(path.resolve(rootDir, glob)).isDirectory()) { globArrayForFilesAndDirectories.push(`${glob}/**/*`); } - } catch (_) {} + } catch {} } const result = fileList.filter(minimatch.filter(getIgnoredFilesGlob(globArrayForFilesAndDirectories, pkg.directories), {matchBase: true, dot: true})); diff --git a/source/util.js b/source/util.js index 12a9c988..040e3682 100644 --- a/source/util.js +++ b/source/util.js @@ -66,7 +66,7 @@ exports.getTagVersionPrefix = pMemoize(async options => { const {stdout} = await execa('npm', ['config', 'get', 'tag-version-prefix']); return stdout; - } catch (_) { + } catch { return 'v'; } }); @@ -95,7 +95,7 @@ exports.getPreReleasePrefix = pMemoize(async options => { } return ''; - } catch (_) { + } catch { return ''; } }); diff --git a/test/hyperlinks.js b/test/hyperlinks.js index 98b0632d..963a9663 100644 --- a/test/hyperlinks.js +++ b/test/hyperlinks.js @@ -23,14 +23,14 @@ test('linkifyIssues correctly links issues', t => { }); test('linkifyIssues returns raw message if url is not provided', t => { - const msg = 'Commit message - fixes #5'; - t.is(linkifyIssues(undefined, msg), msg); + const message = 'Commit message - fixes #5'; + t.is(linkifyIssues(undefined, message), message); }); test.serial('linkifyIssues returns raw message if terminalLink is not supported', t => { mockTerminalLinkUnsupported(); - const msg = 'Commit message - fixes #6'; - t.is(linkifyIssues(MOCK_REPO_URL, msg), msg); + const message = 'Commit message - fixes #6'; + t.is(linkifyIssues(MOCK_REPO_URL, message), message); }); test('linkifyCommit correctly links commits', t => {