Repository navigation
feat(cli): publish and status (plan 05 session 3) - #14
Merged
Merged
Conversation
`upwell init` sets Upwell up in an Expo app after one confirmation (or --yes): npx expo install upwell (and expo-updates with --with-expo-updates), "upwell" added to app.json plugins (instructions for a dynamic app.config), upwell/policy.json at the current version and builds (with the OTA runtime when it can be computed) and upwell.json, then the provider snippet. Never edits source files; nothing is written when the install fails. `upwell doctor` reads the resolved app config (npx expo config, falling back to app.json), package.json, eas.json, upwell.json and the documents, fetches the published policy like a device, and reports findings with a code, severity and fix: packages, expo-updates setup (update URL, runtime version, channel, upwell >= 0.1.3 for runtime policies), local and published documents (HTTPS, reachability, validity, Cache-Control, out of date) and the policy against the app being built. Exits 1 on errors. Tried on a fresh create-expo-app project and on the smoke app; the bundle test now also runs doctor. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RX4BmNghPADsZ6GMRb2ALH
`upwell publish` puts policy.json (and releases.json when there is one) at a stable public URL without hosting anything: a public GitHub gist by default (created on the first run, updated after), or a file in a public repo with --repo (Contents API, one commit per changed file, current sha). It validates both files, shows the diff against what's live, applies the same risk rules as `policy set` (now shared in src/risks.ts), and records the target and URLs in upwell.json. Private and missing repos are refused with a fix. Auth: GITHUB_TOKEN / GH_TOKEN, else `gh auth token`; a dry run needs no token. `upwell status` shows the target, last revision, local vs published per file, and whether the raw URL already serves the latest copy. init offers to publish at the end (in a terminal); doctor's fixes point at publish. Tests run against an in-memory GitHub; a read-only dry run against the real API (this repo's docs/examples) matched. Docs: "Hosting the policy" rewritten around publish, publish/status on the CLI page, quick start. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RX4BmNghPADsZ6GMRb2ALH
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Plan 05 session 3. Stacked on #13 (itself on #12). Merge in order: #12, #13, then this one.
upwell publishPuts
policy.json(andreleases.jsonwhen there is one) at a stable public URL, with no hosting:gist(default): created on the first run, updated afterhttps://gist.githubusercontent.com/<owner>/<id>/raw/policy.json--repo owner/name: Contents API, one commit per changed filehttps://raw.githubusercontent.com/<owner>/<repo>/<branch>/<path>/policy.jsonpolicy set:--yeswithout a terminal,--confirmfor raisingminimum/ loweringlatest/ changing the OTA runtime. A first publish has no risks, since nothing reads the URL yet. The rules now live insrc/risks.ts, shared withpolicy set.publish(to, the gist or repo/branch/path, andurls) inupwell.json, creating the file if needed and editing it in place otherwise.REPO_PRIVATE) and missing ones (REPO_NOT_FOUND, with thegh repo create … --publiccommand), and handles a deleted gist (GIST_NOT_FOUND).GITHUB_TOKEN/GH_TOKEN, elsegh auth token; a missing scope gets a hint.--dry-runneeds no token.upwell statusShows the target, the last revision, whether each file is in sync / differs / unpublished, and whether the raw URL already serves the latest copy (GitHub caches raw files for 5 minutes). It needs no token for public targets.
Also
initoffers to publish at the end. If publishing fails, setup still succeeds and prints how to retry.doctor's fixes now point atupwell publish.publish(gist, repo, auth, caching, rollback) and keeps self-hosting as its own section. The CLI page haspublish/statusand the new error codes; the quick start gets a pointer.Testing
publish/statusrun against an in-memory GitHub (gists, repo contents with sha checks, commits, raw URLs with a stale cache) through the injectedfetch, so no MSW.publish --repo updateswell/upwell --path docs/examples --dry-runreported the unchanged files as up to date (byte-exact base64 decoding) and showed the right diff after an edit. It wrote nothing.status.Left for the maintainer (unchecked in plan 05)
npx @upwell/cli publishto a throwaway gist. It creates a public gist on your account, so I didn't run it.init→publish→ release build reads the gist; raiseminimum,publish --confirm, and see the required update within ~5 minutes.🤖 Generated with Claude Code
https://claude.ai/code/session_01RX4BmNghPADsZ6GMRb2ALH