Fix dependabot issues

This commit is contained in:
Andrew Eisenberg 2021-10-21 15:24:20 -07:00
parent c89d9bd8b0
commit 531c6ba7c8
705 changed files with 53406 additions and 20466 deletions

View file

@ -6,6 +6,7 @@ const importLazy = require('import-lazy')(require);
const configstore = importLazy('configstore');
const chalk = importLazy('chalk');
const semver = importLazy('semver');
const semverDiff = importLazy('semver-diff');
const latestVersion = importLazy('latest-version');
const isNpm = importLazy('is-npm');
@ -54,7 +55,7 @@ class UpdateNotifier {
// after the set interval, so not to bother users right away
lastUpdateCheck: Date.now()
});
} catch (_) {
} catch {
// Expecting error code EACCES or EPERM
const message =
chalk().yellow(format(' %s update check failed ', options.pkg.name)) +
@ -63,7 +64,7 @@ class UpdateNotifier {
chalk().cyan(format(' sudo chown -R $USER:$(id -gn $USER) %s ', xdgBasedir().config));
process.on('exit', () => {
console.error('\n' + boxen()(message, {align: 'center'}));
console.error(boxen()(message, {align: 'center'}));
});
}
}
@ -114,17 +115,17 @@ class UpdateNotifier {
notify(options) {
const suppressForNpm = !this.shouldNotifyInNpmScript && isNpm().isNpmOrYarn;
if (!process.stdout.isTTY || suppressForNpm || !this.update || this.update.current === this.update.latest) {
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semver().gt(this.update.latest, this.update.current)) {
return this;
}
options = Object.assign({
options = {
isGlobal: isInstalledGlobally(),
isYarnGlobal: isYarnGlobal()()
}, options);
isYarnGlobal: isYarnGlobal()(),
...options
};
let installCommand;
if (options.isYarnGlobal) {
installCommand = `yarn global add ${this.packageName}`;
} else if (options.isGlobal) {
@ -151,7 +152,7 @@ class UpdateNotifier {
borderStyle: 'round'
};
const message = '\n' + boxen()(
const message = boxen()(
pupa()(template, {
packageName: this.packageName,
currentVersion: this.update.current,