eas-cli 9.0.2 → 9.0.4

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 (225) 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 +204 -32
  65. package/build/commands/secret/delete.js +5 -5
  66. package/build/commands/update/index.js +6 -7
  67. package/build/commands/update/republish.js +1 -2
  68. package/build/commands/update/roll-back-to-embedded.js +4 -5
  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 +18 -2
  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/republish.js +1 -1
  206. package/build/update/utils.js +28 -39
  207. package/build/user/SessionManager.js +5 -8
  208. package/build/user/User.js +2 -2
  209. package/build/user/expoSsoLauncher.js +1 -2
  210. package/build/utils/code-signing.js +4 -7
  211. package/build/utils/expoCli.js +1 -2
  212. package/build/utils/expoUpdatesCli.d.ts +1 -0
  213. package/build/utils/expoUpdatesCli.js +3 -2
  214. package/build/utils/profiles.js +3 -3
  215. package/build/utils/progress.js +2 -2
  216. package/build/utils/relay.js +10 -14
  217. package/build/utils/timer.js +1 -2
  218. package/build/vcs/clients/git.d.ts +1 -1
  219. package/build/vcs/clients/git.js +24 -20
  220. package/build/vcs/git.d.ts +1 -1
  221. package/build/vcs/git.js +4 -2
  222. package/build/vcs/local.js +1 -2
  223. package/build/webhooks/input.js +2 -2
  224. package/oclif.manifest.json +1 -1
  225. package/package.json +5 -5
@@ -7,13 +7,11 @@ const ajv_1 = require("../utils/ajv");
7
7
  const metadataSchema = require('../../../schema/metadata-0.json');
8
8
  /** Validate the user-provided validation for issues */
9
9
  function validateConfig(config) {
10
- var _a;
11
10
  const validator = (0, ajv_1.createValidator)().compile(metadataSchema);
12
11
  validator(config);
13
- const issues = (0, ajv_1.getReadableErrors)((_a = validator.errors) !== null && _a !== void 0 ? _a : []).map(error => {
14
- var _a, _b;
12
+ const issues = (0, ajv_1.getReadableErrors)(validator.errors ?? []).map(error => {
15
13
  const path = error.path === '$' ? [] : error.path.substring(2).split('.');
16
- const id = (_b = (_a = error.original) === null || _a === void 0 ? void 0 : _a.keyword) !== null && _b !== void 0 ? _b : 'unknown';
14
+ const id = error.original?.keyword ?? 'unknown';
17
15
  return {
18
16
  id: `json-schema.${id}`,
19
17
  path,
@@ -11,7 +11,7 @@ const log_1 = tslib_1.__importStar(require("../log"));
11
11
  */
12
12
  class MetadataValidationError extends Error {
13
13
  constructor(message, errors = []) {
14
- super(message !== null && message !== void 0 ? message : 'Store configuration validation failed');
14
+ super(message ?? 'Store configuration validation failed');
15
15
  this.errors = errors;
16
16
  }
17
17
  }
@@ -49,10 +49,9 @@ exports.MetadataDownloadError = MetadataDownloadError;
49
49
  * This should help communicate any possible configuration error and help the user resolve it.
50
50
  */
51
51
  function logMetadataValidationError(error) {
52
- var _a;
53
52
  log_1.default.newLine();
54
53
  log_1.default.error(chalk_1.default.bold(error.message));
55
- if (((_a = error.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
54
+ if (error.errors?.length > 0) {
56
55
  // TODO(cedric): group errors by property to make multiple errors for same property more readable
57
56
  for (const err of error.errors) {
58
57
  log_1.default.log(` - ${chalk_1.default.bold(`$.${err.path.join('.')}`)} ${err.message}`);
@@ -65,14 +64,13 @@ exports.logMetadataValidationError = logMetadataValidationError;
65
64
  * If a normal error is thrown, this method will re-throw that error to avoid consuming it.
66
65
  */
67
66
  function handleMetadataError(error) {
68
- var _a;
69
67
  if (error instanceof MetadataValidationError) {
70
68
  return logMetadataValidationError(error);
71
69
  }
72
70
  if (error instanceof MetadataDownloadError || error instanceof MetadataUploadError) {
73
71
  log_1.default.newLine();
74
72
  log_1.default.error(chalk_1.default.bold(error.message));
75
- if (((_a = error.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
73
+ if (error.errors?.length > 0) {
76
74
  log_1.default.newLine();
77
75
  log_1.default.error(error.errors.map(err => err.message).join('\n\n'));
78
76
  }
@@ -15,7 +15,6 @@ const prompts_1 = require("../prompts");
15
15
  * Note, only App Store is supported at this time.
16
16
  */
17
17
  async function uploadMetadataAsync({ projectDir, profile, exp, analytics, credentialsCtx, }) {
18
- var _a;
19
18
  const storeConfig = await loadConfigWithValidationPromptAsync(projectDir, profile);
20
19
  const { app, auth } = await (0, auth_1.getAppStoreAuthAsync)({
21
20
  exp,
@@ -31,7 +30,7 @@ async function uploadMetadataAsync({ projectDir, profile, exp, analytics, creden
31
30
  const tasks = (0, tasks_1.createAppleTasks)({
32
31
  // We need to resolve a different version as soon as possible.
33
32
  // This version is the parent model of all changes we are going to push.
34
- version: (_a = config.getVersion()) === null || _a === void 0 ? void 0 : _a.versionString,
33
+ version: config.getVersion()?.versionString,
35
34
  });
36
35
  const taskCtx = { app };
37
36
  for (const task of tasks) {
@@ -6,7 +6,6 @@ async function waitAsync(duration) {
6
6
  }
7
7
  exports.waitAsync = waitAsync;
8
8
  async function retryIfNullAsync(method, options = {}) {
9
- var _a;
10
9
  let { tries = 5, delay = 1000 } = options;
11
10
  while (tries > 0) {
12
11
  const value = await method();
@@ -14,7 +13,7 @@ async function retryIfNullAsync(method, options = {}) {
14
13
  return value;
15
14
  }
16
15
  tries--;
17
- (_a = options.onRetry) === null || _a === void 0 ? void 0 : _a.call(options, tries);
16
+ options.onRetry?.(tries);
18
17
  await waitAsync(delay);
19
18
  }
20
19
  return null;
@@ -24,18 +24,17 @@ function subscribeTelemetry(analytics, event, options) {
24
24
  });
25
25
  return response;
26
26
  }, (error) => {
27
- var _a, _b, _c, _d, _e;
28
27
  analytics.logEvent(event, {
29
28
  executionId,
30
29
  type: 'response',
31
30
  phase: 'rejected',
32
31
  method: error.request.method.toUpperCase(),
33
- url: scrubber((_a = error.config) === null || _a === void 0 ? void 0 : _a.url),
32
+ url: scrubber(error.config?.url),
34
33
  error: scrubber(error.message),
35
- status: String((_b = error.response) === null || _b === void 0 ? void 0 : _b.status),
36
- statusText: scrubber((_c = error.response) === null || _c === void 0 ? void 0 : _c.statusText),
37
- input: scrubber((_d = error.config) === null || _d === void 0 ? void 0 : _d.data),
38
- output: scrubber((_e = error.response) === null || _e === void 0 ? void 0 : _e.data),
34
+ status: String(error.response?.status),
35
+ statusText: scrubber(error.response?.statusText),
36
+ input: scrubber(error.config?.data),
37
+ output: scrubber(error.response?.data),
39
38
  });
40
39
  throw error;
41
40
  });
@@ -47,15 +46,14 @@ function subscribeTelemetry(analytics, event, options) {
47
46
  exports.subscribeTelemetry = subscribeTelemetry;
48
47
  /** Exposed for testing */
49
48
  function makeDataScrubber({ app, auth }) {
50
- var _a, _b;
51
49
  const token = getAuthTokenString(auth);
52
50
  const patterns = {
53
51
  APPLE_APP_ID: new RegExp(app.id, 'gi'),
54
52
  APPLE_USERNAME: auth.username ? new RegExp(auth.username, 'gi') : null,
55
53
  APPLE_PASSWORD: auth.password ? new RegExp(auth.password, 'gi') : null,
56
54
  APPLE_TOKEN: token ? new RegExp(token, 'gi') : null,
57
- APPLE_TEAM_ID: ((_a = auth.context) === null || _a === void 0 ? void 0 : _a.teamId) ? new RegExp(auth.context.teamId, 'gi') : null,
58
- APPLE_PROVIDER_ID: ((_b = auth.context) === null || _b === void 0 ? void 0 : _b.providerId)
55
+ APPLE_TEAM_ID: auth.context?.teamId ? new RegExp(auth.context.teamId, 'gi') : null,
56
+ APPLE_PROVIDER_ID: auth.context?.providerId
59
57
  ? new RegExp(String(auth.context.providerId), 'gi')
60
58
  : null,
61
59
  };
@@ -75,8 +73,7 @@ function makeDataScrubber({ app, auth }) {
75
73
  }
76
74
  exports.makeDataScrubber = makeDataScrubber;
77
75
  function getAuthTokenString(auth) {
78
- var _a;
79
- if (!((_a = auth.context) === null || _a === void 0 ? void 0 : _a.token)) {
76
+ if (!auth.context?.token) {
80
77
  return null;
81
78
  }
82
79
  if (typeof auth.context.token === 'object') {
@@ -44,7 +44,7 @@ async function runCommandAsync({ cwd, args, command, shouldShowStderrLine, shoul
44
44
  }
45
45
  catch (error) {
46
46
  if (showSpinner) {
47
- spinner === null || spinner === void 0 ? void 0 : spinner.fail(`${chalk_1.default.bold(`${command} ${args.join(' ')}`)} failed`);
47
+ spinner?.fail(`${chalk_1.default.bold(`${command} ${args.join(' ')}`)} failed`);
48
48
  }
49
49
  else {
50
50
  log_1.default.error(`❌ ${chalk_1.default.bold(`${command} ${args.join(' ')}`)} failed`);
@@ -52,7 +52,7 @@ async function runCommandAsync({ cwd, args, command, shouldShowStderrLine, shoul
52
52
  throw error;
53
53
  }
54
54
  if (showSpinner) {
55
- spinner === null || spinner === void 0 ? void 0 : spinner.succeed(`✅ ${chalk_1.default.bold(`${command} ${args.join(' ')}`)} succeeded`);
55
+ spinner?.succeed(`${chalk_1.default.bold(`${command} ${args.join(' ')}`)} succeeded`);
56
56
  }
57
57
  else {
58
58
  log_1.default.log(`✅ ${chalk_1.default.bold(`${command} ${args.join(' ')}`)} succeeded`);
package/build/ora.js CHANGED
@@ -22,7 +22,7 @@ const isCi = (0, getenv_1.boolish)('CI', false);
22
22
  * @returns
23
23
  */
24
24
  function ora(options) {
25
- const inputOptions = typeof options === 'string' ? { text: options } : options !== null && options !== void 0 ? options : {};
25
+ const inputOptions = typeof options === 'string' ? { text: options } : options ?? {};
26
26
  const disabled = log_1.default.isDebug || !process.stdin.isTTY || isCi;
27
27
  const spinner = (0, ora_1.default)({
28
28
  // Ensure our non-interactive mode emulates CI mode.
@@ -60,7 +60,23 @@ function ora(options) {
60
60
  console.error = errorReal;
61
61
  };
62
62
  spinner.start = (text) => {
63
- wrapNativeLogs();
63
+ // wrapNativeLogs wraps calls to console so they always:
64
+ // 1. stop the spinner
65
+ // 2. log the message
66
+ // 3. start the spinner again
67
+ // Every restart of the spinner causes the spinner message to be logged again
68
+ // which makes logs look like
69
+ //
70
+ // - Exporting...
71
+ // [expo-cli] Starting Metro Bundler
72
+ // - Exporting...
73
+ // [expo-cli] Android Bundling complete 3492ms
74
+ // - Exporting...
75
+ //
76
+ // Skipping wrapping native logs removes the repeated interleaved "Exporting..." messages.
77
+ if (!disabled) {
78
+ wrapNativeLogs();
79
+ }
64
80
  return oraStart(text);
65
81
  };
66
82
  spinner.stopAndPersist = (options) => {
@@ -38,7 +38,7 @@ async function ensureApplicationIdIsDefinedForManagedProjectAsync({ graphqlClien
38
38
  exports.ensureApplicationIdIsDefinedForManagedProjectAsync = ensureApplicationIdIsDefinedForManagedProjectAsync;
39
39
  class AmbiguousApplicationIdError extends Error {
40
40
  constructor(message) {
41
- super(message !== null && message !== void 0 ? message : 'Could not resolve applicationId.');
41
+ super(message ?? 'Could not resolve applicationId.');
42
42
  }
43
43
  }
44
44
  exports.AmbiguousApplicationIdError = AmbiguousApplicationIdError;
@@ -67,7 +67,7 @@ async function getApplicationIdFromBareAsync(projectDir, gradleContext) {
67
67
  if (buildGradle.match(/productFlavors/)) {
68
68
  throw new AmbiguousApplicationIdError('Failed to autodetect applicationId in multi-flavor project.');
69
69
  }
70
- return (0, nullthrows_1.default)(matchResult === null || matchResult === void 0 ? void 0 : matchResult[1], errorMessage);
70
+ return (0, nullthrows_1.default)(matchResult?.[1], errorMessage);
71
71
  }
72
72
  }
73
73
  exports.getApplicationIdFromBareAsync = getApplicationIdFromBareAsync;
@@ -92,7 +92,6 @@ async function getApplicationIdAsync(projectDir, exp, vcsClient, gradleContext)
92
92
  }
93
93
  exports.getApplicationIdAsync = getApplicationIdAsync;
94
94
  async function configureApplicationIdAsync({ graphqlClient, projectDir, projectId, exp, nonInteractive, }) {
95
- var _a;
96
95
  if (nonInteractive) {
97
96
  throw new Error(`The "android.package" is required to be set in app config when running in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/versions/latest/config/app/#package')}`);
98
97
  }
@@ -115,7 +114,7 @@ async function configureApplicationIdAsync({ graphqlClient, projectDir, projectI
115
114
  const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
116
115
  rawStaticConfig.expo = {
117
116
  ...rawStaticConfig.expo,
118
- android: { ...(_a = rawStaticConfig.expo) === null || _a === void 0 ? void 0 : _a.android, package: packageName },
117
+ android: { ...rawStaticConfig.expo?.android, package: packageName },
119
118
  };
120
119
  await fs_extra_1.default.writeJson(paths.staticConfigPath, rawStaticConfig, { spaces: 2 });
121
120
  exp.android = { ...exp.android, package: packageName };
@@ -7,7 +7,6 @@ const gradleUtils = tslib_1.__importStar(require("./gradleUtils"));
7
7
  const log_1 = tslib_1.__importDefault(require("../../log"));
8
8
  const workflow_1 = require("../../project/workflow");
9
9
  async function resolveGradleBuildContextAsync(projectDir, buildProfile, vcsClient) {
10
- var _a;
11
10
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient);
12
11
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
13
12
  try {
@@ -16,13 +15,13 @@ async function resolveGradleBuildContextAsync(projectDir, buildProfile, vcsClien
16
15
  const parsedGradleCommand = buildProfile.gradleCommand
17
16
  ? gradleUtils.parseGradleCommand(buildProfile.gradleCommand, buildGradle)
18
17
  : undefined;
19
- if ((parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.moduleName) &&
18
+ if (parsedGradleCommand?.moduleName &&
20
19
  parsedGradleCommand.moduleName !== gradleUtils.DEFAULT_MODULE_NAME) {
21
20
  log_1.default.warn(`Building modules different than "${gradleUtils.DEFAULT_MODULE_NAME}" might result in unexpected behavior.`);
22
21
  }
23
22
  return {
24
- moduleName: (_a = parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.moduleName) !== null && _a !== void 0 ? _a : gradleUtils.DEFAULT_MODULE_NAME,
25
- flavor: parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.flavor,
23
+ moduleName: parsedGradleCommand?.moduleName ?? gradleUtils.DEFAULT_MODULE_NAME,
24
+ flavor: parsedGradleCommand?.flavor,
26
25
  };
27
26
  }
28
27
  else {
@@ -13,8 +13,8 @@ async function getAppBuildGradleAsync(projectDir) {
13
13
  }
14
14
  exports.getAppBuildGradleAsync = getAppBuildGradleAsync;
15
15
  function resolveConfigValue(buildGradle, field, flavor) {
16
- var _a, _b, _c, _d, _e, _f;
17
- return ((_d = (flavor && ((_c = (_b = (_a = buildGradle === null || buildGradle === void 0 ? void 0 : buildGradle.android) === null || _a === void 0 ? void 0 : _a.productFlavors) === null || _b === void 0 ? void 0 : _b[flavor]) === null || _c === void 0 ? void 0 : _c[field]))) !== null && _d !== void 0 ? _d : (_f = (_e = buildGradle === null || buildGradle === void 0 ? void 0 : buildGradle.android) === null || _e === void 0 ? void 0 : _e.defaultConfig) === null || _f === void 0 ? void 0 : _f[field]);
16
+ return ((flavor && buildGradle?.android?.productFlavors?.[flavor]?.[field]) ??
17
+ buildGradle?.android?.defaultConfig?.[field]);
18
18
  }
19
19
  exports.resolveConfigValue = resolveConfigValue;
20
20
  /**
@@ -30,12 +30,11 @@ exports.resolveConfigValue = resolveConfigValue;
30
30
  * the flavor name
31
31
  **/
32
32
  function parseGradleCommand(cmd, buildGradle) {
33
- var _a, _b, _c, _d;
34
- const hasFlavorDimensions = ((_b = (_a = buildGradle.android) === null || _a === void 0 ? void 0 : _a.flavorDimensions) !== null && _b !== void 0 ? _b : '').split(',').length > 1;
33
+ const hasFlavorDimensions = (buildGradle.android?.flavorDimensions ?? '').split(',').length > 1;
35
34
  if (hasFlavorDimensions) {
36
35
  throw new Error('flavorDimensions in build.gradle are not supported yet');
37
36
  }
38
- const flavors = new Set(Object.keys((_d = (_c = buildGradle === null || buildGradle === void 0 ? void 0 : buildGradle.android) === null || _c === void 0 ? void 0 : _c.productFlavors) !== null && _d !== void 0 ? _d : {}));
37
+ const flavors = new Set(Object.keys(buildGradle?.android?.productFlavors ?? {}));
39
38
  // remove any params specified after command name
40
39
  const [withoutParams] = cmd.split(' ');
41
40
  // remove leading :
@@ -61,7 +61,7 @@ function getPrivateExpoConfig(projectDir, opts = {}) {
61
61
  exports.getPrivateExpoConfig = getPrivateExpoConfig;
62
62
  function ensureExpoConfigExists(projectDir) {
63
63
  const paths = (0, config_1.getConfigFilePaths)(projectDir);
64
- if (!(paths === null || paths === void 0 ? void 0 : paths.staticConfigPath) && !(paths === null || paths === void 0 ? void 0 : paths.dynamicConfigPath)) {
64
+ if (!paths?.staticConfigPath && !paths?.dynamicConfigPath) {
65
65
  // eslint-disable-next-line node/no-sync
66
66
  fs_extra_1.default.writeFileSync(path_1.default.join(projectDir, 'app.json'), JSON.stringify({ expo: {} }, null, 2));
67
67
  }
@@ -73,16 +73,15 @@ async function ensureStaticExpoConfigIsValidAsync(projectDir) {
73
73
  const staticConfig = await json_file_1.default.readAsync(staticConfigPath);
74
74
  // Add the "expo" key if it doesn't exist on app.json yet, such as in
75
75
  // projects initialized with RNC CLI
76
- if (!(staticConfig === null || staticConfig === void 0 ? void 0 : staticConfig.expo)) {
76
+ if (!staticConfig?.expo) {
77
77
  staticConfig.expo = {};
78
78
  await json_file_1.default.writeAsync(staticConfigPath, staticConfig);
79
79
  }
80
80
  }
81
81
  }
82
82
  function isUsingStaticExpoConfig(projectDir) {
83
- var _a;
84
83
  const paths = (0, config_1.getConfigFilePaths)(projectDir);
85
- return !!(((_a = paths.staticConfigPath) === null || _a === void 0 ? void 0 : _a.endsWith('app.json')) && !paths.dynamicConfigPath);
84
+ return !!(paths.staticConfigPath?.endsWith('app.json') && !paths.dynamicConfigPath);
86
85
  }
87
86
  exports.isUsingStaticExpoConfig = isUsingStaticExpoConfig;
88
87
  function getPublicExpoConfig(projectDir, opts = {}) {
@@ -17,7 +17,6 @@ const prompts_1 = require("../prompts");
17
17
  * If yes, register and return that. If not, throw.
18
18
  */
19
19
  async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graphqlClient, projectInfo, options, actor) {
20
- var _a;
21
20
  const { accountName, projectName } = projectInfo;
22
21
  const projectFullName = `@${accountName}/${projectName}`;
23
22
  if (options.nonInteractive) {
@@ -25,7 +24,7 @@ async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graph
25
24
  }
26
25
  const allAccounts = actor.accounts;
27
26
  const accountNamesWhereUserHasSufficientPublishPermissions = new Set(allAccounts
28
- .filter(a => { var _a; return ((_a = a.users.find(it => it.actor.id === actor.id)) === null || _a === void 0 ? void 0 : _a.role) !== generated_1.Role.ViewOnly; })
27
+ .filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
29
28
  .map(it => it.name));
30
29
  const account = allAccounts.find(a => a.name === accountName);
31
30
  if (!account) {
@@ -57,7 +56,7 @@ async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graph
57
56
  const id = await AppMutation_1.AppMutation.createAppAsync(graphqlClient, {
58
57
  accountId: account.id,
59
58
  projectName,
60
- privacy: (_a = projectInfo.privacy) !== null && _a !== void 0 ? _a : generated_1.AppPrivacy.Public,
59
+ privacy: projectInfo.privacy ?? generated_1.AppPrivacy.Public,
61
60
  });
62
61
  spinner.succeed(`Created ${chalk_1.default.bold(projectLink)} on Expo`);
63
62
  return id;
@@ -75,13 +74,12 @@ exports.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync = fetchOrCre
75
74
  * @returns A promise resolving to Project ID, null if it doesn't exist
76
75
  */
77
76
  async function findProjectIdByAccountNameAndSlugNullableAsync(graphqlClient, accountName, slug) {
78
- var _a;
79
77
  try {
80
78
  const { id } = await AppQuery_1.AppQuery.byFullNameAsync(graphqlClient, `@${accountName}/${slug}`);
81
79
  return id;
82
80
  }
83
81
  catch (err) {
84
- if ((_a = err.graphQLErrors) === null || _a === void 0 ? void 0 : _a.some((it) => { var _a; return ((_a = it.extensions) === null || _a === void 0 ? void 0 : _a.errorCode) !== 'EXPERIENCE_NOT_FOUND'; })) {
82
+ if (err.graphQLErrors?.some((it) => it.extensions?.errorCode !== 'EXPERIENCE_NOT_FOUND')) {
85
83
  throw err;
86
84
  }
87
85
  return null;
@@ -33,7 +33,7 @@ async function ensureBundleIdentifierIsDefinedForManagedProjectAsync({ graphqlCl
33
33
  exports.ensureBundleIdentifierIsDefinedForManagedProjectAsync = ensureBundleIdentifierIsDefinedForManagedProjectAsync;
34
34
  class AmbiguousBundleIdentifierError extends Error {
35
35
  constructor(message) {
36
- super(message !== null && message !== void 0 ? message : 'Could not resolve bundle identifier.');
36
+ super(message ?? 'Could not resolve bundle identifier.');
37
37
  }
38
38
  }
39
39
  exports.AmbiguousBundleIdentifierError = AmbiguousBundleIdentifierError;
@@ -47,8 +47,8 @@ async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext
47
47
  if (!xcodeContext && isMultiScheme && isMultiTarget) {
48
48
  throw new AmbiguousBundleIdentifierError("Multiple schemes and targets found in Xcode project, bundle identifier couldn't be resolved.");
49
49
  }
50
- const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifierFromPbxproj(projectDir, xcodeContext !== null && xcodeContext !== void 0 ? xcodeContext : {});
51
- const buildConfigurationDesc = (xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.targetName) && (xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.buildConfiguration)
50
+ const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifierFromPbxproj(projectDir, xcodeContext ?? {});
51
+ const buildConfigurationDesc = xcodeContext?.targetName && xcodeContext?.buildConfiguration
52
52
  ? ` (target = ${xcodeContext.targetName}, build configuration = ${xcodeContext.buildConfiguration})`
53
53
  : '';
54
54
  (0, assert_1.default)(bundleIdentifier, `Could not read bundle identifier from Xcode project${buildConfigurationDesc}.`);
@@ -59,9 +59,9 @@ async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext
59
59
  }
60
60
  else {
61
61
  // TODO: the following asserts are only temporary until we support app extensions in managed projects
62
- (0, assert_1.default)(!(xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.targetName) ||
63
- (xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.targetName) === config_plugins_1.IOSConfig.XcodeUtils.sanitizedName(exp.name), 'targetName cannot be set to an arbitrary value for managed projects.');
64
- (0, assert_1.default)(!(xcodeContext === null || xcodeContext === void 0 ? void 0 : xcodeContext.buildConfiguration), 'buildConfiguration cannot be passed for managed projects.');
62
+ (0, assert_1.default)(!xcodeContext?.targetName ||
63
+ xcodeContext?.targetName === config_plugins_1.IOSConfig.XcodeUtils.sanitizedName(exp.name), 'targetName cannot be set to an arbitrary value for managed projects.');
64
+ (0, assert_1.default)(!xcodeContext?.buildConfiguration, 'buildConfiguration cannot be passed for managed projects.');
65
65
  const bundleIdentifier = config_plugins_1.IOSConfig.BundleIdentifier.getBundleIdentifier(exp);
66
66
  if (!bundleIdentifier || !isBundleIdentifierValid(bundleIdentifier)) {
67
67
  if (bundleIdentifier) {
@@ -76,7 +76,6 @@ async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext
76
76
  }
77
77
  exports.getBundleIdentifierAsync = getBundleIdentifierAsync;
78
78
  async function configureBundleIdentifierAsync({ graphqlClient, projectDir, projectId, exp, nonInteractive, }) {
79
- var _a;
80
79
  if (nonInteractive) {
81
80
  throw new Error(`The "ios.bundleIdentifier" is required to be set in app config when running in non-interactive mode. ${(0, log_1.learnMore)('https://docs.expo.dev/versions/latest/config/app/#bundleidentifier')}`);
82
81
  }
@@ -99,7 +98,7 @@ async function configureBundleIdentifierAsync({ graphqlClient, projectDir, proje
99
98
  const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
100
99
  rawStaticConfig.expo = {
101
100
  ...rawStaticConfig.expo,
102
- ios: { ...(_a = rawStaticConfig.expo) === null || _a === void 0 ? void 0 : _a.ios, bundleIdentifier },
101
+ ios: { ...rawStaticConfig.expo?.ios, bundleIdentifier },
103
102
  };
104
103
  await fs_extra_1.default.writeJson(paths.staticConfigPath, rawStaticConfig, { spaces: 2 });
105
104
  exp.ios = { ...exp.ios, bundleIdentifier };
@@ -6,7 +6,6 @@ const prebuild_config_1 = require("@expo/prebuild-config");
6
6
  const plist_1 = require("../../utils/plist");
7
7
  const workflow_1 = require("../workflow");
8
8
  async function getManagedApplicationTargetEntitlementsAsync(projectDir, env, vcsClient) {
9
- var _a;
10
9
  const originalProcessEnv = process.env;
11
10
  try {
12
11
  process.env = {
@@ -20,7 +19,7 @@ async function getManagedApplicationTargetEntitlementsAsync(projectDir, env, vcs
20
19
  introspect: true,
21
20
  ignoreExistingNativeFiles: await (0, workflow_1.hasIgnoredIosProjectAsync)(projectDir, vcsClient),
22
21
  });
23
- return ((_a = expWithMods.ios) === null || _a === void 0 ? void 0 : _a.entitlements) || {};
22
+ return expWithMods.ios?.entitlements || {};
24
23
  }
25
24
  finally {
26
25
  process.env = originalProcessEnv;
@@ -10,16 +10,17 @@ const prompts_1 = require("../../prompts");
10
10
  const sortBy_1 = tslib_1.__importDefault(require("../../utils/expodash/sortBy"));
11
11
  const workflow_1 = require("../workflow");
12
12
  async function resolveXcodeBuildContextAsync({ exp, projectDir, nonInteractive, vcsClient, }, buildProfile) {
13
- var _a, _b;
14
13
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
15
14
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
16
- const buildScheme = (_a = buildProfile.scheme) !== null && _a !== void 0 ? _a : (await selectSchemeAsync({
17
- projectDir,
18
- nonInteractive,
19
- }));
15
+ const buildScheme = buildProfile.scheme ??
16
+ (await selectSchemeAsync({
17
+ projectDir,
18
+ nonInteractive,
19
+ }));
20
20
  return {
21
21
  buildScheme,
22
- buildConfiguration: (_b = buildProfile.buildConfiguration) !== null && _b !== void 0 ? _b : (await config_plugins_1.IOSConfig.BuildScheme.getArchiveBuildConfigurationForSchemeAsync(projectDir, buildScheme)),
22
+ buildConfiguration: buildProfile.buildConfiguration ??
23
+ (await config_plugins_1.IOSConfig.BuildScheme.getArchiveBuildConfigurationForSchemeAsync(projectDir, buildScheme)),
23
24
  };
24
25
  }
25
26
  else {
@@ -16,15 +16,14 @@ const AppExtensionsConfigSchema = joi_1.default.array().items(joi_1.default.obje
16
16
  entitlements: joi_1.default.object(),
17
17
  }));
18
18
  async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildContext, env, vcsClient, }) {
19
- var _a, _b, _c, _d, _e, _f;
20
19
  const { buildScheme, buildConfiguration } = xcodeBuildContext;
21
20
  const applicationTargetName = buildScheme;
22
21
  const applicationTargetBundleIdentifier = await (0, bundleIdentifier_1.getBundleIdentifierAsync)(projectDir, exp, vcsClient, {
23
22
  targetName: applicationTargetName,
24
23
  buildConfiguration,
25
24
  });
26
- const applicationTargetEntitlements = await (0, entitlements_1.getManagedApplicationTargetEntitlementsAsync)(projectDir, env !== null && env !== void 0 ? env : {}, vcsClient);
27
- const appExtensions = (_f = (_e = (_d = (_c = (_b = (_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas) === null || _b === void 0 ? void 0 : _b.build) === null || _c === void 0 ? void 0 : _c.experimental) === null || _d === void 0 ? void 0 : _d.ios) === null || _e === void 0 ? void 0 : _e.appExtensions) !== null && _f !== void 0 ? _f : [];
25
+ const applicationTargetEntitlements = await (0, entitlements_1.getManagedApplicationTargetEntitlementsAsync)(projectDir, env ?? {}, vcsClient);
26
+ const appExtensions = exp.extra?.eas?.build?.experimental?.ios?.appExtensions ?? [];
28
27
  const { error } = AppExtensionsConfigSchema.validate(appExtensions, {
29
28
  allowUnknown: false,
30
29
  abortEarly: false,
@@ -32,16 +31,13 @@ async function resolveManagedProjectTargetsAsync({ exp, projectDir, xcodeBuildCo
32
31
  if (error) {
33
32
  throw new Error(`Failed to validate "extra.eas.build.experimental.ios.appExtensions" in you app config.\n${error.message}`);
34
33
  }
35
- const extensionsTargets = appExtensions.map(extension => {
36
- var _a, _b;
37
- return ({
38
- targetName: extension.targetName,
39
- buildConfiguration,
40
- bundleIdentifier: extension.bundleIdentifier,
41
- parentBundleIdentifier: (_a = extension.parentBundleIdentifier) !== null && _a !== void 0 ? _a : applicationTargetBundleIdentifier,
42
- entitlements: (_b = extension.entitlements) !== null && _b !== void 0 ? _b : {},
43
- });
44
- });
34
+ const extensionsTargets = appExtensions.map(extension => ({
35
+ targetName: extension.targetName,
36
+ buildConfiguration,
37
+ bundleIdentifier: extension.bundleIdentifier,
38
+ parentBundleIdentifier: extension.parentBundleIdentifier ?? applicationTargetBundleIdentifier,
39
+ entitlements: extension.entitlements ?? {},
40
+ }));
45
41
  return [
46
42
  {
47
43
  targetName: applicationTargetName,
@@ -70,7 +66,7 @@ async function resolveBareProjectTargetsAsync({ exp, projectDir, xcodeBuildConte
70
66
  targetName: applicationTarget.name,
71
67
  bundleIdentifier,
72
68
  buildConfiguration,
73
- entitlements: entitlements !== null && entitlements !== void 0 ? entitlements : {},
69
+ entitlements: entitlements ?? {},
74
70
  buildSettings: resolveBareProjectBuildSettings(pbxProject, applicationTarget.name, buildConfiguration),
75
71
  });
76
72
  const dependencies = await resolveBareProjectDependenciesAsync({
@@ -121,7 +117,7 @@ async function resolveBareProjectDependenciesAsync({ exp, projectDir, buildConfi
121
117
  buildConfiguration,
122
118
  bundleIdentifier: dependencyBundleIdentifier,
123
119
  parentBundleIdentifier: bundleIdentifier,
124
- entitlements: entitlements !== null && entitlements !== void 0 ? entitlements : {},
120
+ entitlements: entitlements ?? {},
125
121
  buildSettings: resolveBareProjectBuildSettings(pbxProject, dependency.name, buildConfiguration),
126
122
  });
127
123
  const dependencyDependencies = await resolveBareProjectDependenciesAsync({
@@ -157,20 +153,20 @@ function findTargetByName(targets, name) {
157
153
  }
158
154
  exports.findTargetByName = findTargetByName;
159
155
  function resolveBareProjectBuildSettings(project, targetName, buildConfiguration) {
160
- var _a;
161
156
  const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
162
157
  targetName,
163
158
  buildConfiguration,
164
159
  });
165
- return (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) !== null && _a !== void 0 ? _a : {};
160
+ return xcBuildConfiguration?.buildSettings ?? {};
166
161
  }
167
162
  /**
168
163
  * Get Apple Platform from the Xcode Target where possible.
169
164
  * @returns - Apple Platform when known, defaults to IOS when unknown
170
165
  */
171
166
  function getApplePlatformFromTarget(target) {
172
- var _a, _b;
173
- return ((_b = (_a = getApplePlatformFromSdkRoot(target)) !== null && _a !== void 0 ? _a : getApplePlatformFromDeviceFamily(target)) !== null && _b !== void 0 ? _b : constants_1.ApplePlatform.IOS);
167
+ return (getApplePlatformFromSdkRoot(target) ??
168
+ getApplePlatformFromDeviceFamily(target) ??
169
+ constants_1.ApplePlatform.IOS);
174
170
  }
175
171
  exports.getApplePlatformFromTarget = getApplePlatformFromTarget;
176
172
  /**
@@ -178,8 +174,7 @@ exports.getApplePlatformFromTarget = getApplePlatformFromTarget;
178
174
  * @returns - Apple Platform when known, defaults to null when unknown
179
175
  */
180
176
  function getApplePlatformFromSdkRoot(target) {
181
- var _a;
182
- const sdkRoot = (_a = target.buildSettings) === null || _a === void 0 ? void 0 : _a.SDKROOT;
177
+ const sdkRoot = target.buildSettings?.SDKROOT;
183
178
  if (!sdkRoot) {
184
179
  return null;
185
180
  }
@@ -207,8 +202,7 @@ exports.getApplePlatformFromSdkRoot = getApplePlatformFromSdkRoot;
207
202
  * @returns - Apple Platform when known, defaults to null when unknown
208
203
  */
209
204
  function getApplePlatformFromDeviceFamily(target) {
210
- var _a;
211
- const deviceFamily = (_a = target.buildSettings) === null || _a === void 0 ? void 0 : _a.TARGETED_DEVICE_FAMILY;
205
+ const deviceFamily = target.buildSettings?.TARGETED_DEVICE_FAMILY;
212
206
  if (!deviceFamily) {
213
207
  return null;
214
208
  }
@@ -8,12 +8,11 @@ const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
8
8
  const log_1 = tslib_1.__importStar(require("../log"));
9
9
  const prompts_1 = require("../prompts");
10
10
  async function validateMetroConfigForManagedWorkflowAsync(ctx) {
11
- var _a, _b;
12
11
  if (!(await configExistsAsync(ctx.projectDir))) {
13
12
  return;
14
13
  }
15
14
  const metroConfig = await loadConfigAsync(ctx.projectDir);
16
- const hasHashAssetFilesPlugin = (_b = (_a = metroConfig.transformer) === null || _a === void 0 ? void 0 : _a.assetPlugins) === null || _b === void 0 ? void 0 : _b.find((plugin) => plugin.match(/expo-asset[/|\\]tools[/|\\]hashAssetFiles/));
15
+ const hasHashAssetFilesPlugin = metroConfig.transformer?.assetPlugins?.find((plugin) => plugin.match(/expo-asset[/|\\]tools[/|\\]hashAssetFiles/));
17
16
  if (!hasHashAssetFilesPlugin) {
18
17
  log_1.default.warn(`It looks like that you are using a custom ${chalk_1.default.bold('metro.config.js')} that does not extend ${chalk_1.default.bold('@expo/metro-config')}.`);
19
18
  log_1.default.warn('This can result in unexpected and hard to debug issues, like missing assets in the production bundle.');
@@ -87,8 +87,7 @@ function isExpoUpdatesInstalledOrAvailable(projectDir, sdkVersion) {
87
87
  }
88
88
  exports.isExpoUpdatesInstalledOrAvailable = isExpoUpdatesInstalledOrAvailable;
89
89
  function isUsingEASUpdate(exp, projectId) {
90
- var _a;
91
- return ((_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url) === (0, api_1.getEASUpdateURL)(projectId);
90
+ return exp.updates?.url === (0, api_1.getEASUpdateURL)(projectId);
92
91
  }
93
92
  exports.isUsingEASUpdate = isUsingEASUpdate;
94
93
  async function getExpoUpdatesPackageVersionIfInstalledAsync(projectDir) {
@@ -97,11 +96,10 @@ async function getExpoUpdatesPackageVersionIfInstalledAsync(projectDir) {
97
96
  return null;
98
97
  }
99
98
  const { version } = await fs_extra_1.default.readJson(maybePackageJson);
100
- return version !== null && version !== void 0 ? version : null;
99
+ return version ?? null;
101
100
  }
102
101
  async function validateAppVersionRuntimePolicySupportAsync(projectDir, exp) {
103
- var _a;
104
- if (typeof exp.runtimeVersion !== 'object' || ((_a = exp.runtimeVersion) === null || _a === void 0 ? void 0 : _a.policy) !== 'appVersion') {
102
+ if (typeof exp.runtimeVersion !== 'object' || exp.runtimeVersion?.policy !== 'appVersion') {
105
103
  return;
106
104
  }
107
105
  const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(projectDir);
@@ -138,10 +136,10 @@ exports.isModernExpoUpdatesCLIWithRuntimeVersionCommandSupportedAsync = isModern
138
136
  async function installExpoUpdatesAsync(projectDir, options) {
139
137
  log_1.default.log(chalk_1.default.gray `> npx expo install expo-updates`);
140
138
  try {
141
- await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-updates'], { silent: options === null || options === void 0 ? void 0 : options.silent });
139
+ await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-updates'], { silent: options?.silent });
142
140
  }
143
141
  catch (error) {
144
- if (options === null || options === void 0 ? void 0 : options.silent) {
142
+ if (options?.silent) {
145
143
  log_1.default.error('stdout' in error ? error.stdout : error.message);
146
144
  }
147
145
  throw error;