Repository navigation
feat: keep preview on npm's latest by itself - #2
Merged
Merged
Conversation
Any command starts a detached update check when the last one is more than 6 hours old; it never blocks the command or writes to stdout. The check reads this platform's package from the registry, downloads the latest tarball, verifies its sha512 against the registry's integrity field, checks the new binary prints its version, and installs it under ~/.runable/preview/versions/<v>. At start a binary hands off to the newest installed version, so it works for read-only installs too. Deprecating a version and moving latest back rolls machines back. PREVIEW_UPDATE=0 turns it off, PREVIEW_VERSION pins a version, PREVIEW_REGISTRY points at a mirror, and `preview upgrade` checks now. Smoke scenarios cover update, rollback, a corrupted tarball, and the pin and opt-out controls against a static fake registry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Auto-update from design section 7, without signatures for now.
preview __updatewhen the last check is more than 6 h old. It never blocks the command or writes to stdout.@runablehq/preview-<platform>from the registry, downloadslatest, checks the sha512 against the registry's integrity field, checks the new binary printspreview <v>, and installs it under~/.runable/preview/versions/<v>.execs the newest installed version named in~/.runable/preview/current, so read-only installs (/usr/local/bin, images) update too.latestback.PREVIEW_UPDATE=0,PREVIEW_VERSION=<v>,PREVIEW_REGISTRY=<mirror>,preview upgrade.preview --versionnow sayspreview 0.2.0 (checked 2 h ago), so the release workflow's version checks match on the prefix with updates off.tests/registry.py).Machines on 0.1.0 have no updater, so they need this release installed once by hand. After that they follow
lateston their own.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.