Skip to content

Commit 0b962bc

Browse files
authoredAug 27, 2024··
Drop redundant dependency (#236)
1 parent cb073f0 commit 0b962bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎package.json

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"latest-version": "^9.0.0",
4848
"pupa": "^3.1.0",
4949
"semver": "^7.6.3",
50-
"semver-diff": "^4.0.0",
5150
"xdg-basedir": "^5.1.0"
5251
},
5352
"devDependencies": {

‎update-notifier.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import path from 'node:path';
55
import {format} from 'node:util';
66
import ConfigStore from 'configstore';
77
import chalk from 'chalk';
8-
import semver from 'semver';
9-
import semverDiff from 'semver-diff';
8+
// Only import what we need for performance
9+
import semverDiff from 'semver/functions/diff.js';
10+
import semverGt from 'semver/functions/gt.js';
1011
import latestVersion from 'latest-version';
1112
import {isNpmOrYarn} from 'is-npm';
1213
import isInstalledGlobally from 'is-installed-globally';
@@ -126,7 +127,7 @@ export default class UpdateNotifier {
126127

127128
notify(options) {
128129
const suppressForNpm = !this._shouldNotifyInNpmScript && isNpmOrYarn;
129-
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semver.gt(this.update.latest, this.update.current)) {
130+
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semverGt(this.update.latest, this.update.current)) {
130131
return this;
131132
}
132133

0 commit comments

Comments
 (0)
Please sign in to comment.