feat: add ghlt update command and update advisory banner#3
feat: add ghlt update command and update advisory banner#3warengonzaga merged 3 commits intomainfrom
ghlt update command and update advisory banner#3Conversation
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
ghlt update command and update advisory banner
🔧 Patch BuildPatch version for testing hotfixes 📦 Package Information
📥 Installation InstructionsNPM Registrynpm install github-labels-template@0.8.0-patch.30e7740
npm install github-labels-template@patch # Use dist-tagGitHub Packagesnpm install @warengonzaga/github-labels-template@0.8.0-patch.30e7740
npm install @warengonzaga/github-labels-template@patch # Use dist-tag✨ Auto-scoped as 🔒 Security Audit✅ No vulnerabilities found This package was built automatically by the Package Build Flow action. |
There was a problem hiding this comment.
Pull request overview
This PR adds a self-update command and update advisory banner to help users stay on the latest version of ghlt. The implementation includes version checking utilities with 24-hour cache TTL, automatic package manager detection, and comprehensive test coverage for the core utilities.
Changes:
- New
ghlt updatecommand with--check/--dry-runflags for version management - Update advisory banner displayed on CLI startup when newer version is available
- Version checking utilities with local caching and background refresh mechanism
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/commands/update.ts | New command to self-update ghlt with automatic package manager detection |
| src/utils/updater.ts | Core utilities for version comparison, caching, and update checking |
| src/ui/banner.ts | Added showUpdateBanner function to display update advisory |
| src/index.ts | Integrated update check and banner display into CLI entry point |
| tests/updater.test.ts | Comprehensive test coverage for updater utilities (21 tests) |
|
@copilot apply changes based on the comments in this thread |
Co-authored-by: warengonzaga <15052701+warengonzaga@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
🔧 Patch BuildPatch version for testing hotfixes 📦 Package Information
📥 Installation InstructionsNPM Registrynpm install github-labels-template@0.8.0-patch.f835045
npm install github-labels-template@patch # Use dist-tagGitHub Packagesnpm install @warengonzaga/github-labels-template@0.8.0-patch.f835045
npm install @warengonzaga/github-labels-template@patch # Use dist-tag✨ Auto-scoped as 🔒 Security Audit✅ No vulnerabilities found This package was built automatically by the Package Build Flow action. |
src/utils/updater.ts— version comparison, cache management, update check utilitiessrc/commands/update.ts—ghlt updatecommand with--check/--dry-runflagsrc/ui/banner.ts— addshowUpdateBanner()functionsrc/index.ts— registerupdatecommand and inject update advisory bannertests/updater.test.ts— tests for version comparison logic and cache TTL behaviorinner1/inner2duplication inshowUpdateBanner(banner.ts)beforeEach/afterEachfor consistent env var cleanup in updater testsjoin(cacheFile, "..")→dirname(cacheFile)for correct path resolutionrenameSyncinwriteCacheto prevent race conditionsisNewerVersion; add NaN guardconsole.debuglogging infetchLatestVersioncatch blockghlt updateshowUpdateBannertest suite to banner.test.tsprocess.pidin temp file name to prevent collisionsOriginal prompt
updatecommand and update advisory banner #2🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.