Skip to content

Commit eb3687e

Browse files
Friendlier auto-upgrade messaging
Before: Upgrading Shopify CLI by running: `pnpm add -g @shopify/cli@latest`... After: ✨ New version of Shopify CLI available! (3.94.3 → 3.95.0) Now upgrading by running: `pnpm add -g @shopify/cli@latest`... [package manager output] ╭─ success ──────────────────────────────╮ │ Shopify CLI upgraded │ │ │ │ You're now on version 3.95.0. │ ╰────────────────────────────────────────╯ - Pre-message now states *what just happened* ("new version available") and shows the version range when known. - Adds a `renderSuccess` banner after a successful upgrade so users get explicit confirmation instead of silence. - The version range comes from `checkForCachedNewVersion`, which is already populated by `versionToAutoUpgrade()` upstream — no extra network call.
1 parent bcb63d5 commit eb3687e

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

packages/cli-kit/src/public/node/upgrade.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
getPackageManager,
1313
} from './node-package-manager.js'
1414
import {outputContent, outputDebug, outputInfo, outputToken, outputWarn} from './output.js'
15+
import {renderSuccess} from './ui.js'
1516
import {cwd, moduleDirectory, sniffForPath} from './path.js'
1617
import {exec, isCI} from './system.js'
1718
import {isPreReleaseVersion} from './version.js'
@@ -92,8 +93,23 @@ export async function runCLIUpgrade(options: RunCLIUpgradeOptions = {}): Promise
9293
if (!command) {
9394
throw new Error('Could not determine the command to run')
9495
}
95-
outputInfo(outputContent`Upgrading Shopify CLI by running: ${outputToken.genericShellCommand(installCommand)}...`)
96+
// Cache lookup — already populated by versionToAutoUpgrade() upstream, so this
97+
// is just a synchronous cache read, no extra network call.
98+
const newerVersion = checkForCachedNewVersion('@shopify/cli', CLI_KIT_VERSION)
99+
const headline = newerVersion
100+
? `✨ New version of Shopify CLI available! (${CLI_KIT_VERSION}${newerVersion})`
101+
: '✨ New version of Shopify CLI available!'
102+
outputInfo(
103+
outputContent`${headline}
104+
Now upgrading by running: ${outputToken.genericShellCommand(installCommand)}...`,
105+
)
96106
await exec(command, args, {stdio: 'inherit'})
107+
renderSuccess({
108+
headline: 'Shopify CLI upgraded',
109+
body: newerVersion
110+
? `You're now on version ${newerVersion}.`
111+
: "You're now on the latest version.",
112+
})
97113
} else if (projectDir) {
98114
await upgradeLocalShopify(projectDir, CLI_KIT_VERSION)
99115
} else {

0 commit comments

Comments
 (0)