eas-cli 27.7.2 → 27.9.0

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.
Files changed (38) hide show
  1. package/README.md +214 -211
  2. package/build/build/build.js +1 -2
  3. package/build/build/utils/repository.js +4 -4
  4. package/build/commands/build/download.js +1 -2
  5. package/build/commands/simulator/availability.js +4 -3
  6. package/build/commands/simulator/control.js +12 -3
  7. package/build/commands/simulator/events.js +1 -1
  8. package/build/commands/simulator/exec.js +1 -1
  9. package/build/commands/simulator/get.js +3 -3
  10. package/build/commands/simulator/index.js +9 -7
  11. package/build/commands/simulator/list.js +1 -1
  12. package/build/commands/simulator/logs.js +1 -1
  13. package/build/commands/simulator/stop.js +1 -1
  14. package/build/commands/update/embedded/view.js +2 -2
  15. package/build/graphql/generated.d.ts +1 -0
  16. package/build/graphql/generated.js +1 -0
  17. package/build/project/maybeUploadAssetMapAsync.js +2 -2
  18. package/build/project/maybeUploadSourceMapsAsync.js +3 -3
  19. package/build/project/uploadAccountScopedFileAsync.js +3 -3
  20. package/build/project/uploadAccountScopedProjectSourceAsync.js +2 -2
  21. package/build/simulator/appArchive.d.ts +6 -0
  22. package/build/simulator/appArchive.js +61 -0
  23. package/build/simulator/artifacts.js +2 -2
  24. package/build/simulator/controlActions.d.ts +8 -2
  25. package/build/simulator/controlActions.js +40 -10
  26. package/build/simulator/controlConfig.d.ts +2 -1
  27. package/build/simulator/controlConfig.js +8 -3
  28. package/build/simulator/hostActions.d.ts +2 -0
  29. package/build/simulator/hostActions.js +1 -0
  30. package/build/simulator/startSetup.js +5 -1
  31. package/build/simulator/utils.d.ts +3 -3
  32. package/build/simulator/utils.js +8 -6
  33. package/build/utils/download.js +3 -3
  34. package/build/utils/files.d.ts +0 -1
  35. package/build/utils/files.js +0 -29
  36. package/build/utils/statuspageService.js +11 -2
  37. package/oclif.manifest.json +798 -798
  38. package/package.json +6 -6
@@ -35,7 +35,6 @@ const maybeUploadFingerprintAsync_1 = require("../project/maybeUploadFingerprint
35
35
  const resolveRuntimeVersionAsync_1 = require("../project/resolveRuntimeVersionAsync");
36
36
  const uploads_1 = require("../uploads");
37
37
  const centrifuge_1 = require("../utils/centrifuge");
38
- const files_1 = require("../utils/files");
39
38
  const json_1 = require("../utils/json");
40
39
  const progress_1 = require("../utils/progress");
41
40
  const promise_1 = require("../utils/promise");
@@ -282,7 +281,7 @@ async function uploadProjectAsync(ctx) {
282
281
  const [bucketKey, { metadataLocation }] = await Promise.all([
283
282
  (0, uploads_1.uploadFileAtPathToGCSAsync)(ctx.graphqlClient, generated_1.UploadSessionType.EasBuildGcsProjectSources, projectTarball.path, (0, progress_1.createProgressTracker)({
284
283
  total: projectTarball.size,
285
- message: ratio => `Uploading to EAS Build (${(0, files_1.formatBytes)(projectTarball.size * ratio)} / ${(0, files_1.formatBytes)(projectTarball.size)})`,
284
+ message: ratio => `Uploading to EAS Build (${(0, eas_build_job_1.formatBytes)(projectTarball.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(projectTarball.size)})`,
286
285
  completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
287
286
  })),
288
287
  uploadMetadataFileAsync(projectTarball, ctx),
@@ -9,6 +9,7 @@ exports.maybeWarnAboutProjectTarballSize = maybeWarnAboutProjectTarballSize;
9
9
  exports.assertProjectTarballSizeDoesNotExceedLimit = assertProjectTarballSizeDoesNotExceedLimit;
10
10
  exports.reviewAndCommitChangesAsync = reviewAndCommitChangesAsync;
11
11
  const tslib_1 = require("tslib");
12
+ const eas_build_job_1 = require("@expo/eas-build-job");
12
13
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
13
14
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
14
15
  const path_1 = tslib_1.__importDefault(require("path"));
@@ -17,7 +18,6 @@ const uuid_1 = require("uuid");
17
18
  const log_1 = tslib_1.__importStar(require("../../log"));
18
19
  const ora_1 = require("../../ora");
19
20
  const prompts_1 = require("../../prompts");
20
- const files_1 = require("../../utils/files");
21
21
  const paths_1 = require("../../utils/paths");
22
22
  const timer_1 = require("../../utils/timer");
23
23
  async function maybeBailOnRepoStatusAsync(vcsClient, nonInteractive) {
@@ -139,7 +139,7 @@ async function makeProjectTarballAsync(vcsClient) {
139
139
  const duration = (0, timer_1.endTimer)(compressTimerLabel);
140
140
  if (spinner.isSpinning) {
141
141
  const prettyTime = (0, timer_1.formatMilliseconds)(duration);
142
- spinner.succeed(`Compressed project files ${chalk_1.default.dim(`${prettyTime} (${(0, files_1.formatBytes)(size)})`)}`);
142
+ spinner.succeed(`Compressed project files ${chalk_1.default.dim(`${prettyTime} (${(0, eas_build_job_1.formatBytes)(size)})`)}`);
143
143
  }
144
144
  return { size, path: tarPath };
145
145
  }
@@ -147,14 +147,14 @@ function maybeWarnAboutProjectTarballSize(size) {
147
147
  if (size <= 150 /* MiB */ * 1024 /* KiB */ * 1024 /* B */) {
148
148
  return;
149
149
  }
150
- log_1.default.warn(`Your project archive is ${(0, files_1.formatBytes)(size)}. You can reduce its size and the time it takes to upload by excluding files that are unnecessary for the build process in ${chalk_1.default.bold('.easignore')} file. ${(0, log_1.learnMore)('https://expo.fyi/eas-build-archive')}`);
150
+ log_1.default.warn(`Your project archive is ${(0, eas_build_job_1.formatBytes)(size)}. You can reduce its size and the time it takes to upload by excluding files that are unnecessary for the build process in ${chalk_1.default.bold('.easignore')} file. ${(0, log_1.learnMore)('https://expo.fyi/eas-build-archive')}`);
151
151
  }
152
152
  const MAX_ALLOWED_PROJECT_TARBALL_SIZE = 2 /* GiB */ * 1024 /* MiB */ * 1024 /* KiB */ * 1024; /* B */
153
153
  function assertProjectTarballSizeDoesNotExceedLimit(size) {
154
154
  if (size <= MAX_ALLOWED_PROJECT_TARBALL_SIZE) {
155
155
  return;
156
156
  }
157
- throw new Error(`Project archive is too big. Maximum allowed size is ${(0, files_1.formatBytes)(MAX_ALLOWED_PROJECT_TARBALL_SIZE)}.`);
157
+ throw new Error(`Project archive is too big. Maximum allowed size is ${(0, eas_build_job_1.formatBytes)(MAX_ALLOWED_PROJECT_TARBALL_SIZE)}.`);
158
158
  }
159
159
  var ShouldCommitChanges;
160
160
  (function (ShouldCommitChanges) {
@@ -15,7 +15,6 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
15
15
  const prompts_1 = require("../../prompts");
16
16
  const run_1 = require("../../run/run");
17
17
  const download_1 = require("../../utils/download");
18
- const files_1 = require("../../utils/files");
19
18
  const json_1 = require("../../utils/json");
20
19
  const paths_1 = require("../../utils/paths");
21
20
  class Download extends EasCommand_1.default {
@@ -134,7 +133,7 @@ class Download extends EasCommand_1.default {
134
133
  for (const { name, url } of extraArtifacts) {
135
134
  const fileName = getFileNameFromUrl(url, name);
136
135
  const outputPath = path_1.default.join(outputDir, fileName);
137
- await (0, download_1.downloadFileWithProgressTrackerAsync)(url, outputPath, (ratio, total) => `Downloading ${name} (${(0, files_1.formatBytes)(total * ratio)} / ${(0, files_1.formatBytes)(total)})`, `Successfully downloaded ${name}`);
136
+ await (0, download_1.downloadFileWithProgressTrackerAsync)(url, outputPath, (ratio, total) => `Downloading ${name} (${(0, eas_build_job_1.formatBytes)(total * ratio)} / ${(0, eas_build_job_1.formatBytes)(total)})`, `Successfully downloaded ${name}`);
138
137
  downloaded[name] = outputPath;
139
138
  }
140
139
  return downloaded;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
5
5
  const flags_1 = require("../../commandUtils/flags");
6
+ const url_1 = require("../../build/utils/url");
6
7
  const DeviceRunSessionAvailabilityQuery_1 = require("../../graphql/queries/DeviceRunSessionAvailabilityQuery");
7
8
  const log_1 = tslib_1.__importDefault(require("../../log"));
8
9
  const ora_1 = require("../../ora");
@@ -12,7 +13,7 @@ const commandAliases_1 = require("../../simulator/commandAliases");
12
13
  class SimulatorAvailability extends EasCommand_1.default {
13
14
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('availability');
14
15
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('availability');
15
- static description = '[EXPERIMENTAL] check whether EAS Simulator is enabled for the current project account';
16
+ static description = 'check whether EAS Simulator is enabled for the current project account';
16
17
  static flags = {
17
18
  ...flags_1.EasNonInteractiveAndJsonFlags,
18
19
  };
@@ -45,8 +46,8 @@ class SimulatorAvailability extends EasCommand_1.default {
45
46
  (0, json_1.printJsonOnlyOutput)({
46
47
  available,
47
48
  accountName,
48
- // Only present when gated, so scripts and agents can pass the waitlist link on.
49
- ...(available ? {} : { waitlistUrl: utils_1.EAS_SIMULATOR_WAITLIST_URL }),
49
+ // Only present when gated, so scripts and agents can pass the upgrade link on.
50
+ ...(available ? {} : { billingUrl: (0, url_1.getAccountBillingUrl)(accountName) }),
50
51
  });
51
52
  return;
52
53
  }
@@ -23,7 +23,7 @@ const timer_1 = require("../../utils/timer");
23
23
  class SimulatorControl extends EasCommand_1.default {
24
24
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('control');
25
25
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('control');
26
- static description = `[EXPERIMENTAL] control a remote iOS simulator session on EAS
26
+ static description = `control a remote iOS simulator session on EAS
27
27
 
28
28
  Run without an action to list available actions. Use <action> --help for usage.
29
29
 
@@ -51,7 +51,7 @@ Existing output files are overwritten. When saving to a directory, an existing f
51
51
  '$ eas simulator:control --import ./simulator-control.json',
52
52
  '$ eas simulator:control hardwareKeyboard.set off',
53
53
  '$ eas simulator:control permissions.set grant camera com.example.app',
54
- '$ eas simulator:control app.install ./MyApp.ipa',
54
+ '$ eas simulator:control app.install ./MyApp.app',
55
55
  '$ eas simulator:control screenshot.capture --output ./screenshot.png',
56
56
  '$ eas simulator:control screenshot.capture --output ./screenshot.png --id <session-id>',
57
57
  ];
@@ -376,7 +376,16 @@ Existing output files are overwritten. When saving to a directory, an existing f
376
376
  let output;
377
377
  let savedFile;
378
378
  try {
379
- ({ output, file: savedFile } = await (0, controlActions_1.executeControlActionAsync)(connection, plan));
379
+ ({ output, file: savedFile } = await (0, controlActions_1.executeControlActionAsync)(connection, plan, {
380
+ onProgress: phase => {
381
+ spinner.text =
382
+ phase === 'packaging'
383
+ ? 'Packaging app'
384
+ : phase === 'uploading'
385
+ ? `Uploading ${plan.localFile.path}`
386
+ : `Running ${action} on simulator session ${session.id}`;
387
+ },
388
+ }));
380
389
  spinner.succeed(`Ran ${action} on simulator session ${session.id}`);
381
390
  }
382
391
  catch (err) {
@@ -17,7 +17,7 @@ const POST_STOP_REFRESH_COUNT = 2;
17
17
  class SimulatorEvents extends EasCommand_1.default {
18
18
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('events');
19
19
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('events');
20
- static description = '[EXPERIMENTAL] show activity events from a remote simulator session';
20
+ static description = 'show activity events from a remote simulator session';
21
21
  static flags = {
22
22
  id: core_1.Flags.string({
23
23
  description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
@@ -8,7 +8,7 @@ const commandAliases_1 = require("../../simulator/commandAliases");
8
8
  class SimulatorExec extends EasCommand_1.default {
9
9
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('exec');
10
10
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('exec');
11
- static description = `[EXPERIMENTAL] execute a simulator command with ${env_1.SIMULATOR_DOTENV_FILE_NAME} environment loaded`;
11
+ static description = `execute a simulator command with ${env_1.SIMULATOR_DOTENV_FILE_NAME} environment loaded`;
12
12
  static strict = false;
13
13
  static contextDefinition = {
14
14
  ...this.ContextOptions.ProjectDir,
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const core_1 = require("@oclif/core");
5
6
  const url_1 = require("../../build/utils/url");
6
7
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
@@ -12,14 +13,13 @@ const ora_1 = require("../../ora");
12
13
  const env_1 = require("../../simulator/env");
13
14
  const jobRunErrors_1 = require("../../simulator/jobRunErrors");
14
15
  const utils_1 = require("../../simulator/utils");
15
- const files_1 = require("../../utils/files");
16
16
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
17
17
  const json_1 = require("../../utils/json");
18
18
  const commandAliases_1 = require("../../simulator/commandAliases");
19
19
  class SimulatorGet extends EasCommand_1.default {
20
20
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('get');
21
21
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('get');
22
- static description = "[EXPERIMENTAL] get info about a remote simulator session on EAS by its simulator session ID. Preview links follow the session's saved sharing preference";
22
+ static description = "get info about a remote simulator session on EAS by its simulator session ID. Preview links follow the session's saved sharing preference";
23
23
  static flags = {
24
24
  id: core_1.Flags.string({
25
25
  description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
@@ -148,7 +148,7 @@ function formatDeviceRunSessionArtifactFields(artifact) {
148
148
  }
149
149
  function formatFileSize(fileSizeBytes) {
150
150
  return typeof fileSizeBytes === 'number'
151
- ? `${(0, files_1.formatBytes)(fileSizeBytes)} (${fileSizeBytes} B)`
151
+ ? `${(0, eas_build_job_1.formatBytes)(fileSizeBytes)} (${fileSizeBytes} B)`
152
152
  : 'null';
153
153
  }
154
154
  function formatMetadata(metadata) {
@@ -30,6 +30,7 @@ const requestAnalytics_1 = require("../../simulator/requestAnalytics");
30
30
  const utils_1 = require("../../simulator/utils");
31
31
  const json_1 = require("../../utils/json");
32
32
  const promise_1 = require("../../utils/promise");
33
+ const statuspageService_1 = require("../../utils/statuspageService");
33
34
  // Allow the cold-cache client download (up to 60s) and a further minute to connect.
34
35
  const EGRESS_SETUP_TIMEOUT_MS = 120_000;
35
36
  const POLL_INTERVAL_MS = 5_000; // 5 seconds
@@ -51,7 +52,7 @@ class Simulator extends EasCommand_1.default {
51
52
  ...commandAliases_1.SIMULATOR_HIDDEN_TOPIC_ALIASES,
52
53
  ...(0, commandAliases_1.getSimulatorCommandHiddenAliases)('start'),
53
54
  ];
54
- static description = `[EXPERIMENTAL] start a remote simulator session on EAS
55
+ static description = `start a remote simulator session on EAS
55
56
 
56
57
  Preview links require sign-in by default.
57
58
 
@@ -154,7 +155,7 @@ With local egress, actions wait for the connection and require interactive mode.
154
155
  options: Object.values(utils_1.DEVICE_RUN_SESSION_RESOURCE_CLASS_FLAG_VALUES),
155
156
  })(),
156
157
  egress: core_1.Flags.option({
157
- description: 'With "local", the simulator\'s network traffic exits from this machine and fails while the egress client is disconnected. On iOS, the simulator system proxy points at this machine: HTTP(S) and WebSocket requests that honor it (WebKit, URLSession) and clients that read proxy environment variables (gRPC, libcurl) use it, and connections that ignore both are refused inside the simulator and listed, with the library that tried, in the Logs section of the session page on expo.dev. On Android, all TCP traffic from the emulator goes through its proxy to this machine; traffic that cannot (UDP, such as QUIC) is refused and listed in the same Logs section, and DNS for apps that ignore the system proxy resolves on the device host. The egress client must keep running for the life of the session.',
158
+ description: '[EXPERIMENTAL] With "local", the simulator\'s network traffic exits from this machine and fails while the egress client is disconnected. On iOS, the simulator system proxy points at this machine: HTTP(S) and WebSocket requests that honor it (WebKit, URLSession) and clients that read proxy environment variables (gRPC, libcurl) use it, and connections that ignore both are refused inside the simulator and listed, with the library that tried, in the Logs section of the session page on expo.dev. On Android, all TCP traffic from the emulator goes through its proxy to this machine; traffic that cannot (UDP, such as QUIC) is refused and listed in the same Logs section, and DNS for apps that ignore the system proxy resolves on the device host. The egress client must keep running for the life of the session.',
158
159
  options: EGRESS_FLAG_VALUES,
159
160
  })(),
160
161
  'egress-allow': core_1.Flags.string({
@@ -204,7 +205,7 @@ With local egress, actions wait for the connection and require interactive mode.
204
205
  nonInteractive,
205
206
  });
206
207
  // The server would reject the session anyway, but check the gate first so gated
207
- // accounts get the waitlist link instead of a generic permission error. Expo admins
208
+ // accounts get the upgrade link instead of a generic permission error. Expo admins
208
209
  // skip the check so they can work on any account and let the server decide.
209
210
  if (!actor.isExpoAdmin) {
210
211
  const { accountName, available } = await DeviceRunSessionAvailabilityQuery_1.DeviceRunSessionAvailabilityQuery.byAppIdAsync(graphqlClient, projectId);
@@ -292,10 +293,6 @@ With local egress, actions wait for the connection and require interactive mode.
292
293
  if (nonInteractive && egress && imported.config?.actions?.length) {
293
294
  throw new errors_1.EasCommandError('Imported actions with local egress require interactive mode. Start without actions, connect eas simulator:egress, then run eas simulator:control --import with the same file.');
294
295
  }
295
- if (platform === generated_1.AppPlatform.Android) {
296
- log_1.default.warn('Android emulator support in EAS Simulator is still in development. Some features available on iOS may not work on Android yet. Full parity with iOS is coming soon.');
297
- log_1.default.newLine();
298
- }
299
296
  const expoGoSdkVersion = flags['expo-go']
300
297
  ? await (0, expoGo_1.resolveExpoGoSdkVersionAsync)({ projectDir, sdkVersion: sdkVersionFromFlag })
301
298
  : undefined;
@@ -305,6 +302,11 @@ With local egress, actions wait for the connection and require interactive mode.
305
302
  `To stop it, run: eas simulator:stop --id ${existingDeviceRunSessionId}`);
306
303
  log_1.default.newLine();
307
304
  }
305
+ // Same services as the outage banner on the simulator pages of the website.
306
+ await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(graphqlClient, [
307
+ generated_1.StatuspageServiceName.EasSimulator,
308
+ generated_1.StatuspageServiceName.EasWorkflows,
309
+ ]);
308
310
  const createSpinner = (0, ora_1.ora)('🚀 Creating simulator session').start();
309
311
  let deviceRunSessionId;
310
312
  let deviceRunSessionUrl;
@@ -37,7 +37,7 @@ const PLATFORM_BY_FLAG_VALUE = Object.fromEntries(Object.entries(PLATFORM_FLAG_V
37
37
  class SimulatorList extends EasCommand_1.default {
38
38
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('list');
39
39
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('list');
40
- static description = '[EXPERIMENTAL] list remote simulator sessions for the current project';
40
+ static description = 'list remote simulator sessions for the current project';
41
41
  static flags = {
42
42
  status: core_1.Flags.option({
43
43
  description: 'Filter by session status (repeatable)',
@@ -18,7 +18,7 @@ const LOG_SOURCE_HEALTH_CHECK_INTERVAL_MS = 10_000;
18
18
  class SimulatorLogs extends EasCommand_1.default {
19
19
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('logs');
20
20
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('logs');
21
- static description = '[EXPERIMENTAL] show buffered logs from a remote iOS simulator session';
21
+ static description = 'show buffered logs from a remote iOS simulator session';
22
22
  static examples = [
23
23
  '<%= config.bin %> simulator:logs --follow',
24
24
  '<%= config.bin %> simulator:logs --json',
@@ -12,7 +12,7 @@ const commandAliases_1 = require("../../simulator/commandAliases");
12
12
  class SimulatorStop extends EasCommand_1.default {
13
13
  static aliases = (0, commandAliases_1.getSimulatorCommandAliases)('stop');
14
14
  static hiddenAliases = (0, commandAliases_1.getSimulatorCommandHiddenAliases)('stop');
15
- static description = '[EXPERIMENTAL] stop a remote simulator session on EAS by its simulator session ID';
15
+ static description = 'stop a remote simulator session on EAS by its simulator session ID';
16
16
  static flags = {
17
17
  id: core_1.Flags.string({
18
18
  description: `Simulator session ID. Defaults to ${env_1.SIMULATOR_DOTENV_FILE_NAME}.`,
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatEmbeddedUpdate = formatEmbeddedUpdate;
4
4
  const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
5
6
  const core_1 = require("@oclif/core");
6
7
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
8
  const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
@@ -9,7 +10,6 @@ const flags_1 = require("../../../commandUtils/flags");
9
10
  const EmbeddedUpdateQuery_1 = require("../../../graphql/queries/EmbeddedUpdateQuery");
10
11
  const log_1 = tslib_1.__importDefault(require("../../../log"));
11
12
  const date_1 = require("../../../utils/date");
12
- const files_1 = require("../../../utils/files");
13
13
  const formatFields_1 = tslib_1.__importDefault(require("../../../utils/formatFields"));
14
14
  const json_1 = require("../../../utils/json");
15
15
  class UpdateEmbeddedView extends EasCommand_1.default {
@@ -65,7 +65,7 @@ function formatEmbeddedUpdate(embeddedUpdate) {
65
65
  { label: 'Platform', value: embeddedUpdate.platform.toLowerCase() },
66
66
  { label: 'Runtime version', value: embeddedUpdate.runtimeVersion },
67
67
  { label: 'Channel', value: embeddedUpdate.channel },
68
- { label: 'Bundle size', value: (0, files_1.formatBytes)(bundleSize) },
68
+ { label: 'Bundle size', value: (0, eas_build_job_1.formatBytes)(bundleSize) },
69
69
  { label: 'Bundle SHA-256', value: embeddedUpdate.launchAsset.fileSHA256 },
70
70
  {
71
71
  label: 'Created at',
@@ -9611,6 +9611,7 @@ export type StatuspageService = {
9611
9611
  /** Name of a service monitored by Expo status page. */
9612
9612
  export declare enum StatuspageServiceName {
9613
9613
  EasBuild = "EAS_BUILD",
9614
+ EasSimulator = "EAS_SIMULATOR",
9614
9615
  EasSubmit = "EAS_SUBMIT",
9615
9616
  EasUpdate = "EAS_UPDATE",
9616
9617
  EasWorkflows = "EAS_WORKFLOWS",
@@ -1052,6 +1052,7 @@ var StatuspageIncidentStatus;
1052
1052
  var StatuspageServiceName;
1053
1053
  (function (StatuspageServiceName) {
1054
1054
  StatuspageServiceName["EasBuild"] = "EAS_BUILD";
1055
+ StatuspageServiceName["EasSimulator"] = "EAS_SIMULATOR";
1055
1056
  StatuspageServiceName["EasSubmit"] = "EAS_SUBMIT";
1056
1057
  StatuspageServiceName["EasUpdate"] = "EAS_UPDATE";
1057
1058
  StatuspageServiceName["EasWorkflows"] = "EAS_WORKFLOWS";
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.maybeUploadAssetMapAsync = maybeUploadAssetMapAsync;
4
4
  const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
8
  const path_1 = tslib_1.__importDefault(require("path"));
8
9
  const generated_1 = require("../graphql/generated");
9
10
  const log_1 = tslib_1.__importDefault(require("../log"));
10
11
  const uploads_1 = require("../uploads");
11
- const files_1 = require("../utils/files");
12
12
  const progress_1 = require("../utils/progress");
13
13
  async function maybeUploadAssetMapAsync(distRoot, graphqlClient) {
14
14
  const assetMapPath = path_1.default.join(distRoot, 'assetmap.json');
@@ -20,7 +20,7 @@ async function maybeUploadAssetMapAsync(distRoot, graphqlClient) {
20
20
  try {
21
21
  gcsBucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasUpdateAssetsMetadata, assetMapPath, (0, progress_1.createProgressTracker)({
22
22
  total: fileStat.size,
23
- message: ratio => `Uploading assetmap.json (${(0, files_1.formatBytes)(fileStat.size * ratio)} / ${(0, files_1.formatBytes)(fileStat.size)})`,
23
+ message: ratio => `Uploading assetmap.json (${(0, eas_build_job_1.formatBytes)(fileStat.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(fileStat.size)})`,
24
24
  completedMessage: (duration) => `Uploaded assetmap.json ${chalk_1.default.dim(duration)}`,
25
25
  }));
26
26
  }
@@ -6,6 +6,7 @@ exports.maybeUploadSourceMapsAsync = maybeUploadSourceMapsAsync;
6
6
  exports.resolveSourceMapPathsAsync = resolveSourceMapPathsAsync;
7
7
  exports.stripSourcesContentAsync = stripSourcesContentAsync;
8
8
  const tslib_1 = require("tslib");
9
+ const eas_build_job_1 = require("@expo/eas-build-job");
9
10
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
11
  const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
11
12
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
@@ -15,7 +16,6 @@ const publish_1 = require("./publish");
15
16
  const generated_1 = require("../graphql/generated");
16
17
  const log_1 = tslib_1.__importDefault(require("../log"));
17
18
  const uploads_1 = require("../uploads");
18
- const files_1 = require("../utils/files");
19
19
  const paths_1 = require("../utils/paths");
20
20
  const progress_1 = require("../utils/progress");
21
21
  /** Platforms for which EAS stores a source map. The GraphQL SourceMapGroup input has no `web`. */
@@ -63,12 +63,12 @@ async function uploadSourceMapForPlatformAsync(graphqlClient, sourceMapPath, pla
63
63
  const strippedPath = await stripSourcesContentAsync(sourceMapPath, platform);
64
64
  const { size } = await fs_extra_1.default.promises.stat(strippedPath);
65
65
  if (size > exports.MAX_SOURCE_MAP_SIZE_BYTES) {
66
- log_1.default.warn(`Skipping the ${platform} source map because it is ${(0, files_1.formatBytes)(size)}, above the ${(0, files_1.formatBytes)(exports.MAX_SOURCE_MAP_SIZE_BYTES)} limit for source map uploads.`);
66
+ log_1.default.warn(`Skipping the ${platform} source map because it is ${(0, eas_build_job_1.formatBytes)(size)}, above the ${(0, eas_build_job_1.formatBytes)(exports.MAX_SOURCE_MAP_SIZE_BYTES)} limit for source map uploads.`);
67
67
  return null;
68
68
  }
69
69
  const bucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasUpdateSourceMaps, strippedPath, (0, progress_1.createProgressTracker)({
70
70
  total: size,
71
- message: ratio => `Uploading ${platform} source map (${(0, files_1.formatBytes)(size * ratio)} / ${(0, files_1.formatBytes)(size)})`,
71
+ message: ratio => `Uploading ${platform} source map (${(0, eas_build_job_1.formatBytes)(size * ratio)} / ${(0, eas_build_job_1.formatBytes)(size)})`,
72
72
  completedMessage: (duration) => `Uploaded ${platform} source map ${chalk_1.default.dim(duration)}`,
73
73
  }));
74
74
  return { type: generated_1.SourceMapSourceType.Gcs, bucketKey };
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uploadAccountScopedFileAsync = uploadAccountScopedFileAsync;
4
4
  const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
7
8
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
8
9
  const generated_1 = require("../graphql/generated");
9
10
  const uploads_1 = require("../uploads");
10
- const files_1 = require("../utils/files");
11
11
  const progress_1 = require("../utils/progress");
12
12
  /**
13
13
  * Uploads a file to GCS as account-scoped object.
@@ -18,7 +18,7 @@ async function uploadAccountScopedFileAsync({ graphqlClient, accountId, filePath
18
18
  const fileName = node_path_1.default.basename(filePath);
19
19
  const fileStat = await node_fs_1.default.promises.stat(filePath);
20
20
  if (fileStat.size > maxSizeBytes) {
21
- throw new Error(`File is too big. Maximum allowed size is ${(0, files_1.formatBytes)(maxSizeBytes)}.`);
21
+ throw new Error(`File is too big. Maximum allowed size is ${(0, eas_build_job_1.formatBytes)(maxSizeBytes)}.`);
22
22
  }
23
23
  const fileBucketKey = await (0, uploads_1.uploadAccountScopedFileAtPathToGCSAsync)(graphqlClient, {
24
24
  accountId,
@@ -26,7 +26,7 @@ async function uploadAccountScopedFileAsync({ graphqlClient, accountId, filePath
26
26
  path: filePath,
27
27
  handleProgressEvent: (0, progress_1.createProgressTracker)({
28
28
  total: fileStat.size,
29
- message: ratio => `Uploading ${fileName} to EAS (${(0, files_1.formatBytes)(fileStat.size * ratio)} / ${(0, files_1.formatBytes)(fileStat.size)})`,
29
+ message: ratio => `Uploading ${fileName} to EAS (${(0, eas_build_job_1.formatBytes)(fileStat.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(fileStat.size)})`,
30
30
  completedMessage: (duration) => `Uploaded ${fileName} to EAS ${chalk_1.default.dim(duration)}`,
31
31
  }),
32
32
  });
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.uploadAccountScopedProjectSourceAsync = uploadAccountScopedProjectSourceAsync;
4
4
  const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
7
8
  const repository_1 = require("../build/utils/repository");
8
9
  const generated_1 = require("../graphql/generated");
9
10
  const log_1 = tslib_1.__importStar(require("../log"));
10
11
  const uploads_1 = require("../uploads");
11
- const files_1 = require("../utils/files");
12
12
  const progress_1 = require("../utils/progress");
13
13
  /**
14
14
  * Archives the project and uploads it to GCS as account-scoped object.
@@ -29,7 +29,7 @@ async function uploadAccountScopedProjectSourceAsync({ graphqlClient, vcsClient,
29
29
  path: projectTarball.path,
30
30
  handleProgressEvent: (0, progress_1.createProgressTracker)({
31
31
  total: projectTarball.size,
32
- message: ratio => `Uploading project archive to EAS (${(0, files_1.formatBytes)(projectTarball.size * ratio)} / ${(0, files_1.formatBytes)(projectTarball.size)})`,
32
+ message: ratio => `Uploading project archive to EAS (${(0, eas_build_job_1.formatBytes)(projectTarball.size * ratio)} / ${(0, eas_build_job_1.formatBytes)(projectTarball.size)})`,
33
33
  completedMessage: (duration) => `Uploaded project archive to EAS ${chalk_1.default.dim(duration)}`,
34
34
  }),
35
35
  });
@@ -0,0 +1,6 @@
1
+ export declare function createAppArchiveAsync(value: string, { handleInterrupt }?: {
2
+ handleInterrupt?: boolean;
3
+ }): Promise<{
4
+ path: string;
5
+ cleanupAsync: () => Promise<void>;
6
+ }>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAppArchiveAsync = createAppArchiveAsync;
4
+ const tslib_1 = require("tslib");
5
+ const fs = tslib_1.__importStar(require("fs-extra"));
6
+ const os_1 = tslib_1.__importDefault(require("os"));
7
+ const path_1 = tslib_1.__importDefault(require("path"));
8
+ const tar = tslib_1.__importStar(require("tar"));
9
+ async function createAppArchiveAsync(value, { handleInterrupt = true } = {}) {
10
+ const bundle = await fs.realpath(value);
11
+ // Create and register cleanup in one synchronous turn so an interrupt cannot
12
+ // leave a newly created directory without its exit handler.
13
+ const directory = fs.mkdtempSync(path_1.default.join(os_1.default.tmpdir(), 'eas-simulator-app-'));
14
+ const archive = path_1.default.join(directory, 'app.tar.gz');
15
+ const cleanupOnExit = () => {
16
+ try {
17
+ fs.removeSync(directory);
18
+ }
19
+ catch {
20
+ // Exit cleanup is best effort; do not prevent the interrupted process from stopping.
21
+ }
22
+ };
23
+ const interrupt = () => {
24
+ cleanupOnExit();
25
+ process.exit(130);
26
+ };
27
+ const terminate = () => {
28
+ cleanupOnExit();
29
+ process.exit(143);
30
+ };
31
+ process.once('exit', cleanupOnExit);
32
+ if (handleInterrupt) {
33
+ process.once('SIGINT', interrupt);
34
+ }
35
+ process.once('SIGTERM', terminate);
36
+ const cleanupAsync = async () => {
37
+ try {
38
+ await fs.remove(directory);
39
+ }
40
+ finally {
41
+ process.removeListener('exit', cleanupOnExit);
42
+ process.removeListener('SIGINT', interrupt);
43
+ process.removeListener('SIGTERM', terminate);
44
+ }
45
+ };
46
+ try {
47
+ await tar.create({
48
+ cwd: bundle,
49
+ file: archive,
50
+ prefix: path_1.default.basename(path_1.default.resolve(value)),
51
+ gzip: true,
52
+ portable: true,
53
+ jobs: 1,
54
+ }, ['.']);
55
+ return { path: archive, cleanupAsync };
56
+ }
57
+ catch (error) {
58
+ await cleanupAsync();
59
+ throw error;
60
+ }
61
+ }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasSimulatorArtifacts = hasSimulatorArtifacts;
4
4
  exports.downloadSimulatorArtifactAsync = downloadSimulatorArtifactAsync;
5
5
  const tslib_1 = require("tslib");
6
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
7
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
7
8
  const download_1 = require("./download");
8
9
  const utils_1 = require("./utils");
@@ -10,7 +11,6 @@ const fetch_1 = tslib_1.__importDefault(require("../fetch"));
10
11
  const generated_1 = require("../graphql/generated");
11
12
  const log_1 = tslib_1.__importDefault(require("../log"));
12
13
  const ora_1 = require("../ora");
13
- const files_1 = require("../utils/files");
14
14
  const prompts_1 = require("../prompts");
15
15
  const json_1 = require("../utils/json");
16
16
  function hasSimulatorArtifacts(session) {
@@ -30,7 +30,7 @@ async function downloadSimulatorArtifactAsync(session, type, { artifact: index,
30
30
  const metadata = artifact.metadata;
31
31
  const device = metadata?.deviceName ?? metadata?.udid;
32
32
  const part = metadata?.part;
33
- return (0, utils_1.stripTerminalControlCharacters)(`${i + 1}. ${artifact.name} — ${artifact.filename} (${(0, files_1.formatBytes)(artifact.fileSizeBytes ?? 0)})${device ? ` (${device})` : ''}${part !== undefined ? ` (part ${part})` : ''}`);
33
+ return (0, utils_1.stripTerminalControlCharacters)(`${i + 1}. ${artifact.name} — ${artifact.filename} (${(0, eas_build_job_1.formatBytes)(artifact.fileSizeBytes ?? 0)})${device ? ` (${device})` : ''}${part !== undefined ? ` (part ${part})` : ''}`);
34
34
  });
35
35
  const selectionMessage = `Choose an artifact with --artifact <index>:\n${titles.join('\n')}`;
36
36
  let selectedIndex = index;
@@ -18,6 +18,7 @@ export type PreparedControlAction = Readonly<{
18
18
  localFile?: Readonly<{
19
19
  param: string;
20
20
  path: string;
21
+ appBundle?: true;
21
22
  }>;
22
23
  }>;
23
24
  export declare function resolveControlActionPath(value: string, baseDir?: string): string;
@@ -25,8 +26,13 @@ export declare function prepareControlActionAsync(catalog: HostActionCatalog, ac
25
26
  localFileMode?: 'auto' | 'explicit';
26
27
  baseDir?: string;
27
28
  }): Promise<PreparedControlAction>;
28
- export declare function assertLocalFileAsync(localPath: string, stats?: fs.Stats): Promise<void>;
29
- export declare function executeControlActionAsync(connection: HostActionConnection, plan: PreparedControlAction, { validateParams }?: {
29
+ export declare function assertLocalFileAsync(localPath: string, { action, stats }?: {
30
+ action?: string;
31
+ stats?: fs.Stats;
32
+ }): Promise<fs.Stats>;
33
+ export declare function executeControlActionAsync(connection: HostActionConnection, plan: PreparedControlAction, { validateParams, onProgress, handleInterrupt, }?: {
30
34
  validateParams?: (params: Record<string, unknown>) => void;
35
+ onProgress?: (phase: 'packaging' | 'uploading' | 'running') => void;
36
+ handleInterrupt?: boolean;
31
37
  }): Promise<ControlActionResult>;
32
38
  export declare function parseControlActionOutput(output: string): unknown;