Compare commits

..
Author SHA1 Message Date
Brent Vatne 12937e232e Arrow keys, Return and held keys on Screens; the status as a dot by the route
- ↑ and ↓ move to the card above or below, read from where the cards sit, so
  they follow the grid at any width; ← and → keep the page's order.
- Held, an arrow keeps stepping as Compare's do; the browser's own repeat no
  longer scrolls the page under the hold.
- Return opens the picked screen in the Inspector from anywhere on the page,
  as it already did from the card.
- Holds start sooner everywhere: 250ms before the first repeat (was 400), then
  200ms (was 300) down to the 70ms floor.
- A card's status is the tree's dot before its route, so the page says Changed
  as the tree's legend does instead of a separate "Modified"; the word stays in
  the dot's accessible name. Routes are 10.5px so a 28-character one still fits.
2026-10-15 23:03:56 -07:00
Brent Vatne adc453889a Follow the tree's order on Screens, fit landscape screenshots, and keep Ctrl+1–3 to Macs
From review:
- The grid and its arrow keys follow the tree's order (treeScreenOrder), depth
  first. Sections list folders in the order they were found, so a nested
  folder found after a sibling put its screens after that sibling's, unlike
  the sidebar.
- A screenshot fits the well both ways at its own proportions, and a missing
  one is fitted to the well as on the Map: a landscape capture is no longer
  letterboxed in a portrait-sized frame, nor its placeholder clipped.
- Ctrl+1–3 are handled and printed only on Apple keyboards: elsewhere the
  browser keeps Ctrl+1–8 for its tabs.
- The arrows are desktop only; they work right after Screens is opened from
  the toolbar, and a pick that Changed hides steps to the nearest shown card
  past it in the tree.
2026-10-15 22:36:55 -07:00
Brent Vatne 7f10dcdf63 Give Screens cards room for a 28-character route on Linux's fonts
CI's fonts set /requesting-a-completed-form at 191px, past the 184px a 208px
card left for it. Cards are 216px with 8px footer padding (198px for the
route) and 12px gaps, so five still fit beside the tree at 1440px.
2026-10-15 22:26:09 -07:00
Brent Vatne 9ada6975ea Step through the Screens cards with ← and →
← and → pick the previous or next card in the grid's order, as the arrows
step through screens in Compare; with nothing picked, → starts at the first
card. A step picks the screen as the tree does, leaving the Inspector as it
is, and focus follows it. The tree's rows keep ← and → for folding, and
controls outside the page keep their keys. The shortcuts list shows both.
2026-10-15 22:18:10 -07:00
Brent Vatne 2bd839e53e Show Screens as one grid of screen cards, and switch views with Ctrl+1/2/3
On desktop the Screens page is one evenly spaced grid in the order of the tree
beside it, without section headings: the tree already names the folders. Each
screen is a card, the screenshot in a grey well with the route and its status
(a dot and a word) under it, so the page reads as a list of screens rather
than a canvas. Phones keep their sections and jump bar.

A selected card's screenshot button is pressed, and a focused pressed button
brightens (styles.css). On these cards that washed out the screenshot and,
as a filter, became the box the status was placed in, lifting it into the
well after an arrow key; the filter is off here and focus rings the card.

Ctrl+1, Ctrl+2 and Ctrl+3 open Map, Screens and Compare, beside M, S and C.
They take the Control key itself on every keyboard (⌃ on a Mac), since the
browser keeps ⌘1–⌘9 for its tabs.
2026-10-15 22:13:40 -07:00
16 changed files with 54 additions and 227 deletions

No files matched your search

+12 -52
View File
@@ -20,49 +20,9 @@ Explore maps your app: a screenshot of every screen, connected by the taps betwe
</details>
## Quick start
## Try it on your app
Review a change to your own app, on your machine. You need an Expo SDK 57+ app with Expo Router or React Navigation, Node.js 24.12+, and EAS Simulator access ([join the waitlist](https://expo.dev/services/simulators)). No API keys, no CI.
From your app's directory:
1. **Make the app buildable on EAS, if it is not yet.**
```sh
npx eas-cli@latest login
npx eas-cli@latest init
```
Then set `ios.bundleIdentifier` in your app config, add a simulator profile to `eas.json`, and commit. The review builds your last commit as the "before".
```json
{ "build": { "explore": { "ios": { "simulator": true } } } }
```
2. **Change a screen, then review the change.** Edit some text near the top of a screen (Explore captures the first screenful) and run:
```sh
npx @expo/explore capture
```
Explore builds your last commit and your uncommitted changes on EAS, captures the screens the changes can affect, before and after, on EAS Simulator, and opens the report in your browser. The first run waits for an EAS build; later runs reuse it while your native code is unchanged.
Or paste this into Claude Code or Codex from your app's directory:
```text
Show me an Expo Explore review of a change to this app. Follow the "Review a change on
this machine" section of https://unpkg.com/@expo/explore/skills/explore-setup/SKILL.md.
If the app cannot build for the iOS Simulator on EAS yet, set that up (an EAS project,
ios.bundleIdentifier, an "explore" profile with ios.simulator: true) and ask me before
you commit it. If I have no uncommitted changes, change some text near the top of a
screen. Then run npx @expo/explore capture and open the report.
```
Explore uses its defaults until you run `npx @expo/explore setup`, which writes `.expo-explore/config.yaml` for you to change. Next: [review every pull request](#set-up-ci).
## Map every screen of any app
To map every screen of an app instead, with no config, paste this into Claude Code or Codex from your app's directory. It explores a build you point to, or an Expo project straight from its source:
Paste this into Claude Code or Codex from your app's directory. It explores a build you point to, or an Expo project straight from its source:
```text
Show me Expo Explore working on this app. Follow
@@ -129,7 +89,7 @@ One card per screen the run reached, laid out by how many taps it took, with the
### Review a change before you push it
The review a PR gets also runs on your machine, between any two commits, with your committed `.expo-explore/config.yaml` or, before you have one, [the defaults](#quick-start). No tokens or keys to set: it uses your `eas login` and your Claude Code or Codex login.
Once Explore is [set up](#set-up-ci) (`.expo-explore/config.yaml` committed), the review a PR gets also runs on your machine, between any two commits. No tokens or keys to set: it uses your `eas login` and your Claude Code or Codex login.
```text
Review my current changes with Expo Explore. Follow the "Review a change on this machine"
@@ -148,13 +108,13 @@ Every run is kept on your machine for 30 days. `npx @expo/explore reports` lists
<summary><strong>Run it yourself</strong></summary>
```sh
npx @expo/explore capture # HEAD and your uncommitted changes, against where HEAD left the default branch
npx @expo/explore capture --committed # HEAD alone
npx @expo/explore capture --base v1.3.0 --head v1.4.0 --scope all --upload
npx @expo/explore capture:review # HEAD against where it left the default branch
npx @expo/explore capture:review --uncommitted # your uncommitted changes too
npx @expo/explore capture:review --base v1.3.0 --head v1.4.0 --scope all --upload
```
- It checks out both commits as temporary worktrees, installs their dependencies, captures every configured platform on EAS Simulator (`--platform` picks one), and opens the report in a local Viewer. `--upload` hosts it and prints the link; `report:upload <report.zip>` hosts one you already have.
- Your checkout, index and branches are never touched. Your uncommitted changes, untracked files included, are reviewed as `eas build` would upload them; `--committed`, or `cli.requireCommit: true` in `eas.json`, leaves them out.
- Your checkout, index and branches are never touched. `--uncommitted` takes tracked changes only; `--include-untracked` adds untracked files, which are uploaded with the EAS build.
- It runs both commits' code on your machine, as you: installing their dependencies, evaluating the app config, and bundling the JavaScript. That is what checking them out and running them would do, so review only commits you would run, and someone else's branch only if you trust it.
- Installs run without credential environment variables, which keeps tokens out of reach of a registry a commit's `.npmrc` names; that is not a sandbox. A registry that needs `${NPM_TOKEN}` in the project's `.npmrc` must be authenticated in your own `~/.npmrc`.
- Captures are cached in `~/.cache/expo-explore`, so the same base is not captured twice (`--no-cache` skips it); a capture unused for 30 days goes, and the cache stays under 2 GB. Ctrl+C stops the run's simulator sessions.
@@ -194,8 +154,8 @@ report:
```
- Run `expo-explore setup --workflows` after enabling it to add the `deploy` job.
- A [comparison of two commits](#compare-any-two-commits) links its hosted report from the run's summary instead of a PR comment. `capture --upload` on your machine deploys to the same project with your `eas login`.
- `expo-explore report:upload <report.zip>...` hosts reports already on your machine the same way: a review's reports (one per platform, from `capture --output` or a downloaded `explore-review` artifact) or an `explore:binary` report.
- A [comparison of two commits](#compare-any-two-commits) links its hosted report from the run's summary instead of a PR comment. `capture:review --upload` on your machine deploys to the same project with your `eas login`.
- `expo-explore report:upload <report.zip>...` hosts reports already on your machine the same way: a review's reports (one per platform, from `capture:review --output` or a downloaded `explore-review` artifact) or an `explore:binary` report.
- `EXPO_TOKEN` must be able to create the EAS project, so use a [robot user's](https://docs.expo.dev/accounts/programmatic-access/) token.
- The report is encrypted, and only a request carrying the link's token can open it. Treat the link like a shared file link; see [report access](docs/private-review.md#hosted-previews).
@@ -212,7 +172,7 @@ The prompt above walks through these steps with you. To do them yourself:
- `EXPO_TOKEN`: create it in [Expo access tokens](https://expo.dev/settings/access-tokens). For [hosted previews](#hosted-previews), use a [robot user](https://docs.expo.dev/accounts/programmatic-access/) that can create projects.
- A secret for each `{{secret:NAME}}` in your setup steps. Run `npx @expo/explore setup --workflows` after you add one.
4. Commit, merge to the default branch, and run **Expo Explore baseline** from GitHub Actions.
5. Open a PR. **Expo Explore review** runs and posts a comment with the report. To see a whole review of your branch first, run `npx @expo/explore capture` on your machine.
5. Open a PR. **Expo Explore review** runs and posts a comment with the report. To see a whole review of your branch first, run `npx @expo/explore capture:review` on your machine.
A failed run shows an error code and a next action in the PR comment; see [CI troubleshooting](docs/quickstart-ci.md#diagnose-a-failed-run).
@@ -292,7 +252,7 @@ There are a few ways to snapshot a release:
- **On demand:** in your repository's Actions tab, open **Expo Explore compare**, choose **Run workflow**, and set `base` to the last release's tag (`v1.3.0`), `head` to the new tag or release candidate (`v1.4.0-rc.1`), `scope` to `all` and `expires-in` to `never`. The run's summary links the report.
- **Automatically, on every tag:** add the `release-review.yml` in [The comparison workflow](#compare) below. It compares each tag, release candidates included, with the last stable tag, so a release candidate is reviewed against what people have now.
- **On your machine, without CI:** `npx @expo/explore capture --base v1.3.0 --head v1.4.0 --scope all --upload`, with your `eas login`. `npx @expo/explore reports` lists the runs you have kept.
- **On your machine, without CI:** `npx @expo/explore capture:review --base v1.3.0 --head v1.4.0 --scope all --upload`, with your `eas login`. `npx @expo/explore reports` lists the runs you have kept.
`scope: all` captures every screen, not only those whose source changed, so the report shows the whole release with what changed since the last one marked; `expires-in: never` keeps its link.
@@ -448,7 +408,7 @@ curl -s "$LINK/api/v1/screens?status=modified" | jq '.items[] | {route, status,
4. It compares the captures. A screen with a source change is **Modified** if its captures differ.
5. It uploads the report to GitHub Actions and posts a PR comment.
The same review runs for any two commits without a PR ([`explore-compare.yml`](#compare-any-two-commits), linking the report from the run summary) and on your machine (`capture`, [above](#review-a-change-before-you-push-it)). The workflows' logic lives in `expo-explore ci:*` commands, so a fix reaches CI with the `@expo/explore` version the workflows pin.
The same review runs for any two commits without a PR ([`explore-compare.yml`](#compare-any-two-commits), linking the report from the run summary) and on your machine (`capture:review`, [above](#review-a-change-before-you-push-it)). The workflows' logic lives in `expo-explore ci:*` commands, so a fix reaches CI with the `@expo/explore` version the workflows pin.
Reports and baselines are kept for 30 days and diagnostics for 7. Hosted deployments are never deleted automatically; see [report access](docs/private-review.md).
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@expo/explore",
"version": "0.19.5",
"version": "0.19.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@expo/explore",
"version": "0.19.5",
"version": "0.19.3",
"license": "MIT",
"dependencies": {
"@expo/repack-app": "0.10.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@expo/explore",
"version": "0.19.5",
"version": "0.19.3",
"description": "Source-driven mobile app maps, deterministic CI capture, and visual reviews",
"license": "MIT",
"type": "module",
+6 -6
View File
@@ -152,18 +152,18 @@ Repeat `expo-explore doctor --json` and fix each `fail` until none remain, colle
## Review a change on this machine
The same review CI runs works locally, between any two commits. It reads `.expo-explore/config.yaml` from the head commit, else from the checkout when setup wrote it but it is not committed, else uses the defaults `setup --non-interactive` would write (with several simulator profiles, the one named `explore`), so it works before setup:
Once `.expo-explore/config.yaml` is committed, the same review CI runs works locally, between any two commits:
```sh
npx @expo/explore capture # HEAD and the uncommitted changes, against where HEAD left the default branch
npx @expo/explore capture --committed # HEAD alone
npx @expo/explore capture --base v1.3.0 --head v1.4.0 --scope all
npx @expo/explore capture:review # HEAD against where it left the default branch
npx @expo/explore capture:review --uncommitted # your uncommitted changes to tracked files against HEAD's base
npx @expo/explore capture:review --base v1.3.0 --head v1.4.0 --scope all
```
- It prints which commits it compares. Each is checked out as a detached worktree in a temporary directory, its dependencies installed (frozen lockfile, no scripts, no Explore credentials in the environment), and removed afterwards; the user's checkout, index and branches are never touched.
- It runs both commits' code as the user (dependency installs, the app config, bundling). Before reviewing a branch the user did not write, say so and ask; credential-free installs are not a sandbox.
- Logins: `EXPO_TOKEN` and the provider's API key when they are set; otherwise the user's `eas login` and their local `claude` or `codex` login for the configured provider. If `eas whoami` fails, tell them to run `eas login`.
- Without `--head`, the head is HEAD plus the working tree's changes, untracked non-ignored files included, which is what `eas build` uploads. It lists them; check that list for secrets the user would not want built. `--committed` reviews HEAD alone, and an `eas.json` with `cli.requireCommit: true` leaves the changes out unless `--uncommitted` is passed.
- `--uncommitted` includes tracked files only. `--include-untracked` adds untracked, non-ignored files, which are uploaded with the EAS build, so check the listed files first and never include secrets.
- Every configured platform is reviewed unless `--platform` picks one. It opens the report in a local Viewer; `--upload` hosts it instead and prints the link, `--no-open` or `--json` only prints the report paths.
- Every run is kept on this machine for 30 days: `npx @expo/explore reports list` (or `--json`) shows them, `reports open <id|latest>` reopens one in the local Viewer, and `reports upload <id>` hosts it without capturing again. Run bare in a terminal, `reports` is an arrow-key picker for the user.
- To host a report after the fact, run `npx @expo/explore report:upload <report.zip>...` with the paths it printed (or the `--output` directory's `<platform>/report.zip`), one per platform. It uses the same project as `--upload` and does not capture again.
@@ -176,7 +176,7 @@ npx @expo/explore capture --base v1.3.0 --head v1.4.0 --scope all
- **Releases.** Unless the user asks otherwise, compare each release with the last stable release, with `scope: all` (every screen, so the report shows the whole release with what changed marked) and, when hosted previews are on, `expires-in: never` (the link outlives the 30-day artifact). For every tag as it is pushed, add the `release-review.yml` from the README's "Compare any two commits" section: it finds the newest earlier tag without a `-` (so a release candidate is compared with the last stable release) and calls `explore-compare.yml` with `secrets: inherit` and `permissions: { contents: read, actions: read }`. A nightly compares with yesterday's tag; a release branch with `main`.
- **Once, on demand.** The workflow must be on the default branch to be dispatched: `gh workflow run explore-compare.yml -f base=<ref> -f head=<ref> -f scope=all -f expires-in=never`, or **Run workflow** under Actions → Expo Explore compare.
- **Without CI.** `npx @expo/explore capture --base <ref> --head <ref> --scope all --upload` runs the same comparison on this machine (see the previous section).
- **Without CI.** `npx @expo/explore capture:review --base <ref> --head <ref> --scope all --upload` runs the same comparison on this machine (see the previous section).
- Call the workflow once per workflow run (a second call in the same run reuses the first one's artifact names). A `base` the baseline workflow captured in the last 30 days is reused, so only `head` is captured.
- To verify, run it once on the latest tag and open the run's summary: it lists each platform's result and links the report.
+4 -5
View File
@@ -1,6 +1,6 @@
---
name: readme-refresh
description: Refresh Expo Explore's README.md with euxy (github.com/brentvatne/euxy) as the reference app. Regenerate every screenshot in docs/screenshots from a current euxy review report and PR comment, then re-read the README as a first-time user: the top level only says what Explore does, links the live euxy example, gives numbered quick-start steps for reviewing a change to your own app, a prompt to copy for exploring any build, and one for setting up CI; everything else lives in collapsibles. Use after a Viewer or PR-comment change that the README shows, a new command or setting, or a release that made a README claim stale. Not for the docs/ guides or the shipped skills.
description: Refresh Expo Explore's README.md with euxy (github.com/brentvatne/euxy) as the reference app. Regenerate every screenshot in docs/screenshots from a current euxy review report and PR comment, then re-read the README as a first-time user: the top level only says what Explore does, links the live euxy example, and gives a prompt to copy for trying it on your app and one for setting up CI; everything else lives in collapsibles. Use after a Viewer or PR-comment change that the README shows, a new command or setting, or a release that made a README claim stale. Not for the docs/ guides or the shipped skills.
---
# Refresh the README
@@ -60,10 +60,9 @@ Look at every PNG you produced before committing, light and dark: the selected s
Read the README top to bottom once without opening a collapsible. At that level it may only answer, in this order:
1. What Explore is (one short paragraph), the hero image, and the link to the live euxy example (`explore-example--euxy.expo.app`, redeployed on every merge to main by `.github/workflows/example-report.yml`).
2. **Quick start**: the smallest set of steps to see a review of the reader's own Expo app on their machine, numbered and with nothing optional in them: make the app buildable on EAS (login, init, bundle identifier, a simulator profile named `explore`) and commit (the before build is the last commit), then edit a screen near its top and run `capture`, which reviews uncommitted changes as `eas build` would upload them and uses setup's defaults when there is no config. After the steps, a prompt that has Claude Code or Codex do the same through the explore-setup skill's "Review a change on this machine" section. Run the steps on a fresh `create-expo-app` before changing them.
3. **Map every screen of any app**: one sentence and a prompt to paste into Claude Code or Codex that gets a simulator build of any app (Expo or not, or just a build) and runs `explore:binary` on it. After its collapsibles, **Review a change before you push it**: one sentence, a prompt that runs `capture` locally (the explore-setup skill's "Review a change on this machine" section) on a set-up app, and the `reports` picker image (`readme-reports-*.png`) with one sentence on saved runs, at the top level, not inside a collapsible. Each section keeps its own "Run it yourself"; never put one section between another's prompt and its collapsibles.
4. **Set up CI**: one sentence, then two subsections, each a sentence on what it gives and a prompt to paste: **Review on every PR** (the setup prompt, then a few grouped collapsibles: Hosted previews first, then Manual setup (the setup prompt's steps done by hand, in order: setup, doctor, secrets, baseline, first PR), Capture modes: deterministic or agent, iOS, Android, or both, Keep your setup current) and **Compare any two commits** (a prompt that follows the explore-setup skill's "Compare any two commits" section, the ways to snapshot a release as bullets, then the comparison workflow collapsed).
5. **What you get**: the PR comment, Compare, and Screens, each a heading, one line, and its picture, then a prompt for asking an agent about a report.
2. **Try it on your app**: one sentence and a prompt to paste into Claude Code or Codex that gets a simulator build of any app (Expo or not, or just a build) and runs `explore:binary` on it. After its collapsibles, **Review a change before you push it**: one sentence, a prompt that runs `capture:review` locally (the explore-setup skill's "Review a change on this machine" section) on a set-up app, and the `reports` picker image (`readme-reports-*.png`) with one sentence on saved runs, at the top level, not inside a collapsible. Each section keeps its own "Run it yourself"; never put one section between another's prompt and its collapsibles.
3. **Set up CI**: one sentence, then two subsections, each a sentence on what it gives and a prompt to paste: **Review on every PR** (the setup prompt, then a few grouped collapsibles: Hosted previews first, then Manual setup (the setup prompt's steps done by hand, in order: setup, doctor, secrets, baseline, first PR), Capture modes: deterministic or agent, iOS, Android, or both, Keep your setup current) and **Compare any two commits** (a prompt that follows the explore-setup skill's "Compare any two commits" section, the ways to snapshot a release as bullets, then the comparison workflow collapsed).
4. **What you get**: the PR comment, Compare, and Screens, each a heading, one line, and its picture, then a prompt for asking an agent about a report.
Lead with prompts, not explanations: a reader should be able to copy something and see Explore work. Everything else, the manual commands, requirements, options, the manual setup, capture modes, hosted previews, iOS and Android, agent mode, repository settings, how agents read a report, how it works, limitations, contributing, goes into a `<details>` block under the section it belongs to, with a `<summary>` that says what the reader will find. Keep bullets to one or two sentences. Group related collapsibles rather than adding one per topic, so a section shows a handful, not nine. Requirements sit collapsed right under the example report link. Keep the collapsibles' `id` attributes that other docs link to (`#hosted-previews`, `#platforms`, `#compare`, `#agents`), and keep the Inspiration section (screenmap and Revyl's Atlas).
+14 -58
View File
@@ -8,7 +8,7 @@ import { runCiReview } from "./pipeline.js";
import { resolveCommit } from "./workflow-steps.js";
import { ciLayout, installCommand, type PackageManager } from "./workflow-install.js";
import { configPlatforms, readExploreConfig, resolvePlatformConfig, withRunOverrides, DEFAULT_EXPLORE_CONFIG_PATH, type ExploreConfig, type ExplorePlatform } from "../config/explore-config.js";
import { AGENT_PROVIDERS, defaultExploreConfig } from "../config/setup.js";
import { AGENT_PROVIDERS } from "../config/setup.js";
import type { PrepareCiExplorationOptions } from "../capture/agent/exploration.js";
import { createCiAgentSession } from "../capture/agent/session.js";
import { createLocalCiAgentSession } from "../capture/agent/session-local.js";
@@ -32,10 +32,10 @@ export type LocalReviewOptions = {
project: string;
base?: string | undefined;
head?: string | undefined;
/** Review HEAD alone, leaving out the working tree's changes. */
committed?: boolean | undefined;
/** Review the working tree even when eas.json sets cli.requireCommit. Without --head this is the default. */
/** Review uncommitted changes to tracked files as the head (the working tree, not a commit). */
uncommitted?: boolean | undefined;
/** With `uncommitted`: also include untracked files that are not ignored. */
untracked?: boolean | undefined;
platform?: ExplorePlatform | undefined;
scope?: string | undefined;
expiresIn?: string | undefined;
@@ -89,7 +89,7 @@ export async function snapshotWorkingTree(root: string, options: { untracked?: b
for (const file of untracked) bytes += (await stat(join(root, file)).catch(() => ({ size: 0 }))).size;
if (bytes > UNTRACKED_LIMIT_BYTES) throw new CiError({ code: "LOCAL_REVIEW_UNTRACKED_TOO_LARGE", stage: "preflight",
message: `The untracked files add up to ${Math.round(bytes / 1024 / 1024)} MB; they would be uploaded with the EAS build.`,
nextAction: "Ignore or commit the large files, or pass --committed to review HEAD alone." });
nextAction: "Ignore or commit the large files, or leave out --include-untracked." });
must(git(root, ["add", options.untracked ? "-A" : "-u", "--", "."], environment), "Cannot stage the working tree", "Check the repository's state.");
const tree = must(git(root, ["write-tree"], environment), "Cannot write the working tree", "Check the repository's state.");
await rm(index, { force: true });
@@ -271,49 +271,6 @@ export async function stopRecordedSessions(outputs: string[], environment: NodeJ
return stopped;
}
/**
* What the head of a review without --head is: the working tree, as `eas build` uploads it (tracked and untracked
* files, not ignored ones), unless the app's eas.json sets cli.requireCommit, which makes eas build refuse uncommitted
* changes, or --committed asks for HEAD alone. --head names a commit, so the working tree is never part of it.
*/
export async function reviewHeadSource(options: Pick<LocalReviewOptions, "head" | "committed" | "uncommitted">, project: string):
Promise<"working-tree" | "commit" | "require-commit"> {
const namedHead = options.head !== undefined && options.head !== "HEAD";
if (options.uncommitted && (namedHead || options.committed)) throw new CiError({ code: "LOCAL_REVIEW_UNCOMMITTED_HEAD", stage: "preflight",
message: "--uncommitted reviews the working tree, which is on top of HEAD.", nextAction: `Leave out ${namedHead ? "--head" : "--committed"}, or leave out --uncommitted.` });
if (namedHead || options.committed) return "commit";
if (options.uncommitted) return "working-tree";
let eas: unknown;
try { eas = JSON.parse(await readFile(join(project, "eas.json"), "utf8")); } catch { return "working-tree"; }
const cli = eas !== null && typeof eas === "object" ? (eas as { cli?: unknown }).cli : undefined;
return cli !== null && typeof cli === "object" && (cli as { requireCommit?: unknown }).requireCommit === true ? "require-commit" : "working-tree";
}
/**
* The config a local review runs with: the head commit's; else the one in your checkout, when setup has written it but
* it is not committed yet; else the defaults setup would write, so an app can be reviewed before it is set up. A
* config path passed with --config must be in the head commit.
*/
export async function localReviewConfig(options: { project: string; head: string; configPath: string; explicit: boolean;
platform?: ExplorePlatform | undefined; progress?: Progress }): Promise<ExploreConfig> {
const progress = options.progress ?? silentProgress;
if (options.explicit || await exists(join(options.head, options.configPath))) return readExploreConfig(options.head, options.configPath);
if (await exists(join(options.project, options.configPath))) {
progress(`config: ${options.configPath} from your checkout (it is not in the head commit)`);
return readExploreConfig(options.project, options.configPath);
}
let config: ExploreConfig;
try { config = await defaultExploreConfig(options.project, options.platform); }
catch (error) {
throw new CiError({ code: "LOCAL_REVIEW_CONFIG_DEFAULTS", stage: "preflight",
message: `There is no ${options.configPath}, so this review uses setup's defaults, which need this: ${(error as Error).message}`,
nextAction: "Fix that and rerun (with several simulator profiles, the one named explore is used), or run expo-explore setup to write a config." });
}
progress(`config: none yet, so setup's defaults (${config.app.bundleId}, EAS profile ${config.app.easProfile}, ${config.device.name}); `
+ "expo-explore setup writes one you can change");
return config;
}
export async function runLocalReview(options: LocalReviewOptions): Promise<LocalReviewResult> {
const environment = { ...(options.environment ?? process.env) };
const progress = options.progress ?? silentProgress;
@@ -349,14 +306,14 @@ export async function runLocalReview(options: LocalReviewOptions): Promise<Local
// The commits.
const headRef = options.head ?? "HEAD";
let head: LocalReviewResult["head"];
const source = await reviewHeadSource(options, project);
if (source === "require-commit") progress("head: HEAD; eas.json sets cli.requireCommit, so uncommitted changes are left out as eas build leaves them out (--uncommitted includes them)");
if (source === "working-tree") {
const snapshot = await snapshotWorkingTree(root, { untracked: true, work });
if (options.uncommitted) {
if (options.head && options.head !== "HEAD") throw new CiError({ code: "LOCAL_REVIEW_UNCOMMITTED_HEAD", stage: "preflight",
message: "--uncommitted reviews the working tree, which is on top of HEAD.", nextAction: "Leave out --head, or leave out --uncommitted." });
const snapshot = await snapshotWorkingTree(root, { untracked: options.untracked, work });
head = snapshot ? { ref: "uncommitted changes", sha: snapshot.sha, uncommitted: snapshot.changed } : { ref: "HEAD", sha: resolveCommit(root, "HEAD", "head") };
if (snapshot) progress(`head: HEAD with your uncommitted changes to ${snapshot.changed.length} file${snapshot.changed.length === 1 ? "" : "s"}, as eas build would upload them`
+ (snapshot.untracked.length ? ` (untracked, kept in .git/objects until git gc: ${snapshot.untracked.join(", ")})` : "") + "; --committed leaves them out");
else progress("head: HEAD (no uncommitted changes)");
if (snapshot) progress(`head: your uncommitted changes to ${snapshot.changed.length} file${snapshot.changed.length === 1 ? "" : "s"}`
+ (snapshot.untracked.length ? ` (untracked, uploaded with the build and kept in .git/objects until git gc: ${snapshot.untracked.join(", ")})` : ""));
else progress("head: no uncommitted changes, reviewing HEAD");
} else {
const sha = resolveCommit(root, headRef, "head");
head = { ref: reportRef(root, headRef, sha), sha };
@@ -364,7 +321,7 @@ export async function runLocalReview(options: LocalReviewOptions): Promise<Local
const baseSha = options.base ? resolveCommit(root, options.base, "base") : undefined;
const base = options.base && baseSha ? { ref: reportRef(root, options.base, baseSha), sha: baseSha } : defaultBase(root, head.sha);
if (base.sha === head.sha) throw new CiError({ code: "COMPARE_SAME_COMMIT", stage: "preflight", message: `${base.ref} and ${head.ref} are the same commit (${head.sha.slice(0, 8)}).`,
nextAction: "Change something to review it, or pass --base with an earlier commit." });
nextAction: "Pass --base with an earlier commit, or --uncommitted to review your uncommitted changes." });
progress(`comparing ${head.ref} (${head.sha.slice(0, 8)}) with ${base.ref} (${base.sha.slice(0, 8)})`);
// The checkouts, and the config at head.
@@ -376,8 +333,7 @@ export async function runLocalReview(options: LocalReviewOptions): Promise<Local
}
const projects = { base: join(checkouts.base, appDirectory), head: join(checkouts.head, appDirectory) };
const configPath = options.configPath ?? DEFAULT_EXPLORE_CONFIG_PATH;
const rawConfig = await localReviewConfig({ project, head: projects.head, configPath, explicit: options.configPath !== undefined,
platform: options.platform, progress });
const rawConfig = await readExploreConfig(projects.head, configPath);
const platforms = options.platform ? [options.platform] : configPlatforms(rawConfig);
const repository = repositoryName(root, rawConfig);
+2 -5
View File
@@ -26,12 +26,9 @@ const aliases: Record<string, string> = {
"config platforms": "config:platforms",
};
/** One-word names for commands people type: `capture` is the local review, `capture:review` without its CI flags. */
const shortNames: Record<string, string> = { capture: "capture:review" };
const first = argv[0] ?? "help";
const pair = `${first} ${argv[1] ?? ""}`.trim();
export const command = aliases[pair] ?? shortNames[first] ?? first;
export const command = aliases[pair] ?? first;
export const resultContract = ["source:verify", "capture:review", "capture:baseline", "ci:report", "ci:publish", "ci:failure", "ci:deploy", "ci:pr", "ci:find-baseline", "ci:compare-refs", "ci:after-capture", "config:platforms", "explore:binary", "explore:session", "report:upload", "reports"].includes(command)
? "explore.result" : QUERY_CONTRACT;
const commandArgCount = aliases[pair] ? 2 : 1;
@@ -84,7 +81,7 @@ const flagKinds: Record<string, Record<string, "value" | "boolean">> = {
export: { output: "value" },
"export:web": {catalog:"value",output:"value"},
"capture:review": { "base-project":"value", "head-project":"value", "pull-request":"value", compare:"value", output:"value", config:"value", platform:"value", scope:"value", "expires-in":"value",
base:"value", head:"value", project:"value", committed:"boolean", uncommitted:"boolean", "include-untracked":"boolean", upload:"boolean", "no-open":"boolean", "no-cache":"boolean", port:"value" },
base:"value", head:"value", project:"value", uncommitted:"boolean", "include-untracked":"boolean", upload:"boolean", "no-open":"boolean", "no-cache":"boolean", port:"value" },
+2 -3
View File
@@ -221,12 +221,11 @@ export async function captureBaseline(): Promise<void> {
output({ ok: true, ...await runBaselineCi({ ...(platform ? { platform } : {}), project, sha: required("sha"), output: required("output"), config, progress: stderrProgress() }) });
}
/** `capture` (or `capture:review`) `[--base REF] [--head REF | --committed]`: a local review, opened in the Viewer or hosted with --upload. */
/** `capture:review [--base REF] [--head REF | --uncommitted]`: a local review, opened in the Viewer or hosted with --upload. */
async function localReview(): Promise<void> {
const platform = platformFlag();
const result = await runLocalReview({ project: flag("project") ?? process.cwd(), base: flag("base"), head: flag("head"),
// --include-untracked is accepted from before untracked files were included by default.
committed: has("committed"), uncommitted: has("uncommitted"), ...(platform ? { platform } : {}),
uncommitted: has("uncommitted"), untracked: has("include-untracked"), ...(platform ? { platform } : {}),
scope: flag("scope"), expiresIn: flag("expires-in"), cache: !has("no-cache"), configPath: flag("config"), progress: stderrProgress() });
if (has("output")) {
for (const report of result.reports) {
+3 -6
View File
@@ -17,14 +17,11 @@ const GET_STARTED = `Get started (run these in the Expo app's directory):
(--offline skips EAS and GitHub; --check-model sends one small request with the local provider key)
doctor --capture [--project DIRECTORY] [--output DIRECTORY] [--platform ios|android] [--yes]
(captures the committed HEAD like the baseline workflow, with your eas login, and reports each route)
capture [--base REF] [--head REF | --committed] [--platform ios|android] [--scope all|changes]
capture:review [--base REF] [--head REF | --uncommitted [--include-untracked]] [--platform ios|android] [--scope all|changes]
[--upload [--expires-in 7d|30d|never]] [--no-open] [--no-cache] [--output DIRECTORY] [--project DIRECTORY]
(on this machine: checks out both commits in temporary worktrees, captures them with your eas login and your
local claude or codex login, and opens the report; the head is HEAD with your uncommitted changes, as eas build
uploads them (--committed, or cli.requireCommit in eas.json, leaves them out); the base defaults to where HEAD
left the default branch;
without .expo-explore/config.yaml it uses the defaults setup would write;
it runs both commits' code as you, so review only commits you would run; capture:review is the same command)
local claude or codex login, and opens the report; the base defaults to where HEAD left the default branch;
it runs both commits' code as you, so review only commits you would run)
view [--catalog FILE] [--port N] [--no-open]
(opens a report in the Viewer)
reports [list | open ID | add REPORT... | upload ID | rm ID | prune] [--all] [--json]
+1 -1
View File
@@ -176,7 +176,7 @@ async function uploadSavedRun(run: SavedRun): Promise<void> {
}
function listLines(runs: SavedRun[], now = Date.now()): string[] {
if (!runs.length) return ["No saved runs yet. expo-explore capture reviews your branch on this machine, and its report is kept here."];
if (!runs.length) return ["No saved runs yet. expo-explore capture:review reviews your branch on this machine, and its report is kept here."];
const idWidth = Math.max(...runs.map(run => run.id.length));
return [...runs.map(run => `${run.id.padEnd(idWidth)} ${kindLabel(run).padEnd(9)}${runTitle(run)} (${run.platforms.join(", ")}, ${friendlyTime(run.createdAt, now)})`),
"", "Open one with: expo-explore reports open <id>"];
+1 -1
View File
@@ -129,7 +129,7 @@ export function renderPicker(state: PickerState, options: { width: number; heigh
if (!runs.length) {
const empty = state.runs.length
? [` ${paint.dim(state.filter ? `Nothing matches "${state.filter}".` : `No saved runs of ${state.repository}. Press tab for every repository.`)}`]
: [` ${paint.text("No saved runs yet.")}`, ` ${paint.dim("expo-explore capture reviews your branch on this machine, and its report is kept here.")}`];
: [` ${paint.text("No saved runs yet.")}`, ` ${paint.dim("expo-explore capture:review reviews your branch on this machine, and its report is kept here.")}`];
return [...header, ...empty, "", ...footer].map(line => fit(line, width));
}
const selected = runs[Math.min(state.selected, runs.length - 1)]!;
+2 -15
View File
@@ -4,7 +4,7 @@ import { dirname, join, resolve } from "node:path";
import { createInterface } from "node:readline/promises";
import { fileURLToPath } from "node:url";
import { stringify } from "yaml";
import { DEFAULT_EXPLORE_CONFIG_PATH, readExploreConfig, validateExploreConfig, type ExploreConfig, type ExplorePlatform } from "./explore-config.js";
import { DEFAULT_EXPLORE_CONFIG_PATH, readExploreConfig, validateExploreConfig, type ExploreConfig } from "./explore-config.js";
import { explorationSecretNames } from "./exploration-inputs.js";
import type { RouteEntryReport } from "../ci/route-entry.js";
import type { CiInstallResult } from "../ci/workflow-install.js";
@@ -60,8 +60,6 @@ type SetupOptions = {
appState?: string | undefined;
workflows?: boolean | undefined;
nonInteractive?: boolean;
/** Return the config without writing anything. */
dryRun?: boolean;
check?: boolean;
};
type Interaction = {
@@ -236,14 +234,6 @@ export type SetupResult = {
nextSteps?: string[];
};
/**
* The config `setup --non-interactive` would write, without writing it: what a local review runs with in an app that
* has no config yet. Throws setup's errors when the app cannot be built for capture.
*/
export async function defaultExploreConfig(project: string, platform?: ExplorePlatform): Promise<ExploreConfig> {
return (await runExploreSetup({ project, platform, nonInteractive: true, dryRun: true })).config;
}
/**
* The guided setup. It writes what it can derive (app identity, mode, route parameters it was given,
* an agent-instructions draft, CI files) and hands the app-specific flows to the user's coding agent.
@@ -300,9 +290,7 @@ export async function runExploreSetup(options: SetupOptions = {}, interaction?:
}
const schemes = Array.isArray(app.scheme) ? app.scheme.filter((value): value is string => typeof value === "string") : undefined;
const scheme = await choose("URL scheme (optional)", options.scheme, schemes?.[0] ?? string(app.scheme), schemes);
const profile = await choose(platform === "android" ? "EAS emulator (APK) build profile" : "EAS simulator build profile", options.profile,
// With several, the one named explore, the name the README and the explore-setup skill give it.
profiles.length === 1 ? profiles[0]! : profiles.includes("explore") ? "explore" : "", profiles);
const profile = await choose(platform === "android" ? "EAS emulator (APK) build profile" : "EAS simulator build profile", options.profile, profiles.length === 1 ? profiles[0]! : "", profiles);
if (!profiles.includes(profile)) throw new Error(`Choose ${platform === "android" ? "an Android APK" : "a simulator"} profile from eas.json with --profile: ${profiles.join(", ")}.`);
const inferredProvider = dependencies["expo-router"] ? "expo-router" : dependencies["@react-navigation/native"] ? "react-navigation" : "auto";
const provider = await choose("Navigation provider", options.navigation, inferredProvider, ["auto", "expo-router", "react-navigation"]);
@@ -402,7 +390,6 @@ export async function runExploreSetup(options: SetupOptions = {}, interaction?:
const answer = await ui!.ask("Write this config? (yes/no)", "yes");
if (!/^(y|yes)$/i.test(answer.trim())) throw new Error("Setup canceled; no config was written.");
}
if (options.dryRun) return { path, config, created: false };
await mkdir(parent, { recursive: true });
await writeFile(path, yaml, { flag: "wx" });
if (instructions) await writeFile(instructionsPath, instructions, { flag: "wx" });
-13
View File
@@ -122,19 +122,6 @@ test("version prints the package version", () => {
}
});
test("capture is the local review, capture:review by a shorter name", async (t) => {
const outside = await mkdtemp(join(tmpdir(), "explore-capture-"));
t.after(() => rm(outside, { recursive: true, force: true }));
const failures = ["capture", "capture:review"].map(command => [
runFailure(outside, [command, "--bogus", "--json"]),
runFailure(outside, [command, "--committed", "--json"]),
]);
assert.deepEqual(failures[0], failures[1], "the same flags, errors and result contract");
assert.equal(failures[0][0].command, "capture:review");
assert.equal(failures[0][0].diagnostic.code, "CLI_ARGUMENT_INVALID");
assert.equal(failures[0][1].diagnostic.code, "LOCAL_REVIEW_GIT_FAILED", "--committed is a known flag; outside a repository the review stops");
});
test("removed map-writing commands fail as unknown commands", () => {
for (const command of ["init", "screen:add", "attempt:commit", "frontier:claim", "gap:add", "finish"]) {
const result = spawnSync(process.execPath, [cli, command], { cwd: root, encoding: "utf8" });
+1 -51
View File
@@ -5,7 +5,7 @@ import { spawnSync } from 'node:child_process';
import { lstat, mkdtemp, readFile, realpath, rm, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { appEnvironment, captureCacheDirectory, defaultBase, installDependencies, keepCapture, localInstallCommand, localReviewConfig, reportRef, reviewHeadSource, runLocalReview, snapshotWorkingTree } from '../../dist/ci/local-review.js';
import { appEnvironment, captureCacheDirectory, defaultBase, installDependencies, keepCapture, localInstallCommand, reportRef, runLocalReview, snapshotWorkingTree } from '../../dist/ci/local-review.js';
import { mkdir, readdir } from 'node:fs/promises';
import { startLocalReportServer } from '../../dist/report/local-report-server.js';
import { fixture, git } from '../helpers/public-ci-fixture.mjs';
@@ -56,56 +56,6 @@ test('the working tree becomes a commit on HEAD without touching the index, file
assert.deepEqual({ status: git(root, 'status', '--porcelain'), index: git(root, 'diff', '--cached', '--name-only'), refs: git(root, 'for-each-ref'), head: git(root, 'rev-parse', 'HEAD') }, before);
});
test('the head is the working tree, as eas build uploads it, unless --committed, --head, or eas.json requireCommit says otherwise', async t => {
const project = await scratch(t, 'explore-local-head-');
assert.equal(await reviewHeadSource({}, project), 'working-tree', 'no eas.json');
await writeFile(join(project, 'eas.json'), JSON.stringify({ cli: { version: '>= 16' }, build: {} }));
assert.equal(await reviewHeadSource({}, project), 'working-tree');
assert.equal(await reviewHeadSource({ committed: true }, project), 'commit');
assert.equal(await reviewHeadSource({ head: 'HEAD' }, project), 'working-tree', '--head HEAD is the default head');
assert.equal(await reviewHeadSource({ head: 'v1.0.0' }, project), 'commit');
await writeFile(join(project, 'eas.json'), JSON.stringify({ cli: { requireCommit: true } }));
assert.equal(await reviewHeadSource({}, project), 'require-commit', 'eas build refuses uncommitted changes here, so the review leaves them out');
assert.equal(await reviewHeadSource({ uncommitted: true }, project), 'working-tree', '--uncommitted includes them anyway');
await writeFile(join(project, 'eas.json'), '{ not json');
assert.equal(await reviewHeadSource({}, project), 'working-tree');
for (const conflict of [{ uncommitted: true, head: 'v1.0.0' }, { uncommitted: true, committed: true }]) {
await assert.rejects(reviewHeadSource(conflict, project), { code: 'LOCAL_REVIEW_UNCOMMITTED_HEAD' });
}
});
test('a review uses the head commit\'s config, else an uncommitted one, else the defaults setup would write', async t => {
const project = await scratch(t, 'explore-local-app-');
const head = await scratch(t, 'explore-local-head-');
const json = (path, value) => writeFile(join(project, path), JSON.stringify(value));
await json('package.json', { dependencies: { expo: '*', 'expo-router': '*' } });
await json('app.json', { expo: { name: 'Test app', scheme: 'test-app', ios: { bundleIdentifier: 'com.example.test' } } });
await json('eas.json', { build: { explore: { ios: { simulator: true } } } });
const configPath = '.expo-explore/config.yaml';
const resolve = (options = {}) => localReviewConfig({ project, head, configPath, explicit: false, ...options });
const messages = [];
const defaults = await resolve({ progress: message => messages.push(message) });
assert.equal(defaults.mode, 'deterministic');
assert.deepEqual([defaults.app.platform, defaults.app.bundleId, defaults.app.easProfile, defaults.app.scheme], ['ios', 'com.example.test', 'explore', 'test-app']);
assert.equal(defaults.navigation.provider, 'expo-router');
assert.equal(defaults.exploration.scope, 'changes');
assert.match(messages.join('\n'), /setup's defaults \(com\.example\.test, EAS profile explore, iPhone 17\)/);
await assert.rejects(lstat(join(project, '.expo-explore')), { code: 'ENOENT' }, 'the defaults are not written');
const config = name => `mode: deterministic\napp:\n name: ${name}\n platform: ios\n bundleId: com.example.test\n easProfile: explore\n`
+ 'navigation:\n provider: expo-router\ndevice:\n name: iPhone 17\nexploration:\n scope: changes\n';
await mkdir(join(project, '.expo-explore')); await writeFile(join(project, configPath), config('Checkout'));
assert.equal((await resolve()).app.name, 'Checkout', 'setup ran but its config is not committed yet');
await mkdir(join(head, '.expo-explore')); await writeFile(join(head, configPath), config('Head'));
assert.equal((await resolve()).app.name, 'Head', 'the commit under review wins');
await assert.rejects(resolve({ configPath: 'other.yaml', explicit: true }), { code: 'CONFIG_READ_FAILED' }, 'a --config path must be in the commit');
await rm(join(project, '.expo-explore'), { recursive: true }); await rm(join(head, '.expo-explore'), { recursive: true });
await rm(join(project, 'eas.json'));
await assert.rejects(resolve(), error => error.code === 'LOCAL_REVIEW_CONFIG_DEFAULTS' && /no \.expo-explore\/config\.yaml.*No eas\.json found/s.test(error.message));
});
test('with no base, a branch is compared with where it left the default branch', async t => {
const root = await repository(t);
const fork = git(root, 'rev-parse', 'HEAD');
+2 -7
View File
@@ -78,16 +78,11 @@ test("EAS profile inheritance is respected and device builds cannot be selected"
explore: { extends: "base", ios: { buildConfiguration: "Release" } },
production: { extends: "base", ios: { simulator: false } },
} });
await assert.rejects(runExploreSetup({ project, ...options }), /--profile/);
await assert.rejects(runExploreSetup({ project, ...options, profile: "production" }), /--profile/);
await assert.rejects(stat(path), { code: "ENOENT" });
// Of several simulator profiles, the one named explore is the default; without one, setup asks for --profile.
await runExploreSetup({ project, ...options });
await runExploreSetup({ project, ...options, profile: "explore" });
assert.equal((await readExploreConfig(project)).app.easProfile, "explore");
await rm(path);
await json("eas.json", { build: { base: { ios: { simulator: true } }, sim: { extends: "base" } } });
await assert.rejects(runExploreSetup({ project, ...options }), /--profile: base, sim/);
await runExploreSetup({ project, ...options, profile: "sim" });
assert.equal((await readExploreConfig(project)).app.easProfile, "sim");
});
test("dynamic config uses the app's Expo resolver instead of stale app.json", async (t) => {
+1 -1
View File
@@ -54,7 +54,7 @@ export function handoffPrompt(input: HandoffInput, view?: HandoffView): string {
input.pageUrl,
"",
`Fetch the link first${local ? " (from this machine, with curl if your fetch tool refuses local addresses)" : ""}. It explains the report's JSON API. Go through the changed screens, compare the before and after screenshots${appearances}, and tell me which changes look intended and which look like regressions. For each regression, name the source file to fix.`,
...(local ? ["", "The link is served by `expo-explore capture` on this machine and stops working when it exits."] : []),
...(local ? ["", "The link is served by `expo-explore capture:review` on this machine and stops working when it exits."] : []),
];
if (view) {
const where = [view.screen, view.view, view.platform, view.appearance].filter(Boolean).join(" · ");