AltimateAI / AltimateAI/altimate-code

refactor: extract isMusl() to a shared module (deduplicate 4 implementations)

オープン
#822 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
811
フォーク
134
平均マージ
3日 2時間
マージ済み PR(30日)
50

説明

Found during v0.7.1 release review (Tech Lead persona).

The same musl-detection logic exists in four places:
- `packages/opencode/script/build.ts:208-220` — TS, used by build-time `--single` guard
- `packages/opencode/bin/altimate:156-171` — JS (the npm wrapper) — early-exit
- `packages/opencode/script/postinstall.mjs:50-71` — MJS, npm postinstall early-exit
- `install:117-133` — bash, curl-install early-exit

The TS/JS/MJS copies should be lifted to `packages/opencode/script/lib/platform.mjs` (or equivalent) and imported. The bash one stays — different language.

## Why this isn't in v0.7.1

The review explicitly flagged this as a P2 (drifting fix points), and the user's rule is "Don't add features, refactor, or introduce abstractions beyond what the task requires." The v0.7.1 fix scope was the curl-install crash + binary rename. Refactor in a follow-up.

## Acceptance

- Single shared implementation, imported by all three callers.
- Existing musl tests still pass.
- A new test that asserts the three callers' detection results agree on a fixture set of `/etc/alpine-release` + `ldd --version` outputs.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。