"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const cli_meta_1 = require("@pnpm/cli-meta");
const chalk = require("chalk");
const updateNotifier = require("update-notifier");
function default_1() {
    const notifier = updateNotifier({ pkg: cli_meta_1.default });
    const update = notifier.update;
    if (!update) {
        return;
    }
    // Although, "pnpm i -g pnpm" works in most cases, we have a big amount of users
    // experiencing issues with it: https://github.com/pnpm/pnpm/issues/1203
    // So until the issues are not fixed, we are recommending to update pnpm using npm.
    const message = `Update available! ${chalk.red(update.current)} → ${chalk.green(update.latest)}
${chalk.magenta('Changelog:')} https://github.com/pnpm/pnpm/releases/tag/v${update.latest}
Run ${chalk.magenta('npm i -g pnpm')} to update!

Follow ${chalk.magenta('@pnpmjs')} for updates: https://twitter.com/pnpmjs`;
    notifier.notify({ message });
}
exports.default = default_1;
