Skip to content

Commit 88c42f4

Browse files
authored
fix(devices): rename EAS Simulator to Expo Simulators (#36951)
1 parent ab2bf94 commit 88c42f4

32 files changed

Lines changed: 104 additions & 102 deletions

‎apps/server/graphql.config.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { defineConfig } from "@effect/graphql-generator/Config";
22

33
// `schema/expo.graphql` is api.expo.dev's schema, read by introspection
4-
// (`vp run generate:expo-schema`). The EAS Simulator operations are the ones
4+
// (`vp run generate:expo-schema`). The Expo Simulators operations are the ones
55
// eas-cli's `simulator:*` commands send; Expo does not document them.
66
export default defineConfig({
77
schema: "./schema/expo.graphql",

‎apps/server/src/device/DeviceHost.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export interface DeviceOperations {
139139
deviceId: string,
140140
) => Effect.Effect<AgentDeviceBinding, DeviceHostUnavailableError>;
141141
/**
142-
* Set by hosts that end devices on their own (EAS stops sessions at their
142+
* Set by hosts that end devices on their own (Expo stops sessions at their
143143
* limits), so a session on a device the host stops listing is dropped.
144144
*/
145145
readonly endsDevices?: boolean;

‎apps/server/src/device/DeviceHubProxy.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ const proxyHttp = Effect.fn("DeviceHubProxy.proxyHttp")(function* (
155155
const response = yield* httpClient.execute(upstreamRequest);
156156
const headers: Record<string, string> = {};
157157
for (const [name, value] of Object.entries(response.headers)) {
158-
// A cookie from an upstream such as an EAS session's preview host would land on T3's origin.
158+
// A cookie from an upstream such as an Expo Simulators session's preview host would land on T3's origin.
159159
if (
160160
name === "content-encoding" ||
161161
name === "transfer-encoding" ||

‎apps/server/src/device/DeviceService.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ const fixture = Effect.fn("fixture")(function* (
347347
}),
348348
),
349349
);
350-
// The host ending a device on its own, as EAS does at a session's limits.
350+
// The host ending a device on its own, as Expo does at a session's limits.
351351
const endDevice = () => {
352352
booted = false;
353353
};

‎apps/server/src/device/DeviceService.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class DeviceService extends Context.Service<
163163
readonly testHost: (
164164
config: SshDeviceHostConfig,
165165
) => Effect.Effect<DeviceHostSummary, DeviceError>;
166-
/** Who an Expo credential signs in as and which EAS projects it can run sessions under. */
166+
/** Who an Expo credential signs in as and which Expo projects it can run sessions under. */
167167
readonly easAccount: (
168168
input: DeviceEasAccountInput,
169169
) => Effect.Effect<DeviceEasAccount, DeviceEasAccountError>;
@@ -598,7 +598,7 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
598598
),
599599
...devices.filter((device) => !incompletePlatforms.includes(device.platform)),
600600
],
601-
// A host that ends devices itself (EAS stops sessions at their limits)
601+
// A host that ends devices itself (Expo stops sessions at their limits)
602602
// leaves sessions on devices it no longer lists with nothing to stream.
603603
// Other hosts can miss a device for one listing, so theirs stay.
604604
sessions: ready.devices.endsDevices
@@ -1127,7 +1127,7 @@ export const makeWithHosts = Effect.fn("DeviceService.makeWithHosts")(function*
11271127
easAccount: Effect.fn("DeviceService.easAccount")(function () {
11281128
return Effect.fail(
11291129
new DeviceEasAccountError({
1130-
reason: "EAS accounts are unavailable in this device service.",
1130+
reason: "Expo accounts are unavailable in this device service.",
11311131
}),
11321132
);
11331133
}),

‎apps/server/src/device/EasDeviceHost.test.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const APP_ID = "d763fcb8-d37c-41ea-a773-b54a0ab4a454";
2626
const config = (overrides: Partial<EasDeviceHostConfig> = {}): EasDeviceHostConfig => ({
2727
kind: "eas",
2828
id: "eas",
29-
label: "EAS Simulator",
29+
label: "Expo Simulators",
3030
appId: APP_ID,
3131
accessToken: "expo-token",
3232
maxSessionMinutes: 25,
@@ -174,7 +174,7 @@ const fakeExpo = (
174174
node: {
175175
id: "someone-else",
176176
status: "IN_PROGRESS",
177-
name: "T3 Code · EAS Simulator · 000000",
177+
name: "T3 Code · Expo Simulators · 000000",
178178
},
179179
},
180180
...(options.active ?? []).map((node) => ({ node })),
@@ -260,7 +260,7 @@ const makeHost = (
260260
Effect.provideService(Scope.Scope, scope),
261261
);
262262

263-
describe("EAS Simulator host", () => {
263+
describe("Expo Simulators host", () => {
264264
it.effect("starts a bounded session and routes its stream and agent to that session", () =>
265265
Effect.gen(function* () {
266266
const expo = fakeExpo();
@@ -433,13 +433,13 @@ describe("EAS Simulator host", () => {
433433
yield* ready.devices.boot(catalogDevice!);
434434
const refused = yield* ready.devices.boot(catalogDevice!).pipe(Effect.flip);
435435
expect(refused.message).toBe(
436-
"EAS Simulator is unavailable: EAS Simulator is limited to 1 running session. Close one in the Device panel first.",
436+
"Expo Simulators is unavailable: Expo Simulators is limited to 1 running session. Close one in the Device panel first.",
437437
);
438438
expect(expo.named("T3CreateEasSimulatorSession")).toHaveLength(1);
439439
}).pipe(Effect.scoped, Effect.provide(layer)),
440440
);
441441

442-
it.effect("tells concurrent sessions apart although EAS gives each the same UDID", () =>
442+
it.effect("tells concurrent sessions apart although Expo gives each the same UDID", () =>
443443
Effect.gen(function* () {
444444
const expo = fakeExpo();
445445
const scope = yield* Scope.make();
@@ -610,7 +610,7 @@ describe("EAS Simulator host", () => {
610610
}).pipe(Effect.scoped, Effect.provide(layer)),
611611
);
612612

613-
it.effect("asks for an EAS project before starting anything when none can be found", () =>
613+
it.effect("asks for an Expo project before starting anything when none can be found", () =>
614614
Effect.gen(function* () {
615615
const expo = fakeExpo();
616616
const host = yield* makeHost(expo, config({ appId: undefined }), yield* Scope.make());

‎apps/server/src/device/EasDeviceHost.ts‎

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Cloud simulators from EAS Simulator. A device exists only while a session
2+
* Cloud simulators from Expo Simulators. A device exists only while a session
33
* runs, and every session bills the Expo account until it stops, so this host
44
* bounds each one, stops all of them when it stops, and stops sessions a
55
* previous server left behind. It never touches sessions it did not start.
@@ -59,22 +59,22 @@ const decodeServeEmuApi = Schema.decodeUnknownEffect(
5959
*/
6060
const PLATFORMS = {
6161
ios: {
62-
name: "iPhone (EAS Simulator)",
62+
name: "iPhone (Expo Simulator)",
6363
hubPrefix: "/vendor/serve-sim",
6464
previewPrefix: "",
6565
protocol: "serve-sim",
6666
remoteDeviceId: (api: unknown) => decodeServeSimApi(api).pipe(Effect.map((api) => api.device)),
6767
},
6868
android: {
69-
name: "Android (EAS Simulator)",
69+
name: "Android (Expo Simulator)",
7070
hubPrefix: "/vendor/serve-emu",
7171
previewPrefix: "/vendor/serve-emu",
7272
protocol: "serve-emu",
7373
remoteDeviceId: (api: unknown) => decodeServeEmuApi(api).pipe(Effect.map((api) => api.serial)),
7474
},
7575
} as const;
7676

77-
/** EAS picks the simulator model; one entry starts a session. */
77+
/** Expo picks the simulator model; one entry starts a session. */
7878
const CATALOG: ReadonlyArray<DeviceHost.HostDevice> = [
7979
{
8080
id: "eas-ios",
@@ -163,7 +163,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
163163
>();
164164
const hostId = config.id;
165165
const ledgerPath = path.join(server.stateDir, "device", "eas", `${hostId}.json`);
166-
// Keyed by Expo's session id, which is also the device id: every EAS
166+
// Keyed by Expo's session id, which is also the device id: every Expo
167167
// simulator reports the same remote device id, so that id cannot tell sessions apart.
168168
const sessions = new Map<string, RunningSession>();
169169
const checkedAt = new Map<string, number>();
@@ -239,7 +239,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
239239
Effect.flatMap(decodeLedger),
240240
Effect.mapError((cause) =>
241241
unavailable(
242-
`The record of running EAS sessions at ${ledgerPath} could not be read. Fix or remove it.`,
242+
`The record of running Expo Simulators sessions at ${ledgerPath} could not be read. Fix or remove it.`,
243243
cause,
244244
),
245245
),
@@ -256,7 +256,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
256256
Effect.provide(services),
257257
Effect.mapError((cause) =>
258258
unavailable(
259-
`The record of running EAS sessions at ${ledgerPath} could not be written.`,
259+
`The record of running Expo Simulators sessions at ${ledgerPath} could not be written.`,
260260
cause,
261261
),
262262
),
@@ -267,13 +267,13 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
267267
entries.map((entry) => (entry.name === name ? { ...entry, refused: true } : entry)),
268268
).pipe(
269269
Effect.catch((cause) =>
270-
Effect.logWarning("Could not update the EAS session record", { name, cause }),
270+
Effect.logWarning("Could not update the Expo Simulators session record", { name, cause }),
271271
),
272272
);
273273
const forgetEntry = (name: string) =>
274274
writeLedger((entries) => entries.filter((entry) => entry.name !== name)).pipe(
275275
Effect.catch((cause) =>
276-
Effect.logWarning("Could not update the EAS session record", { name, cause }),
276+
Effect.logWarning("Could not update the Expo Simulators session record", { name, cause }),
277277
),
278278
);
279279

@@ -282,7 +282,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
282282
expo.stop(sessionId).pipe(
283283
Effect.andThen(forgetEntry(name)),
284284
Effect.tapError((cause) =>
285-
Effect.logWarning("Could not stop EAS Simulator session", { sessionId, cause }),
285+
Effect.logWarning("Could not stop Expo Simulators session", { sessionId, cause }),
286286
),
287287
);
288288

@@ -403,7 +403,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
403403
},
404404
reapLock.withPermit,
405405
Effect.catch((cause) =>
406-
Effect.logWarning("Could not stop recorded EAS Simulator sessions", { cause }),
406+
Effect.logWarning("Could not stop recorded Expo Simulators sessions", { cause }),
407407
),
408408
);
409409

@@ -439,7 +439,9 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
439439
hostId,
440440
deviceId: sessionId,
441441
reason: "launch_failed",
442-
cause: new Error(`EAS Simulator session ended (${session.status}) before it was ready`),
442+
cause: new Error(
443+
`Expo Simulators session ended (${session.status}) before it was ready`,
444+
),
443445
});
444446
}
445447
if (session.status === "IN_PROGRESS" && session.endpoints) return session.endpoints;
@@ -456,7 +458,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
456458
hostId,
457459
deviceId: sessionId,
458460
reason: "timeout",
459-
cause: new Error("EAS Simulator session did not start in time"),
461+
cause: new Error("Expo Simulators session did not start in time"),
460462
}),
461463
),
462464
}),
@@ -504,15 +506,15 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
504506
);
505507
if (!appId) {
506508
return yield* unavailable(
507-
"No EAS project to run the session under. Choose one for this host in Settings, or open the device from a thread whose project names extra.eas.projectId in app.json or its app config.",
509+
"No Expo project to run the session under. Choose one for this host in Settings, or open the device from a thread whose project names extra.eas.projectId in app.json or its app config.",
508510
);
509511
}
510512
const access = yield* expo
511513
.availability(appId)
512514
.pipe(Effect.mapError((error) => unavailable(error.message, error)));
513515
if (!access.available) {
514516
return yield* unavailable(
515-
`EAS Simulator is not enabled for the ${access.account} Expo account.`,
517+
`Expo Simulators is not enabled for the ${access.account} Expo account.`,
516518
);
517519
}
518520
const entry = { name, appId, recordedAt: yield* Clock.currentTimeMillis };
@@ -593,7 +595,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
593595
hostId,
594596
deviceId: sessionId,
595597
reason: "launch_failed",
596-
cause: new Error("EAS Simulator returned no preview endpoint"),
598+
cause: new Error("Expo Simulators returned no preview endpoint"),
597599
});
598600
}
599601
const origin = new URL(endpoints.preview.url).origin;
@@ -767,7 +769,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
767769
new DeviceOperationError({
768770
operation: "screenshot",
769771
reason: "request_failed",
770-
cause: new Error("The EAS Simulator session is not running"),
772+
cause: new Error("The Expo Simulator is not running"),
771773
}),
772774
),
773775
onSome: (session) =>
@@ -795,7 +797,7 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
795797
}),
796798
agentEndpoint: (deviceId) =>
797799
Option.match(sessionFor(deviceId), {
798-
onNone: () => Effect.fail(unavailable("This EAS Simulator device is no longer running.")),
800+
onNone: () => Effect.fail(unavailable("This Expo Simulator is no longer running.")),
799801
onSome: (session) =>
800802
Effect.succeed({ ...session.agent, agentDeviceId: session.remoteDeviceId }),
801803
}),
@@ -858,11 +860,11 @@ export const make = Effect.fn("EasDeviceHost.make")(function* (config: EasDevice
858860
onNone: () => Effect.void,
859861
onSome: (running) => releaseAgentDeviceSession(http, running.agent)(session),
860862
}),
861-
// Device settings run simctl on the simulator's own machine, which EAS does not expose.
863+
// Device settings run simctl on the simulator's own machine, which Expo does not expose.
862864
run: () =>
863865
Effect.succeed({
864866
stdout: "",
865-
stderr: "EAS Simulator devices cannot run host commands.",
867+
stderr: "Devices from Expo Simulators cannot run host commands.",
866868
code: 127,
867869
}),
868870
helpers: { serveSimAxSettings: null, serveSimCli: null },

‎apps/server/src/device/ExpoApi.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ describe("Expo API", () => {
154154
.availability("app-1")
155155
.pipe(Effect.flip);
156156
expect(graphQl.message).toBe(
157-
"Expo could not check EAS Simulator access: Feature not enabled",
157+
"Expo could not check Expo Simulators access: Feature not enabled",
158158
);
159159
const rejected = yield* makeExpoApi(respond(new Response("no", { status: 401 })), credential)
160160
.stop("session-1")

‎apps/server/src/device/ExpoApi.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Expo's GraphQL API for EAS Simulator sessions. The operations in
2+
* Expo's GraphQL API for Expo Simulators sessions. The operations in
33
* `ExpoApi.graphql` are the ones eas-cli's `simulator:*` commands send; their
44
* client is generated from `schema/expo.graphql` (`vp run generate`).
55
*/
@@ -313,7 +313,7 @@ export const makeExpoApi = (http: HttpClient.HttpClient, credential: ExpoCredent
313313
),
314314
),
315315
availability: (appId: string) =>
316-
call("check EAS Simulator access", (expo) =>
316+
call("check Expo Simulators access", (expo) =>
317317
expo.T3EasSimulatorAvailability({ appId, filter: [DEVICE_RUN_SESSIONS_GATE] }),
318318
).pipe(
319319
Effect.map(({ app }) => {

‎apps/server/src/device/easProjectId.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ it.effect("gives no answer when an app's config is there but cannot be read", ()
246246
}).pipe(Effect.scoped, Effect.provide(layer)),
247247
);
248248

249-
it.effect("does not guess between apps that name different EAS projects", () =>
249+
it.effect("does not guess between apps that name different Expo projects", () =>
250250
Effect.gen(function* () {
251251
const root = yield* workspace({
252252
"apps/one/app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),

0 commit comments

Comments
 (0)