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

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/dist/index.d.ts CHANGED
@@ -37,6 +37,13 @@ interface ProgressUpdate {
37
37
  interface CommandContext {
38
38
  exec: Exec;
39
39
  env: Readonly<Record<string, string | undefined>>;
40
+ /**
41
+ * HTTP to a server on this machine, such as Metro. `createContext` gives
42
+ * `localFetch`, which refuses every other host.
43
+ */
44
+ fetch: typeof fetch;
45
+ /** The system of this machine, as `process.platform` gives it. */
46
+ hostPlatform: NodeJS.Platform;
40
47
  /**
41
48
  * Aborts when the caller cancels the call: Ctrl-C in the CLI, or a
42
49
  * cancel from the MCP client. A long command stops at its next safe
@@ -46,7 +53,10 @@ interface CommandContext {
46
53
  /** Takes the progress of a long command, for the caller to show. */
47
54
  progress?: (update: ProgressUpdate) => void;
48
55
  }
49
- /** The real context: child processes, and the environment of this process. */
56
+ /**
57
+ * The real context: child processes, the environment of this process, and
58
+ * HTTP to this machine.
59
+ */
50
60
  declare function createContext(): CommandContext;
51
61
 
52
62
  /**
@@ -94,14 +104,18 @@ declare function createRegistry(commands: readonly Command[]): Registry;
94
104
 
95
105
  declare const deviceSchema: z.ZodObject<{
96
106
  platform: z.ZodEnum<{
107
+ ios: "ios";
97
108
  android: "android";
98
109
  }>;
99
110
  kind: z.ZodEnum<{
111
+ simulator: "simulator";
100
112
  emulator: "emulator";
101
113
  device: "device";
102
114
  }>;
103
115
  serial: z.ZodOptional<z.ZodString>;
104
116
  avd: z.ZodOptional<z.ZodString>;
117
+ udid: z.ZodOptional<z.ZodString>;
118
+ name: z.ZodOptional<z.ZodString>;
105
119
  model: z.ZodOptional<z.ZodString>;
106
120
  state: z.ZodEnum<{
107
121
  ready: "ready";
@@ -114,6 +128,7 @@ declare const deviceSchema: z.ZodObject<{
114
128
  }>;
115
129
  detail: z.ZodOptional<z.ZodString>;
116
130
  apiLevel: z.ZodOptional<z.ZodNumber>;
131
+ os: z.ZodOptional<z.ZodString>;
117
132
  }, z.core.$strip>;
118
133
  type Device = z.infer<typeof deviceSchema>;
119
134
  type DeviceState = Device['state'];
@@ -143,7 +158,7 @@ declare const displaySchema: z.ZodObject<{
143
158
  }, z.core.$strip>;
144
159
  type DisplayState = z.infer<typeof displaySchema>;
145
160
 
146
- declare const ERROR_CODES: readonly ["unknown_command", "invalid_input", "invalid_output", "tool_missing", "tool_failed", "timeout", "no_device", "device_ambiguous", "device_unavailable", "unsupported", "orientation_locked", "app_not_in_front", "not_idle", "element_not_found", "element_ambiguous", "no_handler", "cancelled", "internal"];
161
+ declare const ERROR_CODES: readonly ["unknown_command", "invalid_input", "invalid_output", "tool_missing", "tool_failed", "timeout", "no_device", "device_ambiguous", "device_unavailable", "unsupported", "orientation_locked", "app_not_in_front", "not_idle", "element_not_found", "element_ambiguous", "no_handler", "no_server", "cancelled", "internal"];
147
162
  type ErrorCode = (typeof ERROR_CODES)[number];
148
163
  /** An error that a caller can act on by its code. */
149
164
  declare class LoupeError extends Error {
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  toPixels,
19
19
  unitOf,
20
20
  version
21
- } from "./chunk-JDX6L5K6.js";
21
+ } from "./chunk-7ALG5744.js";
22
22
  export {
23
23
  ERROR_CODES,
24
24
  LoupeError,
@@ -0,0 +1,239 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>BuildMachineOSBuild</key>
6
+ <string>23A344011</string>
7
+ <key>CFBundleAllowMixedLocalizations</key>
8
+ <true/>
9
+ <key>CFBundleDevelopmentRegion</key>
10
+ <string>en</string>
11
+ <key>CFBundleExecutable</key>
12
+ <string>LoupeRunner-Runner</string>
13
+ <key>CFBundleIdentifier</key>
14
+ <string>io.github.rootnative.loupe.LoupeRunner.xctrunner</string>
15
+ <key>CFBundleInfoDictionaryVersion</key>
16
+ <string>6.0</string>
17
+ <key>CFBundleName</key>
18
+ <string>LoupeRunner-Runner</string>
19
+ <key>CFBundlePackageType</key>
20
+ <string>APPL</string>
21
+ <key>CFBundleShortVersionString</key>
22
+ <string>1.0</string>
23
+ <key>CFBundleSignature</key>
24
+ <string>????</string>
25
+ <key>CFBundleSupportedPlatforms</key>
26
+ <array>
27
+ <string>iPhoneSimulator</string>
28
+ </array>
29
+ <key>CFBundleVersion</key>
30
+ <string>1</string>
31
+ <key>DTCompiler</key>
32
+ <string>com.apple.compilers.llvm.clang.1_0</string>
33
+ <key>DTPlatformBuild</key>
34
+ <string>22E169</string>
35
+ <key>DTPlatformName</key>
36
+ <string>iphonesimulator</string>
37
+ <key>DTPlatformVersion</key>
38
+ <string>18.4</string>
39
+ <key>DTSDKBuild</key>
40
+ <string>22E169</string>
41
+ <key>DTSDKName</key>
42
+ <string>iphonesimulator18.4.internal</string>
43
+ <key>DTXcode</key>
44
+ <string>1640</string>
45
+ <key>DTXcodeBuild</key>
46
+ <string>16F1t</string>
47
+ <key>LSRequiresIPhoneOS</key>
48
+ <true/>
49
+ <key>MinimumOSVersion</key>
50
+ <string>13.0</string>
51
+ <key>NFCReaderUsageDescription</key>
52
+ <string>Access is necessary for automated testing.</string>
53
+ <key>NSAppTransportSecurity</key>
54
+ <dict>
55
+ <key>NSAllowsArbitraryLoads</key>
56
+ <true/>
57
+ </dict>
58
+ <key>NSAppleMusicUsageDescription</key>
59
+ <string>Access is necessary for automated testing.</string>
60
+ <key>NSBluetoothAlwaysUsageDescription</key>
61
+ <string>Access is necessary for automated testing.</string>
62
+ <key>NSBluetoothPeripheralUsageDescription</key>
63
+ <string>Access is necessary for automated testing.</string>
64
+ <key>NSCalendarsUsageDescription</key>
65
+ <string>Access is necessary for automated testing.</string>
66
+ <key>NSCameraUsageDescription</key>
67
+ <string>Access is necessary for automated testing.</string>
68
+ <key>NSContactsUsageDescription</key>
69
+ <string>Access is necessary for automated testing.</string>
70
+ <key>NSFaceIDUsageDescription</key>
71
+ <string>Access is necessary for automated testing.</string>
72
+ <key>NSHealthClinicalHealthRecordsShareUsageDescription</key>
73
+ <string>Access is necessary for automated testing.</string>
74
+ <key>NSHealthShareUsageDescription</key>
75
+ <string>Access is necessary for automated testing.</string>
76
+ <key>NSHealthUpdateUsageDescription</key>
77
+ <string>Access is necessary for automated testing.</string>
78
+ <key>NSHomeKitUsageDescription</key>
79
+ <string>Access is necessary for automated testing.</string>
80
+ <key>NSLocalNetworkUsageDescription</key>
81
+ <string>Access is necessary for automated testing.</string>
82
+ <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
83
+ <string>Access is necessary for automated testing.</string>
84
+ <key>NSLocationDefaultAccuracyReduced</key>
85
+ <string>Access is necessary for automated testing.</string>
86
+ <key>NSLocationWhenInUseUsageDescription</key>
87
+ <string>Access is necessary for automated testing.</string>
88
+ <key>NSMicrophoneUsageDescription</key>
89
+ <string>Access is necessary for automated testing.</string>
90
+ <key>NSMotionUsageDescription</key>
91
+ <string>Access is necessary for automated testing.</string>
92
+ <key>NSPhotoLibraryUsageDescription</key>
93
+ <string>Access is necessary for automated testing.</string>
94
+ <key>NSRemindersUsageDescription</key>
95
+ <string>Access is necessary for automated testing.</string>
96
+ <key>NSSensorKitPrivacyPolicyURL</key>
97
+ <string>https:\/\/www.apple.com/legal/privacy/en-ww/</string>
98
+ <key>NSSensorKitUsageDescription</key>
99
+ <string>Access is necessary for automated testing.</string>
100
+ <key>NSSensorKitUsageDetail</key>
101
+ <dict>
102
+ <key>SRSensorUsageAmbientLightSensor</key>
103
+ <dict>
104
+ <key>Description</key>
105
+ <string>DESCRIPTION_SRSensorUsageAmbientLightSensor</string>
106
+ </dict>
107
+ <key>SRSensorUsageDeviceUsage</key>
108
+ <dict>
109
+ <key>Description</key>
110
+ <string>DESCRIPTION_SRSensorUsageDeviceUsage</string>
111
+ </dict>
112
+ <key>SRSensorUsageECG</key>
113
+ <dict>
114
+ <key>Description</key>
115
+ <string>DESCRIPTION_SRSensorUsageECG</string>
116
+ </dict>
117
+ <key>SRSensorUsageElevation</key>
118
+ <dict>
119
+ <key>Description</key>
120
+ <string>DESCRIPTION_SRSensorUsageElevation</string>
121
+ </dict>
122
+ <key>SRSensorUsageFacialMetrics</key>
123
+ <dict>
124
+ <key>Description</key>
125
+ <string>DESCRIPTION_SRSensorUsageFacialMetrics</string>
126
+ </dict>
127
+ <key>SRSensorUsageFallStatistics</key>
128
+ <dict>
129
+ <key>Description</key>
130
+ <string>DESCRIPTION_SRSensorUsageFallStatistics</string>
131
+ </dict>
132
+ <key>SRSensorUsageHeartRate</key>
133
+ <dict>
134
+ <key>Description</key>
135
+ <string>DESCRIPTION_SRSensorUsageHeartRate</string>
136
+ </dict>
137
+ <key>SRSensorUsageKeyboardMetrics</key>
138
+ <dict>
139
+ <key>Description</key>
140
+ <string>DESCRIPTION_SRSensorUsageKeyboardMetrics</string>
141
+ </dict>
142
+ <key>SRSensorUsageMessageUsage</key>
143
+ <dict>
144
+ <key>Description</key>
145
+ <string>DESCRIPTION_SRSensorUsageMessageUsage</string>
146
+ </dict>
147
+ <key>SRSensorUsageMotion</key>
148
+ <dict>
149
+ <key>Description</key>
150
+ <string>DESCRIPTION_SRSensorUsageMotion</string>
151
+ <key>Required</key>
152
+ <true/>
153
+ </dict>
154
+ <key>SRSensorUsageMotionAlarms</key>
155
+ <dict>
156
+ <key>Description</key>
157
+ <string>DESCRIPTION_SRSensorUsageMotionAlarms</string>
158
+ </dict>
159
+ <key>SRSensorUsageOdometer</key>
160
+ <dict>
161
+ <key>Description</key>
162
+ <string>DESCRIPTION_SRSensorUsageOdometer</string>
163
+ </dict>
164
+ <key>SRSensorUsageOnWristDetailedState</key>
165
+ <dict>
166
+ <key>Description</key>
167
+ <string>DESCRIPTION_SRSensorIdentifierOnWristDetailedState</string>
168
+ </dict>
169
+ <key>SRSensorUsagePedometer</key>
170
+ <dict>
171
+ <key>Description</key>
172
+ <string>DESCRIPTION_SRSensorUsagePedometer</string>
173
+ </dict>
174
+ <key>SRSensorUsagePhoneUsage</key>
175
+ <dict>
176
+ <key>Description</key>
177
+ <string>DESCRIPTION_SRSensorUsagePhoneUsage</string>
178
+ </dict>
179
+ <key>SRSensorUsageSpeechMetrics</key>
180
+ <dict>
181
+ <key>Description</key>
182
+ <string>DESCRIPTION_SRSensorUsageSpeechMetrics</string>
183
+ </dict>
184
+ <key>SRSensorUsageStrideCalibration</key>
185
+ <dict>
186
+ <key>Description</key>
187
+ <string>DESCRIPTION_SRSensorUsageStrideCalibration</string>
188
+ </dict>
189
+ <key>SRSensorUsageVisits</key>
190
+ <dict>
191
+ <key>Description</key>
192
+ <string>DESCRIPTION_SRSensorUsageVisits</string>
193
+ </dict>
194
+ <key>SRSensorUsageWristDetection</key>
195
+ <dict>
196
+ <key>Description</key>
197
+ <string>DESCRIPTION_SRSensorUsageWristDetection</string>
198
+ </dict>
199
+ </dict>
200
+ <key>NSSiriUsageDescription</key>
201
+ <string>Access is necessary for automated testing.</string>
202
+ <key>NSSpeechRecognitionUsageDescription</key>
203
+ <string>Access is necessary for automated testing.</string>
204
+ <key>NSUserTrackingUsageDescription</key>
205
+ <string>Access is necessary for automated testing.</string>
206
+ <key>NSVideoSubscriberAccountUsageDescription</key>
207
+ <string>Access is necessary for automated testing.</string>
208
+ <key>SBIsLaunchableDuringSetup</key>
209
+ <true/>
210
+ <key>UIBackgroundModes</key>
211
+ <array>
212
+ <string>continuous</string>
213
+ </array>
214
+ <key>UIDeviceFamily</key>
215
+ <array>
216
+ <integer>1</integer>
217
+ <integer>2</integer>
218
+ </array>
219
+ <key>UIRequiredDeviceCapabilities</key>
220
+ <array>
221
+ <string>armv7</string>
222
+ </array>
223
+ <key>UIRequiresFullScreen</key>
224
+ <true/>
225
+ <key>UISupportedInterfaceOrientations</key>
226
+ <array>
227
+ <string>UIInterfaceOrientationPortrait</string>
228
+ <string>UIInterfaceOrientationLandscapeLeft</string>
229
+ <string>UIInterfaceOrientationLandscapeRight</string>
230
+ </array>
231
+ <key>UISupportedInterfaceOrientations~ipad</key>
232
+ <array>
233
+ <string>UIInterfaceOrientationPortrait</string>
234
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
235
+ <string>UIInterfaceOrientationLandscapeLeft</string>
236
+ <string>UIInterfaceOrientationLandscapeRight</string>
237
+ </array>
238
+ </dict>
239
+ </plist>
@@ -0,0 +1,119 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>LoupeRunner</key>
6
+ <dict>
7
+ <key>BlueprintName</key>
8
+ <string>LoupeRunner</string>
9
+ <key>BlueprintProviderName</key>
10
+ <string>LoupeRunner</string>
11
+ <key>BlueprintProviderRelativePath</key>
12
+ <string>LoupeRunner.xcodeproj</string>
13
+ <key>BundleIdentifiersForCrashReportEmphasis</key>
14
+ <array>
15
+ <string>io.github.rootnative.loupe.LoupeHost</string>
16
+ <string>io.github.rootnative.loupe.LoupeRunner</string>
17
+ </array>
18
+ <key>CommandLineArguments</key>
19
+ <array/>
20
+ <key>DefaultTestExecutionTimeAllowance</key>
21
+ <integer>600</integer>
22
+ <key>DependentProductPaths</key>
23
+ <array>
24
+ <string>__TESTROOT__/Debug-iphonesimulator/LoupeHost.app</string>
25
+ <string>__TESTROOT__/Debug-iphonesimulator/LoupeRunner-Runner.app</string>
26
+ <string>__TESTROOT__/Debug-iphonesimulator/LoupeRunner-Runner.app/PlugIns/LoupeRunner.xctest</string>
27
+ </array>
28
+ <key>DiagnosticCollectionPolicy</key>
29
+ <integer>1</integer>
30
+ <key>EnvironmentVariables</key>
31
+ <dict>
32
+ <key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
33
+ <string>com.apple.AppStore</string>
34
+ <key>OS_ACTIVITY_DT_MODE</key>
35
+ <string>YES</string>
36
+ <key>SQLITE_ENABLE_THREAD_ASSERTIONS</key>
37
+ <string>1</string>
38
+ <key>TERM</key>
39
+ <string>dumb</string>
40
+ </dict>
41
+ <key>IsUITestBundle</key>
42
+ <true/>
43
+ <key>IsXCTRunnerHostedTestBundle</key>
44
+ <true/>
45
+ <key>PreferredScreenCaptureFormat</key>
46
+ <string>screenRecording</string>
47
+ <key>ProductModuleName</key>
48
+ <string>LoupeRunner</string>
49
+ <key>RunOrder</key>
50
+ <integer>0</integer>
51
+ <key>SystemAttachmentLifetime</key>
52
+ <string>deleteOnSuccess</string>
53
+ <key>TestBundlePath</key>
54
+ <string>__TESTHOST__/PlugIns/LoupeRunner.xctest</string>
55
+ <key>TestHostBundleIdentifier</key>
56
+ <string>io.github.rootnative.loupe.LoupeRunner.xctrunner</string>
57
+ <key>TestHostPath</key>
58
+ <string>__TESTROOT__/Debug-iphonesimulator/LoupeRunner-Runner.app</string>
59
+ <key>TestLanguage</key>
60
+ <string></string>
61
+ <key>TestRegion</key>
62
+ <string></string>
63
+ <key>TestTimeoutsEnabled</key>
64
+ <false/>
65
+ <key>TestingEnvironmentVariables</key>
66
+ <dict>
67
+ <key>DYLD_FRAMEWORK_PATH</key>
68
+ <string>__TESTROOT__/Debug-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/Library/Frameworks</string>
69
+ <key>DYLD_LIBRARY_PATH</key>
70
+ <string>__TESTROOT__/Debug-iphonesimulator:__PLATFORMS__/iPhoneSimulator.platform/Developer/usr/lib</string>
71
+ <key>XCODE_SCHEME_NAME</key>
72
+ <string>LoupeRunner</string>
73
+ <key>__XCODE_BUILT_PRODUCTS_DIR_PATHS</key>
74
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
75
+ <key>__XPC_DYLD_FRAMEWORK_PATH</key>
76
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
77
+ <key>__XPC_DYLD_LIBRARY_PATH</key>
78
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
79
+ </dict>
80
+ <key>ToolchainsSettingValue</key>
81
+ <array/>
82
+ <key>UITargetAppCommandLineArguments</key>
83
+ <array/>
84
+ <key>UITargetAppEnvironmentVariables</key>
85
+ <dict>
86
+ <key>APP_DISTRIBUTOR_ID_OVERRIDE</key>
87
+ <string>com.apple.AppStore</string>
88
+ <key>DYLD_FRAMEWORK_PATH</key>
89
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
90
+ <key>DYLD_LIBRARY_PATH</key>
91
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
92
+ <key>XCODE_SCHEME_NAME</key>
93
+ <string>LoupeRunner</string>
94
+ <key>__XCODE_BUILT_PRODUCTS_DIR_PATHS</key>
95
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
96
+ <key>__XPC_DYLD_FRAMEWORK_PATH</key>
97
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
98
+ <key>__XPC_DYLD_LIBRARY_PATH</key>
99
+ <string>__TESTROOT__/Debug-iphonesimulator</string>
100
+ </dict>
101
+ <key>UITargetAppPath</key>
102
+ <string>__TESTROOT__/Debug-iphonesimulator/LoupeHost.app</string>
103
+ <key>UserAttachmentLifetime</key>
104
+ <string>deleteOnSuccess</string>
105
+ </dict>
106
+ <key>__xctestrun_metadata__</key>
107
+ <dict>
108
+ <key>ContainerInfo</key>
109
+ <dict>
110
+ <key>ContainerName</key>
111
+ <string>LoupeRunner</string>
112
+ <key>SchemeName</key>
113
+ <string>LoupeRunner</string>
114
+ </dict>
115
+ <key>FormatVersion</key>
116
+ <integer>1</integer>
117
+ </dict>
118
+ </dict>
119
+ </plist>
@@ -6,7 +6,7 @@ import {
6
6
  round2,
7
7
  runCommand,
8
8
  version
9
- } from "./chunk-JDX6L5K6.js";
9
+ } from "./chunk-7ALG5744.js";
10
10
 
11
11
  // src/mcp/server.ts
12
12
  import { existsSync } from "fs";
@@ -103,7 +103,7 @@ var INSTRUCTIONS = [
103
103
  "loupe checks the layout of a mobile app on an Android emulator or device. Its tools give numbers in dp.",
104
104
  "Ask the user before you start an emulator, and before you open an app or a link on a device.",
105
105
  "On a real phone, give `app` in each call.",
106
- "Put back the orientation and the theme that you change; a sweep does it itself.",
106
+ "Put back what you change: the orientation, the theme, and RTL (`expo-rtl off`). A sweep puts back the orientation and the theme itself.",
107
107
  "Decide pass or fail with `check` or `sweep`, not from a screenshot alone.",
108
108
  "The loupe skill (skills/loupe/SKILL.md in the package) has the workflow, the rules, and what to do for each error code."
109
109
  ].join(" ");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rootnative/loupe",
3
- "version": "0.0.0-alpha.1",
3
+ "version": "0.0.0-alpha.3",
4
4
  "description": "loupe by Root Native: layout checks for iOS and Android, built for AI agents. Drive simulators and emulators, and measure every screen to the point.",
5
5
  "license": "MIT",
6
6
  "author": "Root Native",
@@ -21,19 +21,48 @@ schema, so this skill doesn't repeat them. loupe works on Android 11
21
21
  - On a real phone, give `app` in each call. loupe then reads the screen
22
22
  only while that app is in front, so it never shows you another app.
23
23
  - Don't change a setting that the user didn't ask for. `rotate` and
24
- `theme` change the device. Put back what you changed. `sweep` puts the
25
- orientation and the theme back itself.
24
+ `theme` change the device, and `expo-rtl` changes the app.json of the
25
+ app. Put back what you changed: after `expo-rtl on`, run `expo-rtl off`.
26
+ `sweep` puts the orientation and the theme back itself.
26
27
 
27
28
  ## Before the first check
28
29
 
29
30
  1. Run `devices`. Only a device in the state `ready` takes commands.
30
- 2. When two or more devices are ready, give `device` (the serial or the
31
- AVD name) in each call.
31
+ 2. When two or more devices are ready, give `device` in each call: the
32
+ serial or the AVD name of an Android device. loupe lists the iOS
33
+ simulators, but it doesn't drive one yet: a command on a simulator
34
+ gives `unsupported`.
32
35
  3. Give `app` in each call that reads or touches the screen. For Expo Go,
33
36
  it's `host.exp.exponent`.
34
37
  4. Run one loupe call at a time on a device. Two touches at the same time
35
38
  lose events. The MCP server already runs its calls one after the other.
36
39
 
40
+ ## An app in Expo Go
41
+
42
+ 1. The user runs `npx expo start` in the folder of the app. loupe doesn't
43
+ start Metro. Give `port` when Metro doesn't use 8081.
44
+ 2. Open the app with `expo-open` and a route, for example `/settings`. It
45
+ warms the bundle, closes Expo Go's onboarding sheet and developer menu,
46
+ and waits until the app shows: on the route when the app has the probe,
47
+ else until the screen has text, a label or a touch and keeps still.
48
+ Then give `app` `host.exp.exponent` in each call. An animation that
49
+ never stops, or a long one, hides a screen from loupe: `expo-open`
50
+ then gives `not_idle`. A link to the root can start the animation
51
+ again, so open another route.
52
+ 3. After an edit of the app's code, run `expo-warm`, and compare its
53
+ `sha256` with the one before the edit. The same hash means that Metro
54
+ didn't see the edit. Ask the user to restart Metro with
55
+ `npx expo start --clear`.
56
+ 4. To start the app again from a clean state, run `expo-reload`. It stops
57
+ Expo Go and opens the app again, on the route that the probe shows.
58
+ With no probe, it opens the root: give `route` for another screen.
59
+ Run it also after a Metro restart or a new package: until then, Expo Go
60
+ keeps the old JavaScript.
61
+ 5. To see the app in RTL, run `expo-rtl on`. It writes `supportsRTL` and
62
+ `forcesRTL` in the app's app.json, keeps the file as it was, and opens
63
+ the app again in RTL. When you're done, run `expo-rtl off`: it puts
64
+ app.json back.
65
+
37
66
  ## Units
38
67
 
39
68
  - Each position and size is in dp, from the top-left corner of the
@@ -43,9 +72,9 @@ schema, so this skill doesn't repeat them. loupe works on Android 11
43
72
 
44
73
  ## Check one screen
45
74
 
46
- 1. Open the screen with `open-url` and its deep link. Give `waitText` (a
47
- text on that screen) or `waitStill`, so the call ends when the screen is
48
- there.
75
+ 1. Open the screen with `open-url` and its deep link (in Expo Go, with
76
+ `expo-open`). Give `waitText` (a text on that screen) or `waitStill`, so
77
+ the call ends when the screen is there.
49
78
  2. Run `check`. Read `passed`, then the findings of each rule that failed.
50
79
  3. Run `rotate` with `landscape-left`, then `check` again.
51
80
  4. Run `rotate` with `landscape-right`, then `check` again. A cutout on one
@@ -61,7 +90,13 @@ Take a `screenshot` when you want to see the screen, but decide with
61
90
  Give `sweep` one `url` for each screen. Add `orientation`
62
91
  (`portrait,landscape-left`) and `theme` (`light,dark`) to check each
63
92
  screen in each of them. Add `scroll` to check each screen again after one
64
- scroll down.
93
+ scroll down. For a long list, add `reloadEvery` (for example 10) with
94
+ `app`: loupe stops the app before each 10th link, so stacked screens
95
+ don't slow it down. A restarted screen has `reloaded` in the report. In
96
+ Expo Go, add `direction` (`ltr,rtl`) to check each screen in both layout
97
+ directions. loupe sets each direction once, in app.json, and puts app.json
98
+ back at the end. Each variant name then ends with its direction:
99
+ `portrait-light-rtl`.
65
100
 
66
101
  - The result lists each screen that failed, with each finding and its
67
102
  numbers. You don't need to check those screens again.
@@ -91,8 +126,10 @@ fewer.
91
126
  To check `mirrored`:
92
127
 
93
128
  1. Show the screen in LTR. Run `ui` with `out` set to a file.
94
- 2. Show the same screen in RTL, in the same orientation.
129
+ 2. Show the same screen in RTL, in the same orientation. In Expo Go, run
130
+ `expo-rtl on` with the route of the screen.
95
131
  3. Run `check` with `mirrorOf` set to that file.
132
+ 4. In Expo Go, run `expo-rtl off` when you're done.
96
133
 
97
134
  ## Read a result
98
135
 
@@ -123,16 +160,17 @@ to do. The codes:
123
160
  | `device_ambiguous` | Run `devices`, then give `device`. |
124
161
  | `device_unavailable` | The device is offline, not authorized, or still booting. Wait, or ask the user. |
125
162
  | `tool_missing` | loupe can't find adb. Ask the user to set `ANDROID_HOME`. |
126
- | `tool_failed` | adb failed. Read the message. |
163
+ | `tool_failed` | adb or Metro failed. Read the message: for a bundle, it gives Metro's error. |
127
164
  | `app_not_in_front` | Another app or a dialog is in front. Run `dismiss` for a dialog or a sheet, or `foreground` for the app. |
128
- | `not_idle` | The screen didn't keep still long enough to read it. Run `wait` with `still`, then try again. |
165
+ | `not_idle` | The screen didn't keep still long enough to read it. Run `wait` with `still`, then try again. An animation that never stops, or a long one, keeps a screen from loupe: take a screenshot, wait until it ends, or open another route. |
129
166
  | `element_not_found` | Run `ui`, find the element, and give its exact text, label, or id. |
130
167
  | `element_ambiguous` | More than one element matches. Give its `id`. |
131
168
  | `orientation_locked` | The app sets its own orientation. Check the orientations it allows. |
132
169
  | `timeout` | The screen didn't get there in time. The message says whether the action ran. |
133
- | `no_handler` | No app on the device opens that link. |
170
+ | `no_handler` | No app on the device opens that link. With no Expo Go, ask the user to install it: press "a" in `npx expo start`. |
171
+ | `no_server` | Nothing answers on the port, or it isn't Metro. Ask the user to run `npx expo start`, or give `port`. |
134
172
  | `invalid_input` | Fix the input. The message names the field. |
135
- | `unsupported` | loupe can't do this on this device or API level. |
173
+ | `unsupported` | loupe can't do this on this device or API level, or with this server. The message says why. |
136
174
  | `cancelled` | The call was cancelled. loupe stopped at a safe point. |
137
175
 
138
176
  ## The CLI