Open-Trader/opentrader

Check for updates when starting the app

Offen

#104 geöffnet am 29.01.2025

 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (319 Forks)auto 404
enhancementgood first issuehelp wanted

Repository-Metriken

Stars
 (2.749 Sterne)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

When running opentrader up, check if a new version of the package is available on NPM. If an update is found, log a message like:

New version available: v1.0.0.beta.100. Update with: npm i -g opentrader@latest

Note: We can use a colored text for visibility.

After showing the message, cache the check for 1 day to avoid unnecessary API requests.

We can use update-notifier or update-check or implement a custom solution. I'd prefer a custom implementation, since we can reuse this logic in the UI as well.

Checklist

  • Write a function to query the latest version of the package from NPM
  • Ensure the cache works

Contributor Guide