Skip to content

Commit e9745f9

Browse files
committed
Put update-notifier back.
1 parent d467f32 commit e9745f9

4 files changed

Lines changed: 21 additions & 2 deletions

File tree

apps/lockfile-explorer/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@types/cors": "~2.8.12",
5353
"@types/express": "4.17.21",
5454
"@types/js-yaml": "4.0.9",
55+
"@types/update-notifier": "~6.0.1",
5556
"eslint": "~9.37.0",
5657
"local-node-rig": "workspace:*",
5758
"@pnpm/lockfile.types": "1002.0.1",
@@ -69,7 +70,8 @@
6970
"cors": "~2.8.5",
7071
"express": "4.21.1",
7172
"js-yaml": "~4.1.0",
72-
"semver": "~7.7.4"
73+
"semver": "~7.7.4",
74+
"update-notifier": "~5.1.0"
7375
},
7476
"exports": {
7577
"./lib/*.schema.json": "./lib-commonjs/*.schema.json",

apps/lockfile-explorer/src/cli/explorer/ExplorerCommandLineParser.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { ChildProcess } from 'node:child_process';
88
import express from 'express';
99
import yaml from 'js-yaml';
1010
import cors from 'cors';
11+
import updateNotifier from 'update-notifier';
1112

1213
import {
1314
Executable,
@@ -85,6 +86,18 @@ export class ExplorerCommandLineParser extends CommandLineParser {
8586
Colorize.cyan(' - https://lfx.rushstack.io/\n')
8687
);
8788

89+
updateNotifier({
90+
pkg: lockfileExplorerPackageJson,
91+
// Normally update-notifier waits a day or so before it starts displaying upgrade notices.
92+
// In debug mode, show the notice right away.
93+
updateCheckInterval: this.isDebug ? 0 : undefined
94+
}).notify({
95+
// Make sure it says "-g" in the "npm install" example command line
96+
isGlobal: true,
97+
// Show the notice immediately, rather than waiting for process.onExit()
98+
defer: false
99+
});
100+
88101
const PORT: number = 8091;
89102
// Must not have a trailing slash
90103
const SERVICE_URL: string = `http://localhost:${PORT}`;

common/changes/@rushstack/lockfile-explorer/dependency-cleanup_2026-04-17.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"changes": [
33
{
44
"packageName": "@rushstack/lockfile-explorer",
5-
"comment": "Remove open and `update-notifier` dependencies; use `Executable.spawn()` from `node-core-library` to launch the browser.",
5+
"comment": "Remove open dependency; use `Executable.spawn()` from `node-core-library` to launch the browser.",
66
"type": "patch"
77
}
88
],

common/config/rush/nonbrowser-approved-packages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,6 +1082,10 @@
10821082
"name": "typescript",
10831083
"allowedCategories": [ "libraries", "tests", "vscode-extensions" ]
10841084
},
1085+
{
1086+
"name": "update-notifier",
1087+
"allowedCategories": [ "libraries" ]
1088+
},
10851089
{
10861090
"name": "url-loader",
10871091
"allowedCategories": [ "libraries" ]

0 commit comments

Comments
 (0)