@rootnative/loupe 0.0.0-alpha.1 → 0.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to `@rootnative/loupe` are in this file. The format follows
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.0.0-alpha.2] - 2026-11-25
8
+
9
+ The Expo helpers: loupe warms, opens, and restarts your app in Expo Go, and switches it to RTL and back.
10
+
11
+ ### Added
12
+
13
+ - **`expo-warm`**: it asks Metro (`npx expo start`) for the manifest of your app and its launch bundle, as Expo Go does on its first open. Then the first open doesn't wait for a cold bundle. It gives the SDK version and the folder of the app, and the time, the size, and the SHA-256 of the bundle: after an edit, the same hash means that Metro didn't see the edit. It asks Metro on 127.0.0.1 only.
14
+ - **`expo-open`**: it opens your app in Expo Go at a route, through `adb reverse` of the port of Metro. It warms the bundle first, closes Expo Go's onboarding sheet and developer menu, opens the link again when Expo Go loses it, and waits until the app shows: on the route when your app has the probe. With no probe, it waits until the screen has text, a label or a touch and keeps still, then reads it once more, so a loading screen or a sheet that comes a moment later isn't taken for your app. It warns when Expo Go isn't for the SDK of your app, and with no Expo Go it says how to install it. When Expo Go's screen never keeps still for uiautomator (an animation that never stops, or a long one), it gives `not_idle` with what to do.
15
+ - **`expo-reload`**: it stops Expo Go and opens your app again, so its JavaScript starts again in a new process. It opens the route that the probe shows before the stop, or the route that you give, else the root. It warms the bundle first, so it stops nothing when Metro doesn't run. After the stop, it waits until the process of Expo Go is gone, then opens the link. It warns when Android didn't start Expo Go cold.
16
+ - **`expo-rtl`**: `expo-rtl on` writes `supportsRTL` and `forcesRTL` in the `extra` of your app.json, and opens your app again in RTL, as `expo-reload` does. It keeps app.json as it was in `.expo/loupe-rtl.json`, and `expo-rtl off` puts it back byte for byte. It finds app.json through the manifest of Metro, waits until the manifest has the change, and waits until the probe shows the direction. When the manifest doesn't get the change (an `app.config.js` that replaces `extra`), it puts app.json back and says why. A project with no app.json gets `unsupported`, with the two lines to add.
17
+ - **`direction` and `reopens`** in the output of `expo-open`, `expo-reload` and `expo-rtl`: the layout direction that the probe shows, and what loupe saw before each time that it opened the link again.
18
+ - **`sweep --reload-every <n>`**: it stops the app before each n-th link that the sweep opens, over all the variants, and the link starts it again, so stacked screens don't slow the app down. In Expo Go, loupe then waits until the app shows the route of the link, as `expo-open` does. It needs `--app`. Each screen in the report has `reloaded`.
19
+ - **`sweep --direction ltr,rtl`**: in Expo Go, it checks each screen in each layout direction. loupe sets each direction once, before its variants, in your app.json, as `expo-rtl` does, opens the app again, and waits until the probe shows that direction. At the end it puts app.json back byte for byte and opens the app again in its direction. Each variant has `direction`, and its name ends with it: `portrait-light-rtl`. `--port` gives the port of Metro.
20
+ - **The error code `no_server`**: nothing answers on the port of Metro, or the server there isn't Metro.
21
+
22
+ ### Fixed
23
+
24
+ - `scroll-to` and `sweep --scroll` leave out Expo Go's own overlay when they compare what a scroll view shows. A fresh Expo Go shows a "Tools" label for a few seconds. loupe took the change of that label for a change of the list: `sweep --scroll` warned that the list didn't show its top again, and a scroll that didn't move could count as one.
25
+ - `dismiss` sends Back or Escape only when the input focus is on the layer that it closes. On a busy device, Android moves the input focus a moment after the window focus. A Back right after the notification shade closed could reach the shade, and the share sheet under it stayed open. When the input focus doesn't arrive within the limit, `dismiss` gives `timeout` and sends no key.
26
+
7
27
  ## [0.0.0-alpha.1] - 2026-11-24
8
28
 
9
29
  loupe drives an Android emulator or device, measures each screen of your app in dp, and gives your agent "pass" or "fail" with the numbers. It works on Android 11 (API level 30) and later.
@@ -20,5 +40,6 @@ loupe drives an Android emulator or device, measures each screen of your app in
20
40
  - **The device:** `devices`, `open-url`, `rotate`, `theme`, `background`, `foreground`, and `dismiss`. `dismiss` closes a system sheet, a dialog, the keyboard, or an overlay of your app.
21
41
  - **The probe:** when your app renders `<LoupeProbe />` from `@rootnative/loupe-probe`, `insets` and the rules use the app's own safe area.
22
42
 
23
- [unreleased]: https://github.com/rootnative/loupe/compare/loupe@0.0.0-alpha.1...HEAD
43
+ [unreleased]: https://github.com/rootnative/loupe/compare/loupe@0.0.0-alpha.2...HEAD
44
+ [0.0.0-alpha.2]: https://github.com/rootnative/loupe/releases/tag/loupe@0.0.0-alpha.2
24
45
  [0.0.0-alpha.1]: https://github.com/rootnative/loupe/releases/tag/loupe@0.0.0-alpha.1
package/README.md CHANGED
@@ -106,7 +106,11 @@ npx @rootnative/loupe sweep \
106
106
  A sweep writes `loupe-sweep/report.json`, a screenshot of each screen, and a
107
107
  contact sheet of each variant. A red frame on the contact sheet marks a
108
108
  screen that failed. At the end, loupe puts the orientation and the theme
109
- back.
109
+ back. For a long list, `--reload-every 10` stops the app before each 10th
110
+ link, so stacked screens don't slow it down. In Expo Go,
111
+ `--direction ltr,rtl` checks each screen in both layout directions: loupe
112
+ sets each one in `app.json`, as `expo-rtl` does, and puts the file back at
113
+ the end.
110
114
 
111
115
  ## The output
112
116
 
@@ -159,6 +163,10 @@ Each finding gives the element and its numbers in dp.
159
163
  | `dismiss` | Close the top layer over the app: the keyboard, a dialog, a menu or a sheet of the app, a system sheet, or the notification shade. |
160
164
  | `background` | Send the app in front to the background. With `--for`, bring it back after that time. |
161
165
  | `foreground` | Bring an app back to the front, as a person does from Recents. |
166
+ | `expo-open` | Open the app in Expo Go at a route, close Expo Go's onboarding sheet and developer menu, and wait until the app shows. |
167
+ | `expo-reload` | Stop Expo Go and open the app again, so its JavaScript starts again. Keep the route when the app has the probe. |
168
+ | `expo-rtl` | Turn RTL on or off in the app.json of the app, and open the app again in that direction. `off` puts app.json back as it was. |
169
+ | `expo-warm` | Ask Metro (`npx expo start`) for the app and its bundle, so that the first open in Expo Go is fast. Give the SHA-256 of the bundle. |
162
170
  | `version` | Print the loupe version and the host it runs on. |
163
171
 
164
172
  ## The probe
@@ -171,7 +179,12 @@ loupe takes the safe area from Android.
171
179
 
172
180
  - On a real phone, give `--app`. loupe then reads the screen only while that
173
181
  app is in front, so it never shows another app to your agent.
174
- - loupe makes no network call. It talks to the device through adb only.
182
+ - loupe makes no call over the network. It talks to the device through adb,
183
+ and the Expo commands talk to Metro on this machine (127.0.0.1) only.
184
+ - `expo-rtl` and `sweep --direction` are the only commands that write in
185
+ your project: they edit `app.json`, keep the file as it was in
186
+ `.expo/loupe-rtl.json`, and put it back (`expo-rtl off`, or the end of
187
+ the sweep).
175
188
 
176
189
  ## License
177
190
 
package/dist/bin.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  registry,
7
7
  runCommand,
8
8
  version
9
- } from "./chunk-JDX6L5K6.js";
9
+ } from "./chunk-HWVQXYQ3.js";
10
10
 
11
11
  // src/cli/flags.ts
12
12
  import { parseArgs } from "util";
@@ -230,7 +230,7 @@ async function mcp(args, io, registry2, context) {
230
230
  io.err('Run "loupe mcp --help" for its use.');
231
231
  return EXIT_USAGE;
232
232
  }
233
- const { serveMcp } = await import("./server-BTS4TOGF.js");
233
+ const { serveMcp } = await import("./server-567FSCAH.js");
234
234
  await serveMcp({
235
235
  registry: registry2,
236
236
  context,