fix: make improvements to the update box (#9279)

close #9262
This commit is contained in:
Zoltan Kochan
2025-03-13 14:50:59 +01:00
committed by GitHub
parent e4ca866fec
commit 960f1f8d13
2 changed files with 23 additions and 23 deletions

View File

@@ -22,7 +22,7 @@ export function reportUpdateCheck (log$: Rx.Observable<UpdateCheckLog>, opts: {
return Rx.of({
msg: boxen(`\
Update available! ${chalk.red(log.currentVersion)}${chalk.green(log.latestVersion)}.
${chalk.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${log.latestVersion}
${chalk.magenta('Changelog:')} https://pnpm.io/v/${log.latestVersion}
${updateMessage}`,
{
padding: 1,
@@ -45,7 +45,7 @@ interface UpdateMessageOptions {
function renderUpdateMessage (opts: UpdateMessageOptions): string {
const updateCommand = renderUpdateCommand(opts)
return `Run "${chalk.magenta(updateCommand)}" to update.`
return `To update, run: ${chalk.magenta(updateCommand)}`
}
function renderUpdateCommand (opts: UpdateMessageOptions): string {

View File

@@ -2,36 +2,36 @@
exports[`print update notification for Corepack if the latest version is greater than the current 1`] = `
"
╭──────────────────────────────────────────────────────────────────
Update available! 10.0.0 → 11.0.0.
│ Changelog: https://github.com/pnpm/pnpm/releases/tag/v11.0.0 │
Run "corepack use pnpm@11.0.0" to update.
╰──────────────────────────────────────────────────────────────────
╭──────────────────────────────────────────────╮
│ │
│ Update available! 10.0.0 → 11.0.0. │
Changelog: https://pnpm.io/v/11.0.0
To update, run: corepack use pnpm@11.0.0 │
│ │
╰──────────────────────────────────────────────╯
"
`;
exports[`print update notification if the latest version is greater than the current 1`] = `
"
╭──────────────────────────────────────────────────────────────────
Update available! 10.0.0 → 11.0.0.
│ Changelog: https://github.com/pnpm/pnpm/releases/tag/v11.0.0 │
Run "pnpm add -g pnpm" to update.
╰──────────────────────────────────────────────────────────────────
╭─────────────────────────────────────────╮
│ │
│ Update available! 10.0.0 → 11.0.0. │
│ Changelog: https://pnpm.io/v/11.0.0 │
To update, run: pnpm add -g pnpm
│ │
╰─────────────────────────────────────────╯
"
`;
exports[`print update notification that suggests to use the standalone scripts for the upgrade 1`] = `
"
╭──────────────────────────────────────────────────────────────────
Update available! 10.0.0 → 11.0.0.
│ Changelog: https://github.com/pnpm/pnpm/releases/tag/v11.0.0 │
Run "pnpm self-update" to update.
╰──────────────────────────────────────────────────────────────────
╭─────────────────────────────────────────╮
│ │
│ Update available! 10.0.0 → 11.0.0. │
│ Changelog: https://pnpm.io/v/11.0.0 │
To update, run: pnpm self-update
│ │
╰─────────────────────────────────────────╯
"
`;