Skip to content

Sort by downloads, fix CLI sync scoping and spinner output#27

Merged
kmturley merged 4 commits into
mainfrom
feature/downloads-sort
Jul 21, 2026
Merged

Sort by downloads, fix CLI sync scoping and spinner output#27
kmturley merged 4 commits into
mainfrom
feature/downloads-sort

Conversation

@kmturley

Copy link
Copy Markdown
Member

Summary

Sort by downloads (default)

  • Upgrades @open-audio-stack/core to 0.1.55 for the new per-package downloads rollup field.
  • New sortByDownloads() helper wired into list, search, and filter commands - most-downloaded first, falling back to name for ties/no data. Same default sort as studiorack-app/studiorack-site (companion PRs).
  • Fixes list.ts's manager.listPackages() call, whose old (installed, incompatible: boolean) signature predates a core release that changed it to (installed, architecture, system) - a break the core bump surfaced. --incompatible now means "skip the architecture/system filter", using the machine's real getArchitecture()/getSystem().

CLI feedback fixes (found while testing the above interactively)

  • ora's spinner.succeed()/fail() was splicing the checkmark/cross into the first line of multi-line output (e.g. a rendered table), misaligning the box-drawing border. Multi-line payloads now get a plain succeed/fail followed by the content on its own line(s).
  • The upfront registry sync in index.ts synced all four registry types on every single command invocation, with no feedback while it happened (confirmed via timing: --help took as long as list, ~1.3s). Now scoped to only the registry type actually being invoked - verified safe since installDependency/installDependencies in core already spin up their own manager per type when they need cross-type data. Wrapped in a spinner that starts immediately so the real (network-bound) wait is visible, instead of it happening silently before a near-instant command-specific spinner flashes by too fast to see.
  • open.test.ts's snapshot is now keyed by architecture: steinberg/validator only ships x64 binaries, so "installed successfully" (x64) vs "no compatible files found" (arm64) are both legitimately correct, architecture-dependent results - not one clobbering the other via -u.

Test plan

  • npm run build - clean
  • npm run lint - clean
  • npm test - 13/13 files, 19/19 tests passing
  • Verified interactively: list/search/filter rank by downloads descending; table alignment is correct with the spinner fix; plugins list dropped from ~1.3s to ~0.4s wall time after scoping sync to one registry type; --json output stays clean (no sync-status noise)

🤖 Generated with Claude Code

kmturley and others added 4 commits July 20, 2026 22:01
Sort:
- Upgrades @open-audio-stack/core to 0.1.55 for the new per-package
  `downloads` rollup field.
- Adds sortByDownloads() and wires it into list/search/filter so every
  command ranks most-downloaded packages first, falling back to name for
  ties or packages with no download data. Mirrors the same default sort
  applied in studiorack-app and studiorack-site.
- Fixes list.ts's manager.listPackages() call, whose signature (installed,
  incompatible: boolean) predates a core release that changed it to
  (installed, architecture, system) - a break the core bump surfaced.
  --incompatible now means "skip the architecture/system filter" via the
  machine's real getArchitecture()/getSystem().

CLI feedback:
- Fixes ora's spinner.succeed()/fail() splicing the checkmark/cross into
  the first line of multi-line output (e.g. a rendered table), which
  misaligned the box-drawing border. Multi-line payloads now get a plain
  succeed/fail followed by a separate console.log.
- The upfront registry sync in index.ts is now scoped to only the
  registry type actually being invoked, instead of syncing all four on
  every command (verified safe: installDependency/installDependencies in
  core already create their own manager per type when they need one).
  Also wrapped in its own spinner that starts immediately, so the real
  (network-bound) wait is visible instead of happening silently before a
  near-instant command-specific spinner flashes by.
- Snapshots updated for the new sort order; open.test.ts's snapshot is
  now keyed by architecture (steinberg/validator only ships x64 binaries,
  so "installed successfully" vs "no compatible files" is a legitimately
  different, correct expectation on x64 vs arm64, not one clobbering the
  other via -u).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
filter, get, list, and search tests asserted an "Installed" column that
silently depended on install.test.ts having already run and left
surge-synthesizer/surge on disk. Vitest doesn't guarantee alphabetical
file order, so whenever the scheduler ran one of these before install.test.ts
(or after uninstall.test.ts), the snapshot flipped from ✓ to - and failed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
execaSync blocks the whole worker event loop for as long as a spawned
command runs. On the slower mac CI runner, the steinberg/validator
install took 30s+, and that much uninterrupted blocking prevented
Vitest's worker<->main RPC heartbeat (onTaskUpdate) from being
serviced within its 60s timeout, failing the run with an "Unhandled
Error" even though every test passed.

Switching to async execa keeps the event loop free during spawns.
Explicitly ignore stdin so commands that prompt via inquirer (e.g.
`create`) still force-close deterministically instead of hanging,
since execaSync incidentally closed its stdin pipe immediately after
the sync call returned while the async API leaves it open by default.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@kmturley
kmturley merged commit 61b5465 into main Jul 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant