Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notify Option to show Changelog in default message. #213

Open
karanshah-browserstack opened this issue Oct 7, 2021 · 4 comments
Open

Notify Option to show Changelog in default message. #213

karanshah-browserstack opened this issue Oct 7, 2021 · 4 comments

Comments

@karanshah-browserstack
Copy link

karanshah-browserstack commented Oct 7, 2021

Add a option to add ChangeLog message in default message.
Example :

  ╭──────────────────────────────────╮
   │                                                                                                                                  │
   │                          Update available 0.9.2 → 1.2.0                                                     │
   │    Changelog: https://github.com/sindresorhus/public-ip/releases/tag/v1.2.0  │
   │                         Run npm i -g public-ip to update                                                  │
   │                                                                                                                                  │
   ╰──────────────────────────────────╯
@macCesar
Copy link

macCesar commented Jan 1, 2022

I also want to know how to add a link to the change log.

Like npm does it:

╭───────────────────────────────────────────────────────────────╮
│                                                               │
│      New major version of npm available! 6.14.15 → 8.3.0      │
│   Changelog: https://github.com/npm/cli/releases/tag/v8.3.0   │
│               Run npm install -g npm to update!               │
│                                                               │
╰───────────────────────────────────────────────────────────────╯

@equiman
Copy link

equiman commented Jul 1, 2022

It will be good to have it as a property, but actually you can do it using the custom message option:

https://github.com/yeoman/update-notifier#options-and-custom-message

@astorije
Copy link
Contributor

If that's any useful, I am now using the following custom message based on this thread and https://github.com/yeoman/update-notifier/blob/main/update-notifier.js#L152-L156:

if (notifier.update) {
  notifier.notify({
    message: `New ${notifier.update.type} version available: ${chalk.dim(
      '{currentVersion}',
    )}${chalk.reset(' → ')}${
      notifier.update.type === 'major' ? chalk.red('{latestVersion}')
        : notifier.update.type === 'minor' ? chalk.yellow('{latestVersion}')
        : chalk.green('{latestVersion}')
    }\n` +
    `Run ${chalk.cyan('{updateCommand}')} to update\n` +
    '${chalk.dim.underline(`${packageJson.homepage ?? ''}/releases`)}`,
  });
}

Result:

Screen Shot 2022-08-25 at 6 45 43 PM

I would love for this to be the default! Or at the very least be able to append to the default template without having to re-specify it entirely!

@LitoMore
Copy link
Contributor

@equiman Use https://github.com/sindresorhus/terminal-link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants