feat(ecosystem): retry a failed npm update via pnpm - #50
Merged
Merged
Conversation
Durable follow-up to the pnpm work (#47): a corporate npm registry was found to refuse npm's own fetch path for a package while pnpm's succeeded, for the exact same package, version and registry, every time — verified directly on five real packages (squad-cli, copilot, marp-cli, mermaid-cli, corepack), not assumed. Rather than requiring a person to fix each future occurrence by hand in a terminal, OpenFreshr now offers that same rescue as a button. - EcosystemUninstalling: a capability protocol mirroring UninstallingBackend's relationship to PackageBackend — only meaningful where removal is itself safe and well-understood. NpmEcosystem conforms (`npm uninstall --global -- <name>`, same token validation and `--` separator as every other action here). - EcosystemCoordinator gains `isAvailable(_:)` (a fresh, cheap probe — never a stale cached read) and `uninstall(_:)`, which routes to an ecosystem only when it actually supports removal. - AppViewModel.retryViaPnpm(_:): re-runs a failed npm package's update through pnpm instead. Only on a *confirmed* pnpm success (the coordinator's own rescan, never pnpm's claim) does it remove the stale npm-tracked copy, so `npm outdated` stops reporting a package that is verifiably current again, just through a different tool. - A "Try via pnpm" button on a failed npm package row, shown only when pnpm is actually available. Deliberately npm→pnpm specific, not a generic "try another tool" button — that pairing is the one this was verified for. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1v8n32LeqiPZd5vazB8q1
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.
Why
Direct follow-up to #47's real trigger: a corporate npm registry refuses
npm install's own fetch for a package whilepnpm addsucceeds for the exact same package, version and registry — every time, verified across five real packages tonight (squad-cli, copilot, marp-cli, mermaid-cli, corepack), each fixed by hand in a terminal. That's not durable — a sixth npm-tracked tool will hit the same wall eventually. This gives OpenFreshr the same rescue as a button.What changed
EcosystemUninstalling: a capability protocol (mirrorsUninstallingBackend's relationship toPackageBackend) — only ecosystems where removal is itself safe and well-understood implement it.NpmEcosystemnow conforms:npm uninstall --global -- <name>, same token validation and--separator as every other action in this codebase.EcosystemCoordinatorgainsisAvailable(_:)(a fresh, cheap probe, never a stale cached read) anduninstall(_:)(routes only to an ecosystem that actually supports it).AppViewModel.retryViaPnpm(_:): re-runs a failed npm package's update through pnpm instead. Only on a confirmed pnpm success (the coordinator's own rescan, never pnpm's own claim) does it remove the stale npm-tracked copy, sonpm outdatedstops reporting a package that is verifiably current again, just through a different tool.Testing
swift test: 359/359 passing, including newNpmEcosystemuninstall-command tests andEcosystemCoordinatortests forisAvailable/uninstall(routes to a supporting ecosystem, fails cleanly for a non-supporting one, fails cleanly for an unconfigured one).swift format lint --strict: clean.make app: succeeds.🤖 Generated with Claude Code
https://claude.ai/code/session_01K1v8n32LeqiPZd5vazB8q1