eas-cli 9.0.3 → 9.0.5

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 (224) hide show
  1. package/README.md +59 -59
  2. package/build/analytics/AnalyticsManager.js +4 -5
  3. package/build/api.js +1 -2
  4. package/build/branch/actions/SelectBranch.js +2 -3
  5. package/build/branch/queries.js +3 -5
  6. package/build/branch/utils.js +1 -1
  7. package/build/build/android/build.js +3 -5
  8. package/build/build/android/graphql.js +1 -2
  9. package/build/build/android/prepareJob.js +1 -2
  10. package/build/build/android/syncProjectConfiguration.js +1 -1
  11. package/build/build/android/version.js +14 -16
  12. package/build/build/build.js +8 -10
  13. package/build/build/createContext.js +7 -8
  14. package/build/build/ios/build.js +2 -4
  15. package/build/build/ios/credentials.js +1 -2
  16. package/build/build/ios/graphql.js +4 -6
  17. package/build/build/ios/prepareJob.js +5 -6
  18. package/build/build/ios/syncProjectConfiguration.js +1 -1
  19. package/build/build/ios/version.js +17 -20
  20. package/build/build/local.js +2 -3
  21. package/build/build/metadata.js +9 -10
  22. package/build/build/queries.js +6 -9
  23. package/build/build/runBuildAndSubmit.d.ts +3 -1
  24. package/build/build/runBuildAndSubmit.js +19 -13
  25. package/build/build/utils/appJson.js +1 -2
  26. package/build/build/utils/formatBuild.js +5 -8
  27. package/build/build/utils/printBuildInfo.js +1 -2
  28. package/build/build/utils/resourceClass.js +3 -4
  29. package/build/build/utils/url.js +1 -2
  30. package/build/build/validate.js +8 -11
  31. package/build/channel/actions/SelectChannel.js +2 -3
  32. package/build/channel/errors.js +1 -1
  33. package/build/channel/queries.js +6 -10
  34. package/build/channel/utils.js +1 -1
  35. package/build/commandUtils/EasCommand.js +7 -6
  36. package/build/commandUtils/builds.js +3 -3
  37. package/build/commandUtils/context/DynamicProjectConfigContextField.js +2 -2
  38. package/build/commandUtils/context/LoggedInContextField.js +1 -2
  39. package/build/commandUtils/context/MaybeLoggedInContextField.js +2 -3
  40. package/build/commandUtils/context/VcsClientContextField.js +1 -1
  41. package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
  42. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +4 -6
  43. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +2 -4
  44. package/build/commandUtils/gating/FeatureGateEnvOverrides.js +1 -2
  45. package/build/commandUtils/pagination.js +3 -4
  46. package/build/commands/account/view.js +1 -2
  47. package/build/commands/branch/delete.js +1 -2
  48. package/build/commands/build/configure.js +1 -2
  49. package/build/commands/build/index.js +1 -2
  50. package/build/commands/build/internal.js +1 -2
  51. package/build/commands/build/resign.js +7 -7
  52. package/build/commands/build/run.js +2 -3
  53. package/build/commands/build/version/get.js +3 -4
  54. package/build/commands/build/version/set.js +5 -6
  55. package/build/commands/build/version/sync.js +5 -7
  56. package/build/commands/channel/rollout.js +1 -2
  57. package/build/commands/config.js +16 -14
  58. package/build/commands/credentials/configure-build.js +3 -3
  59. package/build/commands/credentials/index.js +1 -1
  60. package/build/commands/device/create.js +1 -1
  61. package/build/commands/device/rename.js +1 -1
  62. package/build/commands/diagnostics.js +6 -2
  63. package/build/commands/project/init.js +11 -9
  64. package/build/commands/project/onboarding.js +192 -20
  65. package/build/commands/secret/delete.js +5 -5
  66. package/build/commands/update/index.js +5 -6
  67. package/build/commands/update/republish.js +1 -2
  68. package/build/commands/update/roll-back-to-embedded.js +3 -4
  69. package/build/credentials/android/AndroidCredentialsProvider.js +4 -5
  70. package/build/credentials/android/actions/BuildCredentialsUtils.js +2 -3
  71. package/build/credentials/android/actions/DownloadKeystore.js +2 -3
  72. package/build/credentials/android/actions/RemoveFcm.js +1 -1
  73. package/build/credentials/android/actions/SetUpBuildCredentials.js +3 -5
  74. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.js +3 -3
  75. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.js +3 -3
  76. package/build/credentials/android/api/GraphqlClient.js +4 -8
  77. package/build/credentials/android/api/graphql/queries/AndroidAppCredentialsQuery.js +1 -2
  78. package/build/credentials/android/utils/printCredentials.js +4 -4
  79. package/build/credentials/context.js +2 -3
  80. package/build/credentials/credentialsJson/update.js +14 -16
  81. package/build/credentials/errors.js +7 -5
  82. package/build/credentials/ios/IosCredentialsProvider.js +3 -4
  83. package/build/credentials/ios/actions/AscApiKeyUtils.js +5 -9
  84. package/build/credentials/ios/actions/AssignAscApiKey.js +2 -3
  85. package/build/credentials/ios/actions/AssignPushKey.js +2 -3
  86. package/build/credentials/ios/actions/BuildCredentialsUtils.js +3 -5
  87. package/build/credentials/ios/actions/ConfigureProvisioningProfile.js +1 -1
  88. package/build/credentials/ios/actions/CreateProvisioningProfile.js +2 -3
  89. package/build/credentials/ios/actions/DistributionCertificateUtils.js +3 -4
  90. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +2 -3
  91. package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
  92. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +3 -4
  93. package/build/credentials/ios/actions/SetUpAscApiKey.js +1 -1
  94. package/build/credentials/ios/actions/SetUpBuildCredentials.js +3 -4
  95. package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -2
  96. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +2 -3
  97. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.js +2 -3
  98. package/build/credentials/ios/api/GraphqlClient.js +11 -15
  99. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +2 -2
  100. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +2 -2
  101. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +2 -4
  102. package/build/credentials/ios/api/graphql/queries/IosAppBuildCredentialsQuery.js +1 -2
  103. package/build/credentials/ios/api/graphql/queries/IosAppCredentialsQuery.js +2 -4
  104. package/build/credentials/ios/appstore/AppStoreApi.js +1 -2
  105. package/build/credentials/ios/appstore/ascApiKey.js +6 -8
  106. package/build/credentials/ios/appstore/authenticate.js +2 -4
  107. package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
  108. package/build/credentials/ios/appstore/contractMessages.js +3 -5
  109. package/build/credentials/ios/appstore/distributionCertificate.js +2 -3
  110. package/build/credentials/ios/appstore/ensureAppExists.js +1 -2
  111. package/build/credentials/ios/appstore/provisioningProfileAdhoc.js +5 -7
  112. package/build/credentials/ios/appstore/pushKey.js +2 -3
  113. package/build/credentials/ios/appstore/resolveCredentials.js +8 -9
  114. package/build/credentials/ios/errors.js +1 -1
  115. package/build/credentials/ios/utils/p12Certificate.js +1 -2
  116. package/build/credentials/ios/utils/provisioningProfile.js +1 -2
  117. package/build/credentials/ios/validators/validateProvisioningProfile.js +5 -7
  118. package/build/credentials/manager/ManageAndroid.js +2 -2
  119. package/build/credentials/manager/ManageIos.js +3 -4
  120. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -2
  121. package/build/credentials/manager/SetDefaultAndroidKeystore.js +1 -1
  122. package/build/credentials/manager/SetUpAndroidBuildCredentials.js +2 -2
  123. package/build/credentials/manager/SetUpIosBuildCredentials.js +2 -2
  124. package/build/credentials/utils/promptForCredentials.js +2 -3
  125. package/build/devices/actions/create/currentMachineMethod.js +4 -5
  126. package/build/devices/actions/create/developerPortalMethod.js +1 -2
  127. package/build/devices/actions/create/inputMethod.js +1 -1
  128. package/build/devices/context.js +1 -1
  129. package/build/devices/queries.js +3 -6
  130. package/build/devices/utils/errors.js +2 -2
  131. package/build/devices/utils/formatDevice.js +4 -6
  132. package/build/graphql/client.js +5 -8
  133. package/build/graphql/generated.d.ts +42 -0
  134. package/build/graphql/mutations/AppMutation.js +1 -2
  135. package/build/graphql/mutations/AppVersionMutation.js +1 -2
  136. package/build/graphql/mutations/BuildMutation.js +4 -8
  137. package/build/graphql/mutations/UserPreferencesMutation.js +2 -3
  138. package/build/graphql/queries/AppVersionQuery.js +1 -2
  139. package/build/graphql/queries/BranchQuery.js +1 -2
  140. package/build/graphql/queries/BuildQuery.js +1 -2
  141. package/build/graphql/queries/EnvironmentSecretsQuery.js +2 -3
  142. package/build/graphql/queries/SubmissionQuery.js +1 -2
  143. package/build/graphql/queries/WebhookQuery.js +1 -2
  144. package/build/graphql/types/App.js +1 -0
  145. package/build/log.js +2 -2
  146. package/build/metadata/apple/config/reader.js +26 -32
  147. package/build/metadata/apple/config/writer.js +35 -39
  148. package/build/metadata/apple/rules/infoKeywordLength.js +2 -4
  149. package/build/metadata/apple/rules/infoRestrictedWords.js +2 -4
  150. package/build/metadata/apple/tasks/app-review-detail.js +1 -2
  151. package/build/metadata/apple/tasks/app-version.js +6 -8
  152. package/build/metadata/auth.js +1 -2
  153. package/build/metadata/config/resolve.js +2 -3
  154. package/build/metadata/config/validate.js +2 -4
  155. package/build/metadata/errors.js +3 -5
  156. package/build/metadata/upload.js +1 -2
  157. package/build/metadata/utils/retry.js +1 -2
  158. package/build/metadata/utils/telemetry.js +8 -11
  159. package/build/onboarding/runCommand.js +2 -2
  160. package/build/ora.js +1 -1
  161. package/build/project/android/applicationId.js +3 -4
  162. package/build/project/android/gradle.js +3 -4
  163. package/build/project/android/gradleUtils.js +4 -5
  164. package/build/project/expoConfig.js +3 -4
  165. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
  166. package/build/project/ios/bundleIdentifier.js +7 -8
  167. package/build/project/ios/entitlements.js +1 -2
  168. package/build/project/ios/scheme.js +7 -6
  169. package/build/project/ios/target.js +17 -23
  170. package/build/project/metroConfig.js +1 -2
  171. package/build/project/projectUtils.js +5 -7
  172. package/build/project/publish.js +18 -27
  173. package/build/project/remoteVersionSource.js +6 -7
  174. package/build/project/resolveRuntimeVersionAsync.d.ts +2 -1
  175. package/build/project/resolveRuntimeVersionAsync.js +3 -4
  176. package/build/prompts.js +5 -7
  177. package/build/rollout/actions/CreateRollout.js +4 -5
  178. package/build/rollout/actions/EditRollout.js +1 -2
  179. package/build/rollout/actions/EndRollout.js +2 -4
  180. package/build/rollout/actions/ManageRollout.js +1 -2
  181. package/build/rollout/actions/NonInteractiveRollout.js +1 -2
  182. package/build/rollout/actions/SelectRuntime.js +2 -4
  183. package/build/rollout/utils.js +4 -5
  184. package/build/run/android/adb.js +4 -7
  185. package/build/run/ios/xcode.js +1 -2
  186. package/build/run/ios/xcrun.js +1 -2
  187. package/build/run/utils.js +2 -4
  188. package/build/submit/ArchiveSource.js +1 -1
  189. package/build/submit/android/AndroidSubmitCommand.js +3 -5
  190. package/build/submit/android/AndroidSubmitter.js +3 -3
  191. package/build/submit/android/ServiceAccountSource.js +1 -2
  192. package/build/submit/ios/AppProduce.js +5 -4
  193. package/build/submit/ios/AppSpecificPasswordSource.js +2 -2
  194. package/build/submit/ios/AscApiKeySource.js +5 -3
  195. package/build/submit/ios/IosSubmitCommand.js +2 -3
  196. package/build/submit/ios/IosSubmitter.js +1 -1
  197. package/build/submit/ios/utils/language.js +3 -4
  198. package/build/submit/submit.js +2 -3
  199. package/build/submit/utils/errors.js +1 -2
  200. package/build/submit/utils/wait.js +1 -1
  201. package/build/update/android/UpdatesModule.js +1 -2
  202. package/build/update/configure.js +11 -14
  203. package/build/update/ios/UpdatesModule.js +2 -4
  204. package/build/update/queries.js +6 -10
  205. package/build/update/utils.js +28 -39
  206. package/build/user/SessionManager.js +5 -8
  207. package/build/user/User.js +2 -2
  208. package/build/user/expoSsoLauncher.js +1 -2
  209. package/build/utils/code-signing.js +4 -7
  210. package/build/utils/expoCli.js +1 -2
  211. package/build/utils/expoUpdatesCli.d.ts +1 -0
  212. package/build/utils/expoUpdatesCli.js +3 -2
  213. package/build/utils/profiles.js +3 -3
  214. package/build/utils/progress.js +2 -2
  215. package/build/utils/relay.js +10 -14
  216. package/build/utils/timer.js +1 -2
  217. package/build/vcs/clients/git.d.ts +1 -1
  218. package/build/vcs/clients/git.js +24 -20
  219. package/build/vcs/git.d.ts +1 -1
  220. package/build/vcs/git.js +4 -2
  221. package/build/vcs/local.js +1 -2
  222. package/build/webhooks/input.js +2 -2
  223. package/oclif.manifest.json +1 -1
  224. package/package.json +3 -3
@@ -47,8 +47,7 @@ exports.MetadataJoi = joi_1.default.object({
47
47
  }).required(),
48
48
  }).required();
49
49
  function guessContentTypeFromExtension(ext) {
50
- var _a;
51
- return (_a = mime_1.default.getType(ext !== null && ext !== void 0 ? ext : '')) !== null && _a !== void 0 ? _a : 'application/octet-stream'; // unrecognized extension
50
+ return mime_1.default.getType(ext ?? '') ?? 'application/octet-stream'; // unrecognized extension
52
51
  }
53
52
  exports.guessContentTypeFromExtension = guessContentTypeFromExtension;
54
53
  function getBase64URLEncoding(buffer) {
@@ -103,13 +102,12 @@ exports.convertAssetToUpdateInfoGroupFormatAsync = convertAssetToUpdateInfoGroup
103
102
  * This will be sorted later based on the platform's runtime versions.
104
103
  */
105
104
  async function buildUnsortedUpdateInfoGroupAsync(assets, exp) {
106
- var _a, _b, _c;
107
105
  let platform;
108
106
  const updateInfoGroup = {};
109
107
  for (platform in assets) {
110
108
  updateInfoGroup[platform] = {
111
- launchAsset: await convertAssetToUpdateInfoGroupFormatAsync((_a = assets[platform]) === null || _a === void 0 ? void 0 : _a.launchAsset),
112
- assets: await Promise.all(((_c = (_b = assets[platform]) === null || _b === void 0 ? void 0 : _b.assets) !== null && _c !== void 0 ? _c : []).map(convertAssetToUpdateInfoGroupFormatAsync)),
109
+ launchAsset: await convertAssetToUpdateInfoGroupFormatAsync(assets[platform]?.launchAsset),
110
+ assets: await Promise.all((assets[platform]?.assets ?? []).map(convertAssetToUpdateInfoGroupFormatAsync)),
113
111
  extra: {
114
112
  expoClient: exp,
115
113
  },
@@ -119,7 +117,6 @@ async function buildUnsortedUpdateInfoGroupAsync(assets, exp) {
119
117
  }
120
118
  exports.buildUnsortedUpdateInfoGroupAsync = buildUnsortedUpdateInfoGroupAsync;
121
119
  async function buildBundlesAsync({ projectDir, inputDir, exp, platformFlag, clearCache, }) {
122
- var _a;
123
120
  const packageJSON = json_file_1.default.read(path_1.default.resolve(projectDir, 'package.json'));
124
121
  if (!packageJSON) {
125
122
  throw new Error('Could not locate package.json');
@@ -157,7 +154,7 @@ async function buildBundlesAsync({ projectDir, inputDir, exp, platformFlag, clea
157
154
  // Versioned Expo CLI, without multiple platform flag support
158
155
  // Warn users about potential export issues when using Metro web
159
156
  // See: https://github.com/expo/expo/pull/23621
160
- if (((_a = exp.web) === null || _a === void 0 ? void 0 : _a.bundler) === 'metro') {
157
+ if (exp.web?.bundler === 'metro') {
161
158
  log_1.default.warn('Exporting bundle for all platforms, including Metro web.');
162
159
  log_1.default.warn('If your app is incompatible with web, remove the "expo.web.bundler" property from your app manifest, or upgrade to the latest Expo SDK.');
163
160
  }
@@ -230,9 +227,8 @@ async function loadAssetMapAsync(distRoot) {
230
227
  exports.loadAssetMapAsync = loadAssetMapAsync;
231
228
  // exposed for testing
232
229
  function getAssetHashFromPath(assetPath) {
233
- var _a;
234
- const [, hash] = (_a = assetPath.match(new RegExp(/assets\/([a-z0-9]+)$/, 'i'))) !== null && _a !== void 0 ? _a : [];
235
- return hash !== null && hash !== void 0 ? hash : null;
230
+ const [, hash] = assetPath.match(new RegExp(/assets\/([a-z0-9]+)$/, 'i')) ?? [];
231
+ return hash ?? null;
236
232
  }
237
233
  exports.getAssetHashFromPath = getAssetHashFromPath;
238
234
  // exposed for testing
@@ -261,15 +257,12 @@ async function collectAssetsAsync(dir) {
261
257
  contentType: 'application/javascript',
262
258
  path: path_1.default.resolve(dir, metadata.fileMetadata[platform].bundle),
263
259
  },
264
- assets: metadata.fileMetadata[platform].assets.map(asset => {
265
- var _a;
266
- return ({
267
- fileExtension: asset.ext ? ensureLeadingPeriod(asset.ext) : undefined,
268
- originalPath: (_a = getOriginalPathFromAssetMap(assetmap, asset)) !== null && _a !== void 0 ? _a : undefined,
269
- contentType: guessContentTypeFromExtension(asset.ext),
270
- path: path_1.default.join(dir, asset.path),
271
- });
272
- }),
260
+ assets: metadata.fileMetadata[platform].assets.map(asset => ({
261
+ fileExtension: asset.ext ? ensureLeadingPeriod(asset.ext) : undefined,
262
+ originalPath: getOriginalPathFromAssetMap(assetmap, asset) ?? undefined,
263
+ contentType: guessContentTypeFromExtension(asset.ext),
264
+ path: path_1.default.join(dir, asset.path),
265
+ })),
273
266
  };
274
267
  }
275
268
  return collectedAssets;
@@ -309,7 +302,7 @@ async function uploadAssetsAsync(graphqlClient, assetsForUpdateInfoGroup, projec
309
302
  };
310
303
  }));
311
304
  const uniqueAssets = (0, uniqBy_1.default)(assetsWithStorageKey, asset => asset.storageKey);
312
- onAssetUploadResultsChanged === null || onAssetUploadResultsChanged === void 0 ? void 0 : onAssetUploadResultsChanged(uniqueAssets.map(asset => ({ asset, finished: false })));
305
+ onAssetUploadResultsChanged?.(uniqueAssets.map(asset => ({ asset, finished: false })));
313
306
  let missingAssets = await filterOutAssetsThatAlreadyExistAsync(graphqlClient, uniqueAssets);
314
307
  let missingAssetStorageKeys = new Set(missingAssets.map(a => a.storageKey));
315
308
  const uniqueUploadedAssetCount = missingAssets.length;
@@ -323,7 +316,7 @@ async function uploadAssetsAsync(graphqlClient, assetsForUpdateInfoGroup, projec
323
316
  const { specifications: chunkSpecifications } = await PublishMutation_1.PublishMutation.getUploadURLsAsync(graphqlClient, missingAssets.map(ma => ma.contentType));
324
317
  specifications.push(...chunkSpecifications);
325
318
  }
326
- onAssetUploadResultsChanged === null || onAssetUploadResultsChanged === void 0 ? void 0 : onAssetUploadResultsChanged(uniqueAssets.map(asset => ({ asset, finished: !missingAssetStorageKeys.has(asset.storageKey) })));
319
+ onAssetUploadResultsChanged?.(uniqueAssets.map(asset => ({ asset, finished: !missingAssetStorageKeys.has(asset.storageKey) })));
327
320
  const assetUploadPromiseLimit = (0, promise_limit_1.default)(15);
328
321
  const [assetLimitPerUpdateGroup] = await Promise.all([
329
322
  PublishQuery_1.PublishQuery.getAssetLimitPerUpdateGroupAsync(graphqlClient, projectId),
@@ -347,7 +340,7 @@ async function uploadAssetsAsync(graphqlClient, assetsForUpdateInfoGroup, projec
347
340
  missingAssetStorageKeys = new Set(missingAssets.map(a => a.storageKey));
348
341
  await timeoutPromise; // await after filterOutAssetsThatAlreadyExistAsync for easy mocking with jest.runAllTimers
349
342
  timeout += 1;
350
- onAssetUploadResultsChanged === null || onAssetUploadResultsChanged === void 0 ? void 0 : onAssetUploadResultsChanged(uniqueAssets.map(asset => ({
343
+ onAssetUploadResultsChanged?.(uniqueAssets.map(asset => ({
351
344
  asset,
352
345
  finished: !missingAssetStorageKeys.has(asset.storageKey),
353
346
  })));
@@ -414,10 +407,9 @@ async function getBranchNameForCommandAsync({ graphqlClient, projectId, channelN
414
407
  }
415
408
  exports.getBranchNameForCommandAsync = getBranchNameForCommandAsync;
416
409
  async function getUpdateMessageForCommandAsync(vcsClient, { updateMessageArg, autoFlag, nonInteractive, jsonFlag, }) {
417
- var _a, _b;
418
410
  let updateMessage = updateMessageArg;
419
411
  if (!updateMessageArg && autoFlag) {
420
- updateMessage = (_a = (await vcsClient.getLastCommitMessageAsync())) === null || _a === void 0 ? void 0 : _a.trim();
412
+ updateMessage = (await vcsClient.getLastCommitMessageAsync())?.trim();
421
413
  }
422
414
  if (!updateMessage) {
423
415
  if (nonInteractive || jsonFlag) {
@@ -430,7 +422,7 @@ async function getUpdateMessageForCommandAsync(vcsClient, { updateMessageArg, au
430
422
  type: 'text',
431
423
  name: 'updateMessageLocal',
432
424
  message: `Provide an update message:`,
433
- initial: (_b = (await vcsClient.getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim(),
425
+ initial: (await vcsClient.getLastCommitMessageAsync())?.trim(),
434
426
  });
435
427
  if (!updateMessageLocal) {
436
428
  return undefined;
@@ -480,7 +472,6 @@ async function getRuntimeVersionObjectAsync({ exp, platforms, workflows, project
480
472
  }
481
473
  exports.getRuntimeVersionObjectAsync = getRuntimeVersionObjectAsync;
482
474
  async function getRuntimeVersionForPlatformAsync({ exp, platform, workflow, projectDir, env, }) {
483
- var _a, _b;
484
475
  if (platform === 'web') {
485
476
  return 'UNVERSIONED';
486
477
  }
@@ -502,7 +493,7 @@ async function getRuntimeVersionForPlatformAsync({ exp, platform, workflow, proj
502
493
  }
503
494
  }
504
495
  }
505
- const runtimeVersion = (_b = (_a = exp[platform]) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion;
496
+ const runtimeVersion = exp[platform]?.runtimeVersion ?? exp.runtimeVersion;
506
497
  if (typeof runtimeVersion === 'object') {
507
498
  if (workflow !== eas_build_job_1.Workflow.MANAGED) {
508
499
  throw new Error(`You're currently using the bare workflow, where runtime version policies are not supported. You must set your runtime version manually. For example, define your runtime version as "1.0.0", not {"policy": "appVersion"} in your app config. ${(0, log_1.learnMore)('https://docs.expo.dev/eas-update/runtime-versions')}`);
@@ -9,7 +9,7 @@ const log_1 = tslib_1.__importDefault(require("../log"));
9
9
  const prompts_1 = require("../prompts");
10
10
  async function ensureVersionSourceIsRemoteAsync(easJsonAccessor, { nonInteractive }) {
11
11
  const easJsonCliConfig = await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor);
12
- if ((easJsonCliConfig === null || easJsonCliConfig === void 0 ? void 0 : easJsonCliConfig.appVersionSource) === eas_json_1.AppVersionSource.REMOTE) {
12
+ if (easJsonCliConfig?.appVersionSource === eas_json_1.AppVersionSource.REMOTE) {
13
13
  return;
14
14
  }
15
15
  if (nonInteractive) {
@@ -25,7 +25,7 @@ async function ensureVersionSourceIsRemoteAsync(easJsonAccessor, { nonInteractiv
25
25
  }
26
26
  await easJsonAccessor.readRawJsonAsync();
27
27
  easJsonAccessor.patch(easJsonRawObject => {
28
- easJsonRawObject.cli = { ...easJsonRawObject === null || easJsonRawObject === void 0 ? void 0 : easJsonRawObject.cli, appVersionSource: eas_json_1.AppVersionSource.REMOTE };
28
+ easJsonRawObject.cli = { ...easJsonRawObject?.cli, appVersionSource: eas_json_1.AppVersionSource.REMOTE };
29
29
  return easJsonRawObject;
30
30
  });
31
31
  await easJsonAccessor.writeAsync();
@@ -33,7 +33,7 @@ async function ensureVersionSourceIsRemoteAsync(easJsonAccessor, { nonInteractiv
33
33
  }
34
34
  exports.ensureVersionSourceIsRemoteAsync = ensureVersionSourceIsRemoteAsync;
35
35
  function validateBuildProfileVersionSettings(profileInfo, cliConfig) {
36
- if ((cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.appVersionSource) !== eas_json_1.AppVersionSource.REMOTE) {
36
+ if (cliConfig?.appVersionSource !== eas_json_1.AppVersionSource.REMOTE) {
37
37
  return;
38
38
  }
39
39
  if (profileInfo.profile.autoIncrement === 'version') {
@@ -42,14 +42,13 @@ function validateBuildProfileVersionSettings(profileInfo, cliConfig) {
42
42
  }
43
43
  exports.validateBuildProfileVersionSettings = validateBuildProfileVersionSettings;
44
44
  function validateAppConfigForRemoteVersionSource(exp, platform) {
45
- var _a, _b, _c;
46
- if (typeof exp.runtimeVersion === 'object' && ((_a = exp.runtimeVersion) === null || _a === void 0 ? void 0 : _a.policy) === 'nativeVersion') {
45
+ if (typeof exp.runtimeVersion === 'object' && exp.runtimeVersion?.policy === 'nativeVersion') {
47
46
  throw new Error(`${chalk_1.default.bold('nativeVersion')} policy for ${chalk_1.default.bold('runtimeVersion')} is currently not supported when version source is set to remote. Switch policy e.g. to ${chalk_1.default.bold('appVersion')} or define version explicitly.`);
48
47
  }
49
- if (platform === eas_build_job_1.Platform.IOS && ((_b = exp.ios) === null || _b === void 0 ? void 0 : _b.buildNumber) !== undefined) {
48
+ if (platform === eas_build_job_1.Platform.IOS && exp.ios?.buildNumber !== undefined) {
50
49
  log_1.default.warn(`${chalk_1.default.bold('ios.buildNumber')} field in app config is ignored when version source is set to remote, but this value will still be in the manifest available via ${chalk_1.default.bold('expo-constants')}. It's recommended to remove this value from app config.`);
51
50
  }
52
- if (platform === eas_build_job_1.Platform.ANDROID && ((_c = exp.android) === null || _c === void 0 ? void 0 : _c.versionCode) !== undefined) {
51
+ if (platform === eas_build_job_1.Platform.ANDROID && exp.android?.versionCode !== undefined) {
53
52
  log_1.default.warn(`${chalk_1.default.bold('android.versionCode')} field in app config is ignored when version source is set to remote, but this value will still be in the manifest available via ${chalk_1.default.bold('expo-constants')}. It's recommended to remove this value from app config.`);
54
53
  }
55
54
  }
@@ -1,9 +1,10 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Env, Workflow } from '@expo/eas-build-job';
3
- export declare function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, env, }: {
3
+ export declare function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, env, cwd, }: {
4
4
  exp: ExpoConfig;
5
5
  platform: 'ios' | 'android';
6
6
  workflow: Workflow;
7
7
  projectDir: string;
8
8
  env: Env | undefined;
9
+ cwd?: string;
9
10
  }): Promise<string | null>;
@@ -6,8 +6,7 @@ const config_plugins_1 = require("@expo/config-plugins");
6
6
  const projectUtils_1 = require("./projectUtils");
7
7
  const log_1 = tslib_1.__importDefault(require("../log"));
8
8
  const expoUpdatesCli_1 = require("../utils/expoUpdatesCli");
9
- async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, env, }) {
10
- var _a;
9
+ async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir, env, cwd, }) {
11
10
  if (!(await (0, projectUtils_1.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync)(projectDir))) {
12
11
  // fall back to the previous behavior (using the @expo/config-plugins eas-cli dependency rather
13
12
  // than the versioned @expo/config-plugins dependency in the project)
@@ -16,11 +15,11 @@ async function resolveRuntimeVersionAsync({ exp, platform, workflow, projectDir,
16
15
  try {
17
16
  log_1.default.debug('Using expo-updates runtimeversion:resolve CLI for runtime version resolution');
18
17
  const extraArgs = log_1.default.isDebug ? ['--debug'] : [];
19
- const resolvedRuntimeVersionJSONResult = await (0, expoUpdatesCli_1.expoUpdatesCommandAsync)(projectDir, ['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs], { env });
18
+ const resolvedRuntimeVersionJSONResult = await (0, expoUpdatesCli_1.expoUpdatesCommandAsync)(projectDir, ['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs], { env, cwd });
20
19
  const runtimeVersionResult = JSON.parse(resolvedRuntimeVersionJSONResult);
21
20
  log_1.default.debug('runtimeversion:resolve output:');
22
21
  log_1.default.debug(resolvedRuntimeVersionJSONResult);
23
- return (_a = runtimeVersionResult.runtimeVersion) !== null && _a !== void 0 ? _a : null;
22
+ return runtimeVersionResult.runtimeVersion ?? null;
24
23
  }
25
24
  catch (e) {
26
25
  // if expo-updates is not installed, there's no need for a runtime version in the build
package/build/prompts.js CHANGED
@@ -9,9 +9,8 @@ if (prompts_1.prompts) {
9
9
  prompts_1.prompts.multiselect = easMultiselect_1.easMultiselect;
10
10
  }
11
11
  async function promptAsync(questions, options = {}) {
12
- var _a;
13
12
  if (!process.stdin.isTTY && !global.test) {
14
- const message = Array.isArray(questions) ? (_a = questions[0]) === null || _a === void 0 ? void 0 : _a.message : questions.message;
13
+ const message = Array.isArray(questions) ? questions[0]?.message : questions.message;
15
14
  throw new Error(`Input is required, but stdin is not readable. Failed to display prompt: ${message}`);
16
15
  }
17
16
  return await (0, prompts_1.default)(questions, {
@@ -33,15 +32,14 @@ async function confirmAsync(question, options) {
33
32
  }
34
33
  exports.confirmAsync = confirmAsync;
35
34
  async function selectAsync(message, choices, config) {
36
- var _a;
37
35
  const { value } = await promptAsync({
38
36
  message,
39
37
  choices,
40
38
  name: 'value',
41
39
  type: 'select',
42
- warn: config === null || config === void 0 ? void 0 : config.warningMessageForDisabledEntries,
43
- }, (_a = config === null || config === void 0 ? void 0 : config.options) !== null && _a !== void 0 ? _a : {});
44
- return value !== null && value !== void 0 ? value : null;
40
+ warn: config?.warningMessageForDisabledEntries,
41
+ }, config?.options ?? {});
42
+ return value ?? null;
45
43
  }
46
44
  exports.selectAsync = selectAsync;
47
45
  /**
@@ -58,7 +56,7 @@ async function toggleConfirmAsync(questions, options) {
58
56
  name: 'value',
59
57
  type: 'toggle',
60
58
  }, options);
61
- return value !== null && value !== void 0 ? value : null;
59
+ return value ?? null;
62
60
  }
63
61
  exports.toggleConfirmAsync = toggleConfirmAsync;
64
62
  async function pressAnyKeyToContinueAsync() {
@@ -33,7 +33,6 @@ class CreateRollout {
33
33
  this.options = options;
34
34
  }
35
35
  async runAsync(ctx) {
36
- var _a, _b;
37
36
  const { branchNameToRollout } = this.options;
38
37
  const { nonInteractive, graphqlClient } = ctx;
39
38
  if (nonInteractive) {
@@ -55,10 +54,11 @@ class CreateRollout {
55
54
  if (branchInfoToRollout.id === defaultBranchId) {
56
55
  throw new Error(`Channel ${this.channelInfo.name} is already mapped to branch ${branchInfoToRollout.name}.`);
57
56
  }
58
- const runtimeVersion = (_a = this.options.runtimeVersion) !== null && _a !== void 0 ? _a : (await this.selectRuntimeVersionAsync(ctx, branchInfoToRollout, defaultBranchId));
57
+ const runtimeVersion = this.options.runtimeVersion ??
58
+ (await this.selectRuntimeVersionAsync(ctx, branchInfoToRollout, defaultBranchId));
59
59
  log_1.default.newLine();
60
60
  const promptMessage = `What percent of users should be rolled out to branch ${branchInfoToRollout.name}?`;
61
- const percent = (_b = this.options.percent) !== null && _b !== void 0 ? _b : (await (0, utils_2.promptForRolloutPercentAsync)({ promptMessage }));
61
+ const percent = this.options.percent ?? (await (0, utils_2.promptForRolloutPercentAsync)({ promptMessage }));
62
62
  const rolloutBranchMapping = (0, branch_mapping_2.createRolloutBranchMapping)({
63
63
  defaultBranchId,
64
64
  rolloutBranchId: branchInfoToRollout.id,
@@ -107,7 +107,6 @@ class CreateRollout {
107
107
  });
108
108
  }
109
109
  async getLatestUpdateGroupOnBranchAsync(ctx, branchInfo, runtimeVersion) {
110
- var _a;
111
110
  const { graphqlClient, app } = ctx;
112
111
  const { projectId } = app;
113
112
  const updateGroups = await UpdateQuery_1.UpdateQuery.viewUpdateGroupsOnBranchAsync(graphqlClient, {
@@ -120,7 +119,7 @@ class CreateRollout {
120
119
  },
121
120
  });
122
121
  (0, assert_1.default)(updateGroups.length < 2, `Expected at most one update group. Received: ${JSON.stringify(updateGroups)}`);
123
- return (_a = updateGroups[0]) !== null && _a !== void 0 ? _a : null;
122
+ return updateGroups[0] ?? null;
124
123
  }
125
124
  async selectRuntimeVersionAsync(ctx, branchToRollout, defaultBranchId) {
126
125
  const { graphqlClient, app } = ctx;
@@ -25,7 +25,6 @@ class EditRollout {
25
25
  this.options = options;
26
26
  }
27
27
  async runAsync(ctx) {
28
- var _a;
29
28
  const { nonInteractive, graphqlClient } = ctx;
30
29
  if (nonInteractive) {
31
30
  assertNonInteractiveOptions(this.options);
@@ -34,7 +33,7 @@ class EditRollout {
34
33
  const rollout = (0, branch_mapping_1.getRollout)(channelObject);
35
34
  const { rolledOutBranch, defaultBranch } = rollout;
36
35
  const promptMessage = `What percent of users should be rolled out to the ${rolledOutBranch.name} branch ?`;
37
- const percent = (_a = this.options.percent) !== null && _a !== void 0 ? _a : (await (0, utils_1.promptForRolloutPercentAsync)({ promptMessage }));
36
+ const percent = this.options.percent ?? (await (0, utils_1.promptForRolloutPercentAsync)({ promptMessage }));
38
37
  if (percent === 0 || percent === 100) {
39
38
  log_1.default.warn(`Editing the percent to ${percent} will not end the rollout. You'll need to end the rollout from the main menu.`);
40
39
  }
@@ -34,7 +34,6 @@ class EndRollout {
34
34
  this.options = options;
35
35
  }
36
36
  async runAsync(ctx) {
37
- var _a;
38
37
  const { nonInteractive } = ctx;
39
38
  if (nonInteractive) {
40
39
  assertNonInteractiveOptions(this.options);
@@ -50,7 +49,7 @@ class EndRollout {
50
49
  outcome = EndOutcome.REVERT;
51
50
  }
52
51
  else {
53
- outcome = (_a = this.options.outcome) !== null && _a !== void 0 ? _a : (await this.selectOutcomeAsync(rollout));
52
+ outcome = this.options.outcome ?? (await this.selectOutcomeAsync(rollout));
54
53
  }
55
54
  const didConfirm = await this.confirmOutcomeAsync(ctx, outcome, rollout);
56
55
  if (!didConfirm) {
@@ -103,12 +102,11 @@ class EndRollout {
103
102
  return selectedOutcome;
104
103
  }
105
104
  async performOutcomeAsync(ctx, rollout, outcome) {
106
- var _a;
107
105
  const { graphqlClient, app } = ctx;
108
106
  const { rolledOutBranch, defaultBranch } = rollout;
109
107
  const rolledOutUpdateGroup = rolledOutBranch.updateGroups[0];
110
108
  if (outcome === EndOutcome.REPUBLISH_AND_REVERT) {
111
- const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(ctx.app.exp, (_a = this.options.privateKeyPath) !== null && _a !== void 0 ? _a : undefined);
109
+ const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(ctx.app.exp, this.options.privateKeyPath ?? undefined);
112
110
  const arbitraryUpdate = rolledOutUpdateGroup[0];
113
111
  const { message: oldUpdateMessage, group: oldGroupId } = arbitraryUpdate;
114
112
  const newUpdateMessage = `Republish "${oldUpdateMessage}" - group: ${oldGroupId}`;
@@ -26,14 +26,13 @@ class ManageRollout {
26
26
  this.options = options;
27
27
  }
28
28
  async runAsync(ctx) {
29
- var _a;
30
29
  const { nonInteractive } = ctx;
31
30
  if (nonInteractive) {
32
31
  throw new Error(`rollout selection cannot be run in non-interactive mode.`);
33
32
  }
34
33
  const channelObject = await this.getChannelObjectAsync(ctx);
35
34
  (0, utils_1.printRollout)(channelObject);
36
- const action = (_a = this.options.action) !== null && _a !== void 0 ? _a : (await this.selectActionAsync());
35
+ const action = this.options.action ?? (await this.selectActionAsync());
37
36
  switch (action) {
38
37
  case ManageRolloutActions.EDIT:
39
38
  return new EditRollout_1.EditRollout(this.channelInfo, this.options);
@@ -83,13 +83,12 @@ class NonInteractiveRollout {
83
83
  };
84
84
  }
85
85
  async getRolloutJsonAsync(channelObject) {
86
- var _a;
87
86
  const rollout = (0, branch_mapping_1.getRollout)(channelObject);
88
87
  return {
89
88
  defaultBranch: rollout.defaultBranch,
90
89
  rolledOutBranch: rollout.rolledOutBranch,
91
90
  percentRolledOut: rollout.percentRolledOut,
92
- runtimeVersion: (_a = this.getRuntimeVersion(channelObject)) !== null && _a !== void 0 ? _a : undefined,
91
+ runtimeVersion: this.getRuntimeVersion(channelObject) ?? undefined,
93
92
  updatedAt: channelObject.updatedAt,
94
93
  };
95
94
  }
@@ -37,7 +37,6 @@ class SelectRuntime {
37
37
  return `🕵️ Not finding the update you were looking for? ${(0, log_1.learnMore)('https://expo.fyi/eas-update-rollouts')}`;
38
38
  }
39
39
  async runAsync(ctx) {
40
- var _a;
41
40
  const { nonInteractive, graphqlClient, app } = ctx;
42
41
  const { projectId } = app;
43
42
  if (nonInteractive) {
@@ -46,7 +45,7 @@ class SelectRuntime {
46
45
  const newestRuntimeConnection = await this.getNewestRuntimeAsync(graphqlClient, {
47
46
  appId: projectId,
48
47
  branchName: this.branchInfo.name,
49
- anotherBranchIdToIntersectRuntimesBy: (_a = this.options.anotherBranchToIntersectRuntimesBy) === null || _a === void 0 ? void 0 : _a.id,
48
+ anotherBranchIdToIntersectRuntimesBy: this.options.anotherBranchToIntersectRuntimesBy?.id,
50
49
  });
51
50
  if (newestRuntimeConnection.edges.length === 0) {
52
51
  log_1.default.addNewLineIfNone();
@@ -112,7 +111,6 @@ class SelectRuntime {
112
111
  }
113
112
  async selectRuntimesAsync(graphqlClient, { appId, batchSize = 5, }) {
114
113
  const queryAsync = async (queryParams) => {
115
- var _a;
116
114
  return await RuntimeQuery_1.RuntimeQuery.getRuntimesOnBranchAsync(graphqlClient, {
117
115
  appId,
118
116
  name: this.branchInfo.name,
@@ -121,7 +119,7 @@ class SelectRuntime {
121
119
  last: queryParams.last,
122
120
  before: queryParams.before,
123
121
  filter: {
124
- branchId: (_a = this.options.anotherBranchToIntersectRuntimesBy) === null || _a === void 0 ? void 0 : _a.id,
122
+ branchId: this.options.anotherBranchToIntersectRuntimesBy?.id,
125
123
  },
126
124
  });
127
125
  };
@@ -61,13 +61,12 @@ function formatRuntimeWithUpdateGroup(maybeUpdateGroup, runtime, branchName) {
61
61
  }
62
62
  exports.formatRuntimeWithUpdateGroup = formatRuntimeWithUpdateGroup;
63
63
  function formatUpdateGroup(updateGroup) {
64
- var _a, _b, _c, _d;
65
64
  const lines = [];
66
65
  const formattedLines = (0, formatFields_1.default)([
67
- { label: 'Message', value: (_a = updateGroup.message) !== null && _a !== void 0 ? _a : 'N/A' },
68
- { label: 'Runtime version', value: (_b = updateGroup.runtimeVersion) !== null && _b !== void 0 ? _b : 'N/A' },
69
- { label: 'Platforms', value: (_c = updateGroup.platforms) !== null && _c !== void 0 ? _c : 'N/A' },
70
- { label: 'Group ID', value: (_d = updateGroup.group) !== null && _d !== void 0 ? _d : 'N/A' },
66
+ { label: 'Message', value: updateGroup.message ?? 'N/A' },
67
+ { label: 'Runtime version', value: updateGroup.runtimeVersion ?? 'N/A' },
68
+ { label: 'Platforms', value: updateGroup.platforms ?? 'N/A' },
69
+ { label: 'Group ID', value: updateGroup.group ?? 'N/A' },
71
70
  ]).split('\n');
72
71
  lines.push(...formattedLines);
73
72
  return lines;
@@ -44,13 +44,12 @@ exports.sanitizeAdbDeviceName = sanitizeAdbDeviceName;
44
44
  * @param devicePid a value like `emulator-5554` from `abd devices`
45
45
  */
46
46
  async function getAdbNameForDeviceIdAsync(emulatorPid) {
47
- var _a;
48
47
  const { stdout } = await adbAsync('-s', emulatorPid, 'emu', 'avd', 'name');
49
48
  if (stdout.match(/could not connect to TCP port .*: Connection refused/)) {
50
49
  // Can also occur when the emulator does not exist.
51
50
  throw new Error(`Emulator not found: ${stdout}`);
52
51
  }
53
- return (_a = sanitizeAdbDeviceName(stdout)) !== null && _a !== void 0 ? _a : null;
52
+ return sanitizeAdbDeviceName(stdout) ?? null;
54
53
  }
55
54
  exports.getAdbNameForDeviceIdAsync = getAdbNameForDeviceIdAsync;
56
55
  // TODO: This is very expensive for some operations.
@@ -70,8 +69,7 @@ async function getRunningEmulatorsAsync() {
70
69
  })
71
70
  .filter(({ pid, type }) => !!pid && type === 'emulator');
72
71
  const devicePromises = attachedDevices.map(async ({ pid }) => {
73
- var _a;
74
- const name = (_a = (await getAdbNameForDeviceIdAsync(pid))) !== null && _a !== void 0 ? _a : '';
72
+ const name = (await getAdbNameForDeviceIdAsync(pid)) ?? '';
75
73
  return {
76
74
  pid,
77
75
  name,
@@ -81,9 +79,8 @@ async function getRunningEmulatorsAsync() {
81
79
  }
82
80
  exports.getRunningEmulatorsAsync = getRunningEmulatorsAsync;
83
81
  async function getFirstRunningEmulatorAsync() {
84
- var _a;
85
82
  const emulators = await getRunningEmulatorsAsync();
86
- return (_a = emulators[0]) !== null && _a !== void 0 ? _a : null;
83
+ return emulators[0] ?? null;
87
84
  }
88
85
  exports.getFirstRunningEmulatorAsync = getFirstRunningEmulatorAsync;
89
86
  /**
@@ -110,7 +107,7 @@ async function waitForEmulatorToBeBootedAsync(maxWaitTimeMs, intervalMs) {
110
107
  const startTime = Date.now();
111
108
  while (Date.now() - startTime < maxWaitTimeMs) {
112
109
  const emulator = await getFirstRunningEmulatorAsync();
113
- if ((emulator === null || emulator === void 0 ? void 0 : emulator.pid) && (await isEmulatorBootedAsync(emulator.pid))) {
110
+ if (emulator?.pid && (await isEmulatorBootedAsync(emulator.pid))) {
114
111
  return emulator;
115
112
  }
116
113
  await (0, promise_1.sleepAsync)(intervalMs);
@@ -10,10 +10,9 @@ const log_1 = tslib_1.__importDefault(require("../../log"));
10
10
  exports.MIN_XCODE_VERSION = '9.4.0';
11
11
  exports.APP_STORE_ID = '497799835';
12
12
  async function getXcodeVersionAsync() {
13
- var _a;
14
13
  try {
15
14
  const { stdout } = await (0, spawn_async_1.default)('xcodebuild', ['-version']);
16
- const version = (_a = stdout.match(/Xcode (\d+\.\d+)/)) === null || _a === void 0 ? void 0 : _a[1];
15
+ const version = stdout.match(/Xcode (\d+\.\d+)/)?.[1];
17
16
  const semverFormattedVersion = `${version}.0`;
18
17
  if (!semver_1.default.valid(semverFormattedVersion)) {
19
18
  log_1.default.warn(`Xcode version ${chalk_1.default.bold(version)} is in unknown format. Expected format is ${chalk_1.default.bold('12.0')}.`);
@@ -16,11 +16,10 @@ async function xcrunAsync(args, options) {
16
16
  }
17
17
  exports.xcrunAsync = xcrunAsync;
18
18
  function throwXcrunError(e) {
19
- var _a;
20
19
  if (isLicenseOutOfDate(e.stdout) || isLicenseOutOfDate(e.stderr)) {
21
20
  throw new Error('Xcode license is not accepted. Please run `sudo xcodebuild -license`.');
22
21
  }
23
- else if ((_a = e.stderr) === null || _a === void 0 ? void 0 : _a.includes('not a developer tool or in PATH')) {
22
+ else if (e.stderr?.includes('not a developer tool or in PATH')) {
24
23
  throw new Error(`You may need to run ${chalk_1.default.bold('sudo xcode-select -s /Applications/Xcode.app')} and try again.`);
25
24
  }
26
25
  if (Array.isArray(e.output)) {
@@ -3,16 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isRunnableOnSimulatorOrEmulator = void 0;
4
4
  const generated_1 = require("../graphql/generated");
5
5
  function isAab(build) {
6
- var _a, _b, _c;
7
- return (_c = (_b = (_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.applicationArchiveUrl) === null || _b === void 0 ? void 0 : _b.endsWith('.aab')) !== null && _c !== void 0 ? _c : false;
6
+ return build.artifacts?.applicationArchiveUrl?.endsWith('.aab') ?? false;
8
7
  }
9
8
  function didArtifactsExpire(build) {
10
9
  return new Date().getTime() - new Date(build.completedAt).getTime() > 30 * 24 * 60 * 60 * 1000; // 30 days
11
10
  }
12
11
  function isRunnableOnSimulatorOrEmulator(build) {
13
- var _a;
14
12
  return (build.status === generated_1.BuildStatus.Finished &&
15
- !!((_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.applicationArchiveUrl) &&
13
+ !!build.artifacts?.applicationArchiveUrl &&
16
14
  ((build.platform === generated_1.AppPlatform.Ios && build.isForIosSimulator) ||
17
15
  (build.platform === generated_1.AppPlatform.Android && !isAab(build))) &&
18
16
  !didArtifactsExpire(build));
@@ -204,7 +204,7 @@ async function handleBuildListSourceAsync(ctx) {
204
204
  function formatBuildChoice(build, expiryDate) {
205
205
  const { id, updatedAt, runtimeVersion, buildProfile, gitCommitHash, gitCommitMessage, channel, message, } = build;
206
206
  const buildDate = new Date(updatedAt);
207
- const splitCommitMessage = gitCommitMessage === null || gitCommitMessage === void 0 ? void 0 : gitCommitMessage.split('\n');
207
+ const splitCommitMessage = gitCommitMessage?.split('\n');
208
208
  const formattedCommitData = gitCommitHash && splitCommitMessage && splitCommitMessage.length > 0
209
209
  ? `${gitCommitHash.slice(0, 7)} "${chalk_1.default.bold(splitCommitMessage[0] + (splitCommitMessage.length > 1 ? '…' : ''))}"`
210
210
  : null;
@@ -17,11 +17,10 @@ class AndroidSubmitCommand {
17
17
  this.ctx = ctx;
18
18
  }
19
19
  async runAsync() {
20
- var _a;
21
20
  log_1.default.addNewLineIfNone();
22
21
  const archiveSource = this.resolveArchiveSource();
23
22
  if (!archiveSource.ok) {
24
- log_1.default.error((_a = archiveSource.reason) === null || _a === void 0 ? void 0 : _a.message);
23
+ log_1.default.error(archiveSource.reason?.message);
25
24
  throw new Error('Submission failed');
26
25
  }
27
26
  const archiveSourceValue = archiveSource.enforceValue();
@@ -46,7 +45,7 @@ class AndroidSubmitCommand {
46
45
  const serviceAccountSource = await this.resolveServiceAccountSourceAsync();
47
46
  const errored = [track, releaseStatus, serviceAccountSource, rollout].filter(r => !r.ok);
48
47
  if (errored.length > 0) {
49
- const message = errored.map(err => { var _a; return (_a = err.reason) === null || _a === void 0 ? void 0 : _a.message; }).join('\n');
48
+ const message = errored.map(err => err.reason?.message).join('\n');
50
49
  log_1.default.error(message);
51
50
  throw new Error('Submission failed');
52
51
  }
@@ -111,7 +110,6 @@ class AndroidSubmitCommand {
111
110
  }
112
111
  }
113
112
  async resolveServiceAccountSourceAsync() {
114
- var _a;
115
113
  const { serviceAccountKeyPath } = this.ctx.profile;
116
114
  if (serviceAccountKeyPath) {
117
115
  return (0, results_1.result)({
@@ -119,7 +117,7 @@ class AndroidSubmitCommand {
119
117
  path: serviceAccountKeyPath,
120
118
  });
121
119
  }
122
- let androidApplicationIdentifier = (_a = this.ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : this.ctx.profile.applicationId;
120
+ let androidApplicationIdentifier = this.ctx.applicationIdentifierOverride ?? this.ctx.profile.applicationId;
123
121
  if (!androidApplicationIdentifier) {
124
122
  const androidApplicationIdentifierResult = await this.maybeGetAndroidPackageFromCurrentProjectAsync();
125
123
  if (!androidApplicationIdentifierResult.ok) {
@@ -66,10 +66,10 @@ class AndroidSubmitter extends BaseSubmitter_1.default {
66
66
  return {
67
67
  projectId,
68
68
  track,
69
- changesNotSentForReview: changesNotSentForReview !== null && changesNotSentForReview !== void 0 ? changesNotSentForReview : undefined,
70
- releaseStatus: releaseStatus !== null && releaseStatus !== void 0 ? releaseStatus : undefined,
69
+ changesNotSentForReview: changesNotSentForReview ?? undefined,
70
+ releaseStatus: releaseStatus ?? undefined,
71
71
  formattedServiceAccount: formatServiceAccountSummary(serviceAccountKeyResult),
72
- rollout: rollout !== null && rollout !== void 0 ? rollout : undefined,
72
+ rollout: rollout ?? undefined,
73
73
  ...(0, summary_1.formatArchiveSourceSummary)(archive),
74
74
  };
75
75
  }
@@ -60,11 +60,10 @@ async function promptForApplicationIdAsync() {
60
60
  return androidPackage;
61
61
  }
62
62
  async function getServiceAccountFromCredentialsServiceAsync(ctx, source) {
63
- var _a;
64
63
  const appLookupParams = {
65
64
  account: (0, nullthrows_1.default)(ctx.user.accounts.find(a => a.name === ctx.accountName), `You do not have access to account: ${ctx.accountName}`),
66
65
  projectName: ctx.projectName,
67
- androidApplicationIdentifier: (_a = source.androidApplicationIdentifier) !== null && _a !== void 0 ? _a : (await promptForApplicationIdAsync()),
66
+ androidApplicationIdentifier: source.androidApplicationIdentifier ?? (await promptForApplicationIdAsync()),
68
67
  };
69
68
  log_1.default.log(`Looking up credentials configuration for ${appLookupParams.androidApplicationIdentifier}...`);
70
69
  const setupGoogleServiceAccountKeyAction = new SetUpGoogleServiceAccountKeyForSubmissions_1.SetUpGoogleServiceAccountKeyForSubmissions(appLookupParams);