From 960f1f8d13e596784da8e97afe047152f7c0efd5 Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Thu, 13 Mar 2025 14:50:59 +0100 Subject: [PATCH] fix: make improvements to the update box (#9279) close #9262 --- .../reporterForClient/reportUpdateCheck.ts | 4 +- .../reportingUpdateCheck.ts.snap | 42 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cli/default-reporter/src/reporterForClient/reportUpdateCheck.ts b/cli/default-reporter/src/reporterForClient/reportUpdateCheck.ts index 80cb0e0353..3eb1ca059c 100644 --- a/cli/default-reporter/src/reporterForClient/reportUpdateCheck.ts +++ b/cli/default-reporter/src/reporterForClient/reportUpdateCheck.ts @@ -22,7 +22,7 @@ export function reportUpdateCheck (log$: Rx.Observable, 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 { diff --git a/cli/default-reporter/test/__snapshots__/reportingUpdateCheck.ts.snap b/cli/default-reporter/test/__snapshots__/reportingUpdateCheck.ts.snap index dd4145252e..bf005cf5f6 100644 --- a/cli/default-reporter/test/__snapshots__/reportingUpdateCheck.ts.snap +++ b/cli/default-reporter/test/__snapshots__/reportingUpdateCheck.ts.snap @@ -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 │ + │ │ + ╰─────────────────────────────────────────╯ " `;