altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

fix: brew formula stuck at v0.3.1, version normalization broken in publish pipeline

Open anandgupta42 opened this issue 8 months ago • 0 comments

Problem

Multiple installation issues:

  1. Homebrew formula stuck at v0.3.1 — Script.version includes the v prefix from git tags, causing double-v URLs (vv0.4.9) in the brew formula. The brew publish fails silently (wrapped in try/catch).
  2. npm EEXIST error (reported in #276) — bin conflict between brew and npm installs at /opt/homebrew/bin/altimate
  3. Brew latest() fallback dead — falls back to formulae.brew.sh which 404s since we're not in core homebrew
  4. npm optionalDependencies have v-prefixed versions (technically invalid semver)

Root Cause

packages/script/src/index.ts line 35 passes OPENCODE_VERSION (git tag e.g. v0.4.9) verbatim without stripping the v prefix. All downstream consumers (brew formula, AUR, npm, Docker) get broken versions.

Fix

  1. Strip v prefix at the source in Script.version
  2. Replace dead formulae.brew.sh fallback with brew info --json=v2 then GitHub releases API
  3. Add 64 new tests for version normalization, brew formula, and upgrade method detection

anandgupta42 avatar Mar 19 '26 01:03 anandgupta42