Skip to content

feat(cli): init and doctor (plan 05 session 2) - #13

Merged
ommgh merged 2 commits into
mainfrom
cli-init-doctor
Nov 14, 2026
Merged

ommgh merged 2 commits into
mainfrom
cli-init-doctor

Conversation

@ommgh

@ommgh ommgh commented Nov 13, 2026

Copy link
Copy Markdown
Member

Plan 05 session 2. Stacked on #12: review and merge that first; this PR then retargets to main.

upwell init

Shows a plan and asks once (or --yes), then:

  1. npx expo install upwell (plus expo-updates with --with-expo-updates)
  2. adds "upwell" to plugins in app.json, keeping its formatting (inline arrays stay inline); for a dynamic app.config.* it prints what to add instead, since it never edits code
  3. writes upwell/policy.json with latest = minimum = the app's current version and builds, plus ota.latestRuntimeVersion when it can be computed (a fixed string, appVersion or nativeVersion)
  4. writes upwell.json
  5. prints the UpwellProvider snippet and next steps

Nothing is written if the install fails. --dry-run, --skip-install, --static.

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 copies like a device does, and reports each finding with a code, a severity and a fix. Exits 1 when there are errors (CHECKS_FAILED, with all findings in --json).

What it checks:

  • packages: expo, upwell, expo-updates
  • expo-updates: updates.url, runtimeVersion, upwell ≥ 0.1.3 for runtime policies, channel in eas.json or headers, checkAutomatically
  • local documents: run through the app's own validator
  • published copies: HTTPS (a warning only for localhost and 10.0.2.2), reachable, valid, Cache-Control ≤ 5 min, matches the local file
  • policy vs the app being built: latest behind the app, OTA runtime differs (it tells an outdated build apart from a new one), missing ios.appStoreId

Tried for real

  • Fresh create-expo-app (blank-typescript, SDK 58): init --with-expo-updates --yes installed upwell 0.2.1 and expo-updates from npm, added the plugin and wrote the files. doctor then flagged the missing updates.url, runtime version and channel (exit 1), and init now points to eas update:configure in that case.
  • The smoke app: 0 errors. It found the deliberate 3.3.0-vs-3.4.0 runtime mismatch. That first run's suggestion pointed the wrong way, which led to the outdated-build case above.

Tests

84 Jest tests, with fixtures modelled on the smoke app before and after its device-testing fixes. The bundle test now also runs doctor --static --offline on a temporary app. The docs site builds; reference/cli has init and doctor sections and the installation page has a callout.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RX4BmNghPADsZ6GMRb2ALH

`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
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
upwell-docs Ready Ready Preview Nov 14, 2026 7:52am UTC

@ommgh
ommgh changed the base branch from cli-package to main November 14, 2026 07:51
@ommgh
ommgh merged commit e694f52 into main Nov 14, 2026
6 checks passed
@ommgh
ommgh deleted the cli-init-doctor branch November 14, 2026 07:59
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