Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(snapshot): scan bun global packages#128

Merged
fullstackjam merged 1 commit into
mainopenbootdotdev/openboot:mainfrom
feat/snapshot-bun-globalsopenbootdotdev/openboot:feat/snapshot-bun-globalsCopy head branch name to clipboard
Jun 6, 2026
Merged

feat(snapshot): scan bun global packages#128
fullstackjam merged 1 commit into
mainopenbootdotdev/openboot:mainfrom
feat/snapshot-bun-globalsopenbootdotdev/openboot:feat/snapshot-bun-globalsCopy head branch name to clipboard

Conversation

@fullstackjam
Copy link
Copy Markdown
Collaborator

Summary

  • Add a "Bun Global Packages" capture step that runs bun pm ls -g and records installed bun globals in PackageSnapshot.Bun.
  • Parse the tree output defensively: strip tree-drawing characters, ignore the path header line, exclude bun itself, dedupe duplicates. Regex ^([@a-zA-Z0-9._/-]+)@[0-9vV] requires <name>@<version> so the path header never matches.
  • PackageSnapshot.UnmarshalJSON accepts bun across all three accepted JSON shapes: structured object, rich object array, typed {name,type} array. MarshalJSON round-trips bun unchanged.
  • bun pm ls -g failure or bun not on PATH → returns empty slice (matches CaptureNpm pattern, best-effort capture).

Cross-repo

  • Paired with openbootdotdev/openboot.dev#14, already merged. That PR accepts snapshot.packages.bun from this CLI and buckets bun globals into the persisted type: 'npm' entries so they install via npm install -g from the same registry. Raw bun array is also preserved in the snapshot blob for future UI work.

Test plan

  • go test ./internal/snapshot/... — pass (new TestParseBunList covers 6 cases incl. scoped names, bun exclusion, duplicates, malformed lines)
  • go test ./internal/config/... ./internal/ui/tui/... ./internal/cli/... ./internal/installer/... — pass (downstream consumers of PackageSnapshot still green)
  • go vet ./... — clean
  • After deploy: on a machine with bun globals installed, run openboot snapshot --publish and confirm bun packages round-trip via openboot install <slug> on another machine.

Out of scope (deferred)

  • Render bun as its own dashboard section / install via bun install -g instead of npm. Needs touching RemoteConfig, install-script generator, alias endpoint, dashboard components, presets, contract schema. Will follow once there's a concrete need for bun-specific install semantics.

Add a new capture step "Bun Global Packages" that runs `bun pm ls -g`
and records installed bun globals in PackageSnapshot.Bun. The parser
strips tree-drawing characters and ignores the path header line; bun
itself and duplicates are filtered out.

PackageSnapshot.UnmarshalJSON handles bun across all three accepted
JSON shapes (structured object, rich object array, typed array), so
snapshots produced or consumed by other tools round-trip cleanly.

The server side (openbootdotdev/openboot.dev#14) accepts the new
`packages.bun` field and buckets bun globals into the existing npm
slot so the alias install endpoint installs them via `npm install -g`
from the same registry — no downstream changes required yet.
@github-actions github-actions Bot added tests Tests only snapshot Snapshot capture/restore labels Jun 6, 2026
@fullstackjam fullstackjam merged commit 7ee22ed into main Jun 6, 2026
12 checks passed
@fullstackjam fullstackjam deleted the feat/snapshot-bun-globals branch June 6, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Snapshot capture/restore tests Tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.