Consolidate Unix CLI installation managers into a shared base#3972
Open
bcotrim wants to merge 1 commit into
Open
Consolidate Unix CLI installation managers into a shared base#3972bcotrim wants to merge 1 commit into
bcotrim wants to merge 1 commit into
Conversation
Collaborator
📊 Performance Test ResultsComparing 5de064d vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
How AI was used in this PR
Claude Code traced the three platform installation managers and the shared dispatch in
ipc-handlers.ts, then hoisted the duplicated Unix logic into a base class. All changes were reviewed manually; type-checking and the existing CLI unit test were run locally.Proposed Changes
The macOS and Linux CLI installation managers were ~85% identical — shell-profile editing, symlink management, the standalone-install detection helpers, and the install/uninstall error-dialog handling were duplicated nearly verbatim, and all three platforms repeated the same auto-install try/catch shape.
This consolidates that shared logic into a single Unix base class that macOS and Linux extend, overriding only what is genuinely platform-specific (shell-profile filenames, default profile, the production CLI path, and macOS's legacy
/usr/local/binsymlink cleanup). Windows keeps its registry/path mechanics but now reuses the shared error/info dialog and auto-install helpers.Pure internal refactor: no behavior change — same dialogs, same shell-profile edits, same symlink handling, same Sentry/error reporting. Net ~240 fewer lines, making future changes to install behavior a single edit instead of three. No user-visible impact.
Testing Instructions
This is a behavior-preserving refactor, so existing CLI install/uninstall flows should work exactly as before:
studioresolves and~/.local/binis added to the shell profile; uninstall and confirm the symlink is removed (and, on macOS, the legacy/usr/local/bin/studiois cleaned up).npm run typecheck(the only failures are pre-existing missing-bundled-dep errors unrelated to this change) andnpm test -- apps/studio/src/modules/cli/lib/tests/cli-site-creator.test.tspass.Pre-merge Checklist