Open-Trader/opentrader

Check for updates when starting the app

開放

#104 建立於 2025年1月29日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (319 個分叉)auto 404
enhancementgood first issuehelp wanted

倉庫指標

星標
 (2,749 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南