eas-cli 24.1.0 → 24.1.1

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.
@@ -316,7 +316,10 @@ class Simulator extends EasCommand_1.default {
316
316
  return;
317
317
  }
318
318
  log_1.default.newLine();
319
- log_1.default.log((0, utils_1.formatRemoteSessionInstructions)(remoteConfig, flags['out-config-type'], { egressAllow }));
319
+ log_1.default.log((0, utils_1.formatRemoteSessionInstructions)(remoteConfig, flags['out-config-type'], {
320
+ egressAllow,
321
+ egressClientRunsInline: !nonInteractive,
322
+ }));
320
323
  log_1.default.newLine();
321
324
  const localEgress = (0, utils_1.getLocalEgressConfig)(remoteConfig, egressAllow);
322
325
  if (nonInteractive) {
@@ -333,7 +336,6 @@ class Simulator extends EasCommand_1.default {
333
336
  let egressError;
334
337
  const egressAbortController = new AbortController();
335
338
  if (localEgress) {
336
- log_1.default.log("🔀 Running the egress client in this terminal. When connected, proxied HTTP(S) requests can use this machine's network.");
337
339
  log_1.default.log('Press Ctrl+C to stop both the egress client and the simulator session.');
338
340
  log_1.default.newLine();
339
341
  sessionInterrupt.signal.addEventListener('abort', () => {
@@ -27,6 +27,12 @@ export type LocalEgressConfig = {
27
27
  };
28
28
  export type LocalEgressOptions = {
29
29
  egressAllow?: readonly string[];
30
+ /**
31
+ * Whether the calling command runs the egress client itself in the current
32
+ * terminal, as interactive `simulator:start` does. When false the reader must
33
+ * start `eas simulator:egress` in another process.
34
+ */
35
+ egressClientRunsInline?: boolean;
30
36
  };
31
37
  /**
32
38
  * Connection details for the local egress client, present only for sessions
@@ -66,5 +72,5 @@ export declare function formatPreviewUrl(url: string, token: string | null | und
66
72
  * it has to know to combine.
67
73
  */
68
74
  export declare function sanitizeRemoteConfigForJson(remoteConfig: DeviceRunSessionRemoteConfig): DeviceRunSessionRemoteConfig;
69
- export declare function formatRemoteSessionInstructions(remoteConfig: DeviceRunSessionRemoteConfig, configType: RemoteSessionInstructionsConfigType, { egressAllow }?: LocalEgressOptions): string;
75
+ export declare function formatRemoteSessionInstructions(remoteConfig: DeviceRunSessionRemoteConfig, configType: RemoteSessionInstructionsConfigType, { egressAllow, egressClientRunsInline }?: LocalEgressOptions): string;
70
76
  export {};
@@ -180,12 +180,13 @@ function sanitizeRemoteConfigForJson(remoteConfig) {
180
180
  }
181
181
  }
182
182
  }
183
- function formatRemoteSessionInstructions(remoteConfig, configType, { egressAllow } = {}) {
183
+ function formatRemoteSessionInstructions(remoteConfig, configType, { egressAllow, egressClientRunsInline = false } = {}) {
184
184
  const instructions = formatControllerInstructions(remoteConfig, configType);
185
185
  const egress = getLocalEgressConfig(remoteConfig, egressAllow);
186
186
  if (!egress) {
187
187
  return instructions;
188
188
  }
189
+ const egressCommand = configType === 'env' ? 'eas simulator:egress --config-type env' : 'eas simulator:egress';
189
190
  return [
190
191
  instructions,
191
192
  '',
@@ -193,11 +194,19 @@ function formatRemoteSessionInstructions(remoteConfig, configType, { egressAllow
193
194
  ...(configType === 'env'
194
195
  ? Object.entries(getLocalEgressEnvironmentVariables(egress)).map(([key, value]) => `export ${key}='${value}'`)
195
196
  : []),
196
- 'Run the egress client to connect the tunnel:',
197
- '',
198
- configType === 'env' ? 'eas simulator:egress --config-type env' : 'eas simulator:egress',
199
- '',
200
- 'Keep it running for the life of the session.',
197
+ ...(egressClientRunsInline
198
+ ? [
199
+ 'The egress client runs in this terminal for the life of the session. If this process exits, reconnect the tunnel from another shell with:',
200
+ '',
201
+ egressCommand,
202
+ ]
203
+ : [
204
+ 'Run the egress client to connect the tunnel:',
205
+ '',
206
+ egressCommand,
207
+ '',
208
+ 'Keep it running for the life of the session.',
209
+ ]),
201
210
  ...(egress.allow.length > 0
202
211
  ? [
203
212
  '',