Commit Graph
13 Commits
Author SHA1 Message Date
Willie 306bf99e0e fix(version): handle release version formats
Accept leading v prefixes during version checks, keep local metadata builds in dev mode unless they are clean exact release tags, and prevent cleanup warnings from leaking into JSON-mode stderr.
2026-06-14 15:54:25 +08:00
Willie 7280ec265f fix(version): reject malformed version segments
Return explicit comparison errors for non-numeric version segments instead of treating them as zero.

Fail closed in update checks when current or cached latest versions are malformed, and cover numeric, malformed, and cache-preserving cases.
2026-06-14 14:01:01 +08:00
Willie 8a377481cb feat(version): Homebrew-aware version check
Homebrew formula updates lag GitHub Releases by hours/days, causing
Homebrew users to see "update available" when `brew upgrade` says
already up-to-date. Now detect install method from executable path
and query `brew info --json=v2` for Homebrew installs instead of
the GitHub Release API.

- Add InstallMethod type with DetectInstallMethod() and
  FetchBrewLatestVersion() in internal/version/homebrew.go
- Check() accepts InstallMethod to branch fetch strategy
- UpdateNotification() accepts upgradeCmd (shows correct command)
- UpgradeCommand() method on InstallMethod centralizes the mapping
- doctor.go reuses versioncheck.Check() (fixes semver string
  comparison bug in old fetchUpdateMessage)
- Remove duplicated isHomebrewInstall() from upgrade.go
- Skip post-command version check for doctor (has its own)
2026-03-02 02:23:50 +08:00
Willie d99653025c refactor: unify CacheDir into config package and document all platform paths
Move GetCacheDir() from version package to config.CacheDir(), consistent
with BaseDir()/DataDir()/StateDir() pattern including Windows fallback.
Add XDG_CACHE_HOME and cache paths to website docs.
2026-02-16 12:58:28 +08:00
Willie 41e822d979 feat: remove go:embed, serve UI exclusively via runtime download
Replace the embedded SPA (go:embed + build tags) with runtime download
from GitHub Releases. The binary no longer bundles UI assets — they are
downloaded on first `skillshare ui` launch and cached at
~/.cache/skillshare/ui/<version>/.

- Delete embed.go / embed_dev.go; add spa_disk.go with placeholder handler
- Simplify ensureUIAvailable(): cache check before dev-mode fallback
- Pre-download UI assets in `skillshare upgrade` (best-effort)
- Remove Node stages from production and CI Dockerfiles
- Keep Node stage in sandbox for playground UI cache pre-population
- Remove ui-embed-check CI job and -tags dev build flag
- Update Makefile, mise.toml, GoReleaser, release workflow
2026-02-16 02:58:22 +08:00
Willie d084e59c8d fix(upgrade): gracefully handle rate limit, use cached version
- Skip CLI upgrade silently when API rate limited and no cache
- Use cached version to upgrade when API fails but cache exists
- Extract BuildDownloadURL for direct URL construction without API
- Add GetCachedVersion to expose cached latest version
2026-02-01 08:33:54 +08:00
Willie Hung f5798fc0ea fix(upgrade): add GitHub token support and improve rate limit handling
Refactored GitHub API logic into shared internal/version/github.go:
- Support GITHUB_TOKEN and GH_TOKEN environment variables
- Clear error message when rate limit exceeded with fix instructions
- Removed duplicate API code from upgrade.go and check.go
2026-01-31 03:10:55 +08:00
Willie Hung 3bb6edc12a feat(ui): redesign install command with tree-style output
- Add tree structure UI (▸ → ├─ → └─) for install progress
- Add SkillBox component for displaying skill details
- Customize survey multi-select with cleaner icons (✓, ▸)
- Unify UI across all install modes (discovery, track, subdir, direct)
- Show version number in logo for install commands
- Add logo to doctor and status commands
- Quiet git clone output for cleaner experience
2026-01-31 02:51:00 +08:00
Willie Hung 19d641d66b feat: move version cache to XDG-compliant location
Move version-check.json from ~/.skillshare/ to ~/.cache/skillshare/
to align with XDG Base Directory Specification. Add support for
XDG_CACHE_HOME environment variable. Auto-cleanup legacy cache
location on first run.
2026-01-24 23:34:23 +08:00
Willie Hung 10be270dcd fix: clear stale version cache when current >= cached latest
If user manually updates (not via skillshare upgrade), the cache
may still show an older "latest" version. Now clears cache when
current version >= cached latest to trigger fresh fetch.
2026-01-23 21:19:33 +08:00
Willie Hung fa6757664f feat: clear version cache after successful upgrade 2026-01-23 21:17:35 +08:00
Willie Hung 6fad4335d2 fix: Box padding and semver comparison
- Add padding to Box function for consistent border width
- Fix version comparison to handle semver properly (0.6.10 > 0.6.8)
2026-01-23 21:13:22 +08:00
Willie Hung fb077539da feat: add version check notification after commands
- Check GitHub releases API for new versions (24h cache)
- Display colorful update notification when update available
- Skip check for dev builds
- Cache stored at ~/.skillshare/version-check.json
2026-01-23 14:03:53 +08:00