diff --git a/.changeset/self-update-progress-messages.md b/.changeset/self-update-progress-messages.md new file mode 100644 index 0000000000..6366ae1af5 --- /dev/null +++ b/.changeset/self-update-progress-messages.md @@ -0,0 +1,6 @@ +--- +"@pnpm/engine.pm.commands": minor +"pnpm": minor +--- + +`pnpm self-update` now prints progress messages so the command isn't silent: `Checking for updates...` before resolving, `Updating pnpm from vX to vY...` once a newer version is found, and `Successfully updated pnpm to vY` on completion. diff --git a/engine/pm/commands/src/self-updater/selfUpdate.ts b/engine/pm/commands/src/self-updater/selfUpdate.ts index bedbca69f6..a4b850019f 100644 --- a/engine/pm/commands/src/self-updater/selfUpdate.ts +++ b/engine/pm/commands/src/self-updater/selfUpdate.ts @@ -7,7 +7,7 @@ import { type Config, type ConfigContext, types as allTypes } from '@pnpm/config import { PnpmError } from '@pnpm/error' import { createResolver } from '@pnpm/installing.client' import { resolvePackageManagerIntegrities } from '@pnpm/installing.env-installer' -import { globalWarn } from '@pnpm/logger' +import { globalInfo, globalWarn } from '@pnpm/logger' import { whichVersionIsPinned } from '@pnpm/resolving.npm-resolver' import { createStoreController, type CreateStoreControllerOptions } from '@pnpm/store.connection-manager' import type { PinnedVersion } from '@pnpm/types' @@ -63,6 +63,7 @@ export async function handler ( if (isExecutedByCorepack()) { throw new PnpmError('CANT_SELF_UPDATE_IN_COREPACK', 'You should update pnpm with corepack') } + globalInfo('Checking for updates...') const { resolve } = createResolver({ ...opts, configByUri: opts.configByUri }) const pkgName = 'pnpm' const bareSpecifier = params[0] ?? 'latest' @@ -115,6 +116,7 @@ export async function handler ( return `The currently active ${packageManager.name} v${packageManager.version} is already "${bareSpecifier}" and doesn't need an update` } + globalInfo(`Updating pnpm from v${packageManager.version} to v${resolution.manifest.version}...`) const store = await createStoreController(opts) // Resolve integrities and write env lockfile to pnpm-lock.yaml @@ -138,7 +140,7 @@ export async function handler ( if (alreadyExisted) { return `The ${bareSpecifier} version, v${resolution.manifest.version}, is already present on the system. It was activated by linking it from ${baseDir}.` } - return undefined + return `Successfully updated pnpm to v${resolution.manifest.version}` } /**