@expo/build-tools 1.0.272 → 18.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/LICENSE +21 -100
  2. package/README.md +1 -1
  3. package/dist/android/credentials.js +2 -3
  4. package/dist/android/expoUpdates.js +5 -8
  5. package/dist/android/gradle.js +6 -8
  6. package/dist/android/gradleConfig.js +2 -3
  7. package/dist/buildErrors/buildErrorHandlers.js +4 -3
  8. package/dist/buildErrors/detectError.js +11 -11
  9. package/dist/buildErrors/errors.types.js +0 -1
  10. package/dist/buildErrors/userErrorHandlers.js +2 -3
  11. package/dist/builders/android.js +19 -24
  12. package/dist/builders/common.js +0 -1
  13. package/dist/builders/custom.js +9 -11
  14. package/dist/builders/index.js +0 -1
  15. package/dist/builders/ios.js +24 -29
  16. package/dist/common/eagerBundle.js +3 -4
  17. package/dist/common/easBuildInternal.js +5 -7
  18. package/dist/common/fastlane.js +0 -1
  19. package/dist/common/git.js +0 -1
  20. package/dist/common/installDependencies.d.ts +1 -1
  21. package/dist/common/installDependencies.js +1 -2
  22. package/dist/common/prebuild.js +3 -5
  23. package/dist/common/projectSources.js +12 -16
  24. package/dist/common/setup.js +28 -33
  25. package/dist/context.d.ts +1 -1
  26. package/dist/context.js +33 -25
  27. package/dist/customBuildContext.d.ts +1 -1
  28. package/dist/customBuildContext.js +32 -10
  29. package/dist/gcs/LoggerStream.d.ts +1 -1
  30. package/dist/gcs/LoggerStream.js +22 -14
  31. package/dist/gcs/__unit__/gcs.test.js +5 -8
  32. package/dist/gcs/client.d.ts +1 -1
  33. package/dist/gcs/client.js +28 -19
  34. package/dist/gcs/retry.js +4 -5
  35. package/dist/generic.d.ts +1 -1
  36. package/dist/generic.js +5 -7
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +19 -10
  39. package/dist/ios/configure.d.ts +1 -1
  40. package/dist/ios/configure.js +9 -11
  41. package/dist/ios/credentials/distributionCertificate.js +1 -3
  42. package/dist/ios/credentials/keychain.js +9 -8
  43. package/dist/ios/credentials/manager.d.ts +1 -1
  44. package/dist/ios/credentials/manager.js +24 -13
  45. package/dist/ios/credentials/provisioningProfile.js +12 -6
  46. package/dist/ios/expoUpdates.js +7 -11
  47. package/dist/ios/fastfile.d.ts +1 -1
  48. package/dist/ios/fastfile.js +0 -1
  49. package/dist/ios/fastlane.d.ts +1 -1
  50. package/dist/ios/fastlane.js +8 -9
  51. package/dist/ios/gymfile.d.ts +1 -1
  52. package/dist/ios/gymfile.js +1 -2
  53. package/dist/ios/pod.js +1 -2
  54. package/dist/ios/resign.js +3 -5
  55. package/dist/ios/resolve.js +1 -2
  56. package/dist/ios/tvos.js +1 -3
  57. package/dist/ios/xcodeBuildLogs.d.ts +1 -1
  58. package/dist/ios/xcodeBuildLogs.js +5 -7
  59. package/dist/ios/xcodeEnv.js +1 -2
  60. package/dist/ios/xcpretty.js +11 -7
  61. package/dist/steps/easFunctionGroups.js +0 -1
  62. package/dist/steps/easFunctions.js +26 -25
  63. package/dist/steps/functionGroups/build.d.ts +1 -1
  64. package/dist/steps/functionGroups/build.js +24 -26
  65. package/dist/steps/functionGroups/maestroTest.js +7 -9
  66. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +6 -9
  67. package/dist/steps/functions/ccacheStats.js +4 -6
  68. package/dist/steps/functions/checkout.js +0 -1
  69. package/dist/steps/functions/configureAndroidVersion.js +3 -5
  70. package/dist/steps/functions/configureEASUpdateIfInstalled.js +4 -6
  71. package/dist/steps/functions/configureIosCredentials.js +3 -4
  72. package/dist/steps/functions/configureIosVersion.js +4 -6
  73. package/dist/steps/functions/createSubmissionEntity.js +2 -4
  74. package/dist/steps/functions/downloadArtifact.d.ts +1 -1
  75. package/dist/steps/functions/downloadArtifact.js +7 -9
  76. package/dist/steps/functions/downloadBuild.d.ts +1 -1
  77. package/dist/steps/functions/downloadBuild.js +10 -12
  78. package/dist/steps/functions/eagerBundle.js +2 -4
  79. package/dist/steps/functions/findAndUploadBuildArtifacts.js +5 -8
  80. package/dist/steps/functions/generateGymfileFromTemplate.js +6 -8
  81. package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js +0 -1
  82. package/dist/steps/functions/injectAndroidCredentials.js +3 -4
  83. package/dist/steps/functions/installMaestro.js +3 -4
  84. package/dist/steps/functions/installNodeModules.d.ts +1 -1
  85. package/dist/steps/functions/installNodeModules.js +12 -12
  86. package/dist/steps/functions/installPods.js +0 -1
  87. package/dist/steps/functions/internalMaestroTest.js +16 -16
  88. package/dist/steps/functions/prebuild.js +3 -5
  89. package/dist/steps/functions/repack.d.ts +1 -1
  90. package/dist/steps/functions/repack.js +25 -19
  91. package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js +1 -2
  92. package/dist/steps/functions/resolveBuildConfig.js +0 -1
  93. package/dist/steps/functions/restoreBuildCache.d.ts +1 -1
  94. package/dist/steps/functions/restoreBuildCache.js +8 -10
  95. package/dist/steps/functions/restoreCache.d.ts +1 -1
  96. package/dist/steps/functions/restoreCache.js +34 -26
  97. package/dist/steps/functions/runFastlane.js +0 -1
  98. package/dist/steps/functions/runGradle.js +2 -3
  99. package/dist/steps/functions/saveBuildCache.d.ts +1 -1
  100. package/dist/steps/functions/saveBuildCache.js +6 -7
  101. package/dist/steps/functions/saveCache.d.ts +1 -1
  102. package/dist/steps/functions/saveCache.js +26 -18
  103. package/dist/steps/functions/sendSlackMessage.js +1 -3
  104. package/dist/steps/functions/startAndroidEmulator.js +5 -7
  105. package/dist/steps/functions/startCuttlefishDevice.js +32 -10
  106. package/dist/steps/functions/startIosSimulator.js +8 -11
  107. package/dist/steps/functions/uploadArtifact.js +4 -6
  108. package/dist/steps/functions/uploadToAsc.d.ts +2 -0
  109. package/dist/steps/functions/uploadToAsc.js +287 -0
  110. package/dist/steps/functions/useNpmToken.js +3 -4
  111. package/dist/steps/utils/android/expoUpdates.js +3 -5
  112. package/dist/steps/utils/android/gradle.d.ts +1 -1
  113. package/dist/steps/utils/android/gradle.js +6 -7
  114. package/dist/steps/utils/android/gradleConfig.js +4 -5
  115. package/dist/steps/utils/cache.js +0 -1
  116. package/dist/steps/utils/expoUpdates.d.ts +1 -1
  117. package/dist/steps/utils/expoUpdates.js +15 -18
  118. package/dist/steps/utils/ios/AscApiClient.d.ts +250 -0
  119. package/dist/steps/utils/ios/AscApiClient.js +299 -0
  120. package/dist/steps/utils/ios/configure.js +4 -5
  121. package/dist/steps/utils/ios/credentials/credentials.js +0 -1
  122. package/dist/steps/utils/ios/credentials/distributionCertificate.js +1 -3
  123. package/dist/steps/utils/ios/credentials/keychain.js +8 -8
  124. package/dist/steps/utils/ios/credentials/manager.js +24 -13
  125. package/dist/steps/utils/ios/credentials/provisioningProfile.js +11 -6
  126. package/dist/steps/utils/ios/expoUpdates.js +4 -7
  127. package/dist/steps/utils/ios/fastlane.d.ts +1 -1
  128. package/dist/steps/utils/ios/fastlane.js +3 -4
  129. package/dist/steps/utils/ios/resolve.js +1 -2
  130. package/dist/steps/utils/ios/tvos.js +1 -3
  131. package/dist/steps/utils/ios/xcpretty.js +11 -7
  132. package/dist/steps/utils/slackMessageDynamicFields.js +0 -1
  133. package/dist/templates/EasBuildConfigureVersionGradle.js +0 -1
  134. package/dist/templates/EasBuildGradle.js +0 -1
  135. package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js +0 -1
  136. package/dist/templates/FastfileResign.js +0 -1
  137. package/dist/templates/GymfileArchive.js +0 -1
  138. package/dist/templates/GymfileSimulator.js +0 -1
  139. package/dist/templates/npmrc.js +0 -1
  140. package/dist/utils/AndroidEmulatorUtils.js +20 -22
  141. package/dist/utils/IosSimulatorUtils.js +9 -11
  142. package/dist/utils/appConfig.js +1 -2
  143. package/dist/utils/artifacts.d.ts +1 -1
  144. package/dist/utils/artifacts.js +7 -8
  145. package/dist/utils/cacheKey.js +21 -12
  146. package/dist/utils/diffFingerprintsAsync.d.ts +1 -1
  147. package/dist/utils/diffFingerprintsAsync.js +0 -1
  148. package/dist/utils/environmentSecrets.js +3 -4
  149. package/dist/utils/expoFingerprintCli.js +5 -6
  150. package/dist/utils/expoUpdates.d.ts +1 -2
  151. package/dist/utils/expoUpdates.js +19 -33
  152. package/dist/utils/expoUpdatesCli.js +20 -11
  153. package/dist/utils/files.js +23 -15
  154. package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js +27 -21
  155. package/dist/utils/fingerprint.js +0 -1
  156. package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js +0 -1
  157. package/dist/utils/hooks.js +1 -3
  158. package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.d.ts +1 -0
  159. package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.js +14 -0
  160. package/dist/utils/npmrc.js +2 -3
  161. package/dist/utils/outputs.d.ts +1 -1
  162. package/dist/utils/outputs.js +2 -5
  163. package/dist/utils/packageManager.js +22 -14
  164. package/dist/utils/prepareBuildExecutable.js +1 -2
  165. package/dist/utils/processes.js +2 -3
  166. package/dist/utils/project.js +1 -2
  167. package/dist/utils/promiseRetryWithCondition.js +0 -1
  168. package/dist/utils/resolveRuntimeVersionAsync.d.ts +1 -1
  169. package/dist/utils/resolveRuntimeVersionAsync.js +4 -6
  170. package/dist/utils/retry.js +2 -3
  171. package/dist/utils/retryOnDNSFailure.js +0 -1
  172. package/dist/utils/stepMetrics.d.ts +1 -1
  173. package/dist/utils/stepMetrics.js +0 -1
  174. package/dist/utils/strings.js +1 -3
  175. package/dist/utils/turtleFetch.d.ts +1 -1
  176. package/dist/utils/turtleFetch.js +2 -2
  177. package/package.json +25 -22
  178. package/dist/android/credentials.js.map +0 -1
  179. package/dist/android/expoUpdates.js.map +0 -1
  180. package/dist/android/gradle.js.map +0 -1
  181. package/dist/android/gradleConfig.js.map +0 -1
  182. package/dist/buildErrors/buildErrorHandlers.js.map +0 -1
  183. package/dist/buildErrors/detectError.js.map +0 -1
  184. package/dist/buildErrors/errors.types.js.map +0 -1
  185. package/dist/buildErrors/userErrorHandlers.js.map +0 -1
  186. package/dist/builders/android.js.map +0 -1
  187. package/dist/builders/common.js.map +0 -1
  188. package/dist/builders/custom.js.map +0 -1
  189. package/dist/builders/index.js.map +0 -1
  190. package/dist/builders/ios.js.map +0 -1
  191. package/dist/common/eagerBundle.js.map +0 -1
  192. package/dist/common/easBuildInternal.js.map +0 -1
  193. package/dist/common/fastlane.js.map +0 -1
  194. package/dist/common/git.js.map +0 -1
  195. package/dist/common/installDependencies.js.map +0 -1
  196. package/dist/common/prebuild.js.map +0 -1
  197. package/dist/common/projectSources.js.map +0 -1
  198. package/dist/common/setup.js.map +0 -1
  199. package/dist/context.js.map +0 -1
  200. package/dist/customBuildContext.js.map +0 -1
  201. package/dist/gcs/LoggerStream.js.map +0 -1
  202. package/dist/gcs/__unit__/gcs.test.js.map +0 -1
  203. package/dist/gcs/client.js.map +0 -1
  204. package/dist/gcs/retry.js.map +0 -1
  205. package/dist/generic.js.map +0 -1
  206. package/dist/index.js.map +0 -1
  207. package/dist/ios/configure.js.map +0 -1
  208. package/dist/ios/credentials/distributionCertificate.js.map +0 -1
  209. package/dist/ios/credentials/keychain.js.map +0 -1
  210. package/dist/ios/credentials/manager.js.map +0 -1
  211. package/dist/ios/credentials/provisioningProfile.js.map +0 -1
  212. package/dist/ios/expoUpdates.js.map +0 -1
  213. package/dist/ios/fastfile.js.map +0 -1
  214. package/dist/ios/fastlane.js.map +0 -1
  215. package/dist/ios/gymfile.js.map +0 -1
  216. package/dist/ios/pod.js.map +0 -1
  217. package/dist/ios/resign.js.map +0 -1
  218. package/dist/ios/resolve.js.map +0 -1
  219. package/dist/ios/tvos.js.map +0 -1
  220. package/dist/ios/xcodeBuildLogs.js.map +0 -1
  221. package/dist/ios/xcodeEnv.js.map +0 -1
  222. package/dist/ios/xcpretty.js.map +0 -1
  223. package/dist/steps/easFunctionGroups.js.map +0 -1
  224. package/dist/steps/easFunctions.js.map +0 -1
  225. package/dist/steps/functionGroups/build.js.map +0 -1
  226. package/dist/steps/functionGroups/maestroTest.js.map +0 -1
  227. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +0 -1
  228. package/dist/steps/functions/ccacheStats.js.map +0 -1
  229. package/dist/steps/functions/checkout.js.map +0 -1
  230. package/dist/steps/functions/configureAndroidVersion.js.map +0 -1
  231. package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +0 -1
  232. package/dist/steps/functions/configureIosCredentials.js.map +0 -1
  233. package/dist/steps/functions/configureIosVersion.js.map +0 -1
  234. package/dist/steps/functions/createSubmissionEntity.js.map +0 -1
  235. package/dist/steps/functions/downloadArtifact.js.map +0 -1
  236. package/dist/steps/functions/downloadBuild.js.map +0 -1
  237. package/dist/steps/functions/eagerBundle.js.map +0 -1
  238. package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +0 -1
  239. package/dist/steps/functions/generateGymfileFromTemplate.js.map +0 -1
  240. package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js.map +0 -1
  241. package/dist/steps/functions/injectAndroidCredentials.js.map +0 -1
  242. package/dist/steps/functions/installMaestro.js.map +0 -1
  243. package/dist/steps/functions/installNodeModules.js.map +0 -1
  244. package/dist/steps/functions/installPods.js.map +0 -1
  245. package/dist/steps/functions/internalMaestroTest.js.map +0 -1
  246. package/dist/steps/functions/prebuild.js.map +0 -1
  247. package/dist/steps/functions/repack.js.map +0 -1
  248. package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js.map +0 -1
  249. package/dist/steps/functions/resolveBuildConfig.js.map +0 -1
  250. package/dist/steps/functions/restoreBuildCache.js.map +0 -1
  251. package/dist/steps/functions/restoreCache.js.map +0 -1
  252. package/dist/steps/functions/runFastlane.js.map +0 -1
  253. package/dist/steps/functions/runGradle.js.map +0 -1
  254. package/dist/steps/functions/saveBuildCache.js.map +0 -1
  255. package/dist/steps/functions/saveCache.js.map +0 -1
  256. package/dist/steps/functions/sendSlackMessage.js.map +0 -1
  257. package/dist/steps/functions/startAndroidEmulator.js.map +0 -1
  258. package/dist/steps/functions/startCuttlefishDevice.js.map +0 -1
  259. package/dist/steps/functions/startIosSimulator.js.map +0 -1
  260. package/dist/steps/functions/uploadArtifact.js.map +0 -1
  261. package/dist/steps/functions/useNpmToken.js.map +0 -1
  262. package/dist/steps/utils/android/expoUpdates.js.map +0 -1
  263. package/dist/steps/utils/android/gradle.js.map +0 -1
  264. package/dist/steps/utils/android/gradleConfig.js.map +0 -1
  265. package/dist/steps/utils/cache.js.map +0 -1
  266. package/dist/steps/utils/expoUpdates.js.map +0 -1
  267. package/dist/steps/utils/ios/configure.js.map +0 -1
  268. package/dist/steps/utils/ios/credentials/credentials.js.map +0 -1
  269. package/dist/steps/utils/ios/credentials/distributionCertificate.js.map +0 -1
  270. package/dist/steps/utils/ios/credentials/keychain.js.map +0 -1
  271. package/dist/steps/utils/ios/credentials/manager.js.map +0 -1
  272. package/dist/steps/utils/ios/credentials/provisioningProfile.js.map +0 -1
  273. package/dist/steps/utils/ios/expoUpdates.js.map +0 -1
  274. package/dist/steps/utils/ios/fastlane.js.map +0 -1
  275. package/dist/steps/utils/ios/resolve.js.map +0 -1
  276. package/dist/steps/utils/ios/tvos.js.map +0 -1
  277. package/dist/steps/utils/ios/xcpretty.js.map +0 -1
  278. package/dist/steps/utils/slackMessageDynamicFields.js.map +0 -1
  279. package/dist/templates/EasBuildConfigureVersionGradle.js.map +0 -1
  280. package/dist/templates/EasBuildGradle.js.map +0 -1
  281. package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js.map +0 -1
  282. package/dist/templates/FastfileResign.js.map +0 -1
  283. package/dist/templates/GymfileArchive.js.map +0 -1
  284. package/dist/templates/GymfileSimulator.js.map +0 -1
  285. package/dist/templates/npmrc.js.map +0 -1
  286. package/dist/utils/AndroidEmulatorUtils.js.map +0 -1
  287. package/dist/utils/IosSimulatorUtils.js.map +0 -1
  288. package/dist/utils/appConfig.js.map +0 -1
  289. package/dist/utils/artifacts.js.map +0 -1
  290. package/dist/utils/cacheKey.js.map +0 -1
  291. package/dist/utils/diffFingerprintsAsync.js.map +0 -1
  292. package/dist/utils/environmentSecrets.js.map +0 -1
  293. package/dist/utils/expoFingerprintCli.js.map +0 -1
  294. package/dist/utils/expoUpdates.js.map +0 -1
  295. package/dist/utils/expoUpdatesCli.js.map +0 -1
  296. package/dist/utils/files.js.map +0 -1
  297. package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js.map +0 -1
  298. package/dist/utils/fingerprint.js.map +0 -1
  299. package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js.map +0 -1
  300. package/dist/utils/hooks.js.map +0 -1
  301. package/dist/utils/npmrc.js.map +0 -1
  302. package/dist/utils/outputs.js.map +0 -1
  303. package/dist/utils/packageManager.js.map +0 -1
  304. package/dist/utils/prepareBuildExecutable.js.map +0 -1
  305. package/dist/utils/processes.js.map +0 -1
  306. package/dist/utils/project.js.map +0 -1
  307. package/dist/utils/promiseRetryWithCondition.js.map +0 -1
  308. package/dist/utils/resolveRuntimeVersionAsync.js.map +0 -1
  309. package/dist/utils/retry.js.map +0 -1
  310. package/dist/utils/retryOnDNSFailure.js.map +0 -1
  311. package/dist/utils/stepMetrics.js.map +0 -1
  312. package/dist/utils/strings.js.map +0 -1
  313. package/dist/utils/turtleFetch.js.map +0 -1
@@ -4,29 +4,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = iosBuilder;
7
- const plist_1 = __importDefault(require("@expo/plist"));
8
7
  const config_plugins_1 = require("@expo/config-plugins");
9
8
  const eas_build_job_1 = require("@expo/eas-build-job");
9
+ const plist_1 = __importDefault(require("@expo/plist"));
10
10
  const fs_extra_1 = __importDefault(require("fs-extra"));
11
11
  const nullthrows_1 = __importDefault(require("nullthrows"));
12
- const expoUpdates_1 = require("../utils/expoUpdates");
13
- const artifacts_1 = require("../utils/artifacts");
14
- const hooks_1 = require("../utils/hooks");
12
+ const common_1 = require("./common");
13
+ const custom_1 = require("./custom");
14
+ const eagerBundle_1 = require("../common/eagerBundle");
15
+ const prebuild_1 = require("../common/prebuild");
16
+ const setup_1 = require("../common/setup");
15
17
  const configure_1 = require("../ios/configure");
16
18
  const manager_1 = __importDefault(require("../ios/credentials/manager"));
17
19
  const fastlane_1 = require("../ios/fastlane");
18
20
  const pod_1 = require("../ios/pod");
19
21
  const resign_1 = require("../ios/resign");
20
22
  const resolve_1 = require("../ios/resolve");
21
- const setup_1 = require("../common/setup");
22
- const prebuild_1 = require("../common/prebuild");
23
+ const restoreBuildCache_1 = require("../steps/functions/restoreBuildCache");
24
+ const saveBuildCache_1 = require("../steps/functions/saveBuildCache");
25
+ const artifacts_1 = require("../utils/artifacts");
26
+ const expoUpdates_1 = require("../utils/expoUpdates");
27
+ const hooks_1 = require("../utils/hooks");
23
28
  const prepareBuildExecutable_1 = require("../utils/prepareBuildExecutable");
24
29
  const processes_1 = require("../utils/processes");
25
- const eagerBundle_1 = require("../common/eagerBundle");
26
- const saveBuildCache_1 = require("../steps/functions/saveBuildCache");
27
- const restoreBuildCache_1 = require("../steps/functions/restoreBuildCache");
28
- const common_1 = require("./common");
29
- const custom_1 = require("./custom");
30
30
  const INSTALL_PODS_WARN_TIMEOUT_MS = 15 * 60 * 1000; // 15 minutes
31
31
  const INSTALL_PODS_KILL_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes
32
32
  class InstallPodsTimeoutError extends Error {
@@ -62,7 +62,7 @@ async function buildAsync(ctx) {
62
62
  ctx.logger.info('Skipped running "expo prebuild" because the "ios" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/');
63
63
  return;
64
64
  }
65
- const extraEnvs = (credentials === null || credentials === void 0 ? void 0 : credentials.teamId)
65
+ const extraEnvs = credentials?.teamId
66
66
  ? { APPLE_TEAM_ID: credentials.teamId }
67
67
  : {};
68
68
  await (0, prebuild_1.prebuildAsync)(ctx, {
@@ -72,12 +72,11 @@ async function buildAsync(ctx) {
72
72
  });
73
73
  });
74
74
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RESTORE_CACHE, async () => {
75
- var _a;
76
75
  if (ctx.isLocal) {
77
76
  ctx.logger.info('Local builds do not support restoring cache');
78
77
  return;
79
78
  }
80
- await ((_a = ctx.cacheManager) === null || _a === void 0 ? void 0 : _a.restoreCache(ctx));
79
+ await ctx.cacheManager?.restoreCache(ctx);
81
80
  await (0, restoreBuildCache_1.restoreCcacheAsync)({
82
81
  logger: ctx.logger,
83
82
  workingDirectory,
@@ -109,10 +108,9 @@ async function buildAsync(ctx) {
109
108
  });
110
109
  }
111
110
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {
112
- var _a, _b;
113
111
  await (0, expoUpdates_1.configureExpoUpdatesIfInstalledAsync)(ctx, {
114
- resolvedRuntimeVersion: (_a = resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion) !== null && _a !== void 0 ? _a : null,
115
- resolvedFingerprintSources: (_b = resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.fingerprintSources) !== null && _b !== void 0 ? _b : null,
112
+ resolvedRuntimeVersion: resolvedExpoUpdatesRuntimeVersion?.runtimeVersion ?? null,
113
+ resolvedFingerprintSources: resolvedExpoUpdatesRuntimeVersion?.fingerprintSources ?? null,
116
114
  });
117
115
  });
118
116
  if (!ctx.env.EAS_BUILD_DISABLE_BUNDLE_JAVASCRIPT_STEP && (0, eagerBundle_1.shouldUseEagerBundle)(ctx.metadata)) {
@@ -123,9 +121,9 @@ async function buildAsync(ctx) {
123
121
  logger: ctx.logger,
124
122
  env: {
125
123
  ...ctx.env,
126
- ...((resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion)
124
+ ...(resolvedExpoUpdatesRuntimeVersion?.runtimeVersion
127
125
  ? {
128
- EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion,
126
+ EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion?.runtimeVersion,
129
127
  EXPO_UPDATES_WORKFLOW_OVERRIDE: ctx.job.type,
130
128
  }
131
129
  : null),
@@ -142,10 +140,10 @@ async function buildAsync(ctx) {
142
140
  scheme,
143
141
  buildConfiguration,
144
142
  entitlements,
145
- ...((resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion)
143
+ ...(resolvedExpoUpdatesRuntimeVersion?.runtimeVersion
146
144
  ? {
147
145
  extraEnv: {
148
- EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion === null || resolvedExpoUpdatesRuntimeVersion === void 0 ? void 0 : resolvedExpoUpdatesRuntimeVersion.runtimeVersion,
146
+ EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion?.runtimeVersion,
149
147
  EXPO_UPDATES_WORKFLOW_OVERRIDE: ctx.job.type,
150
148
  },
151
149
  }
@@ -169,12 +167,11 @@ async function buildAsync(ctx) {
169
167
  });
170
168
  });
171
169
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.SAVE_CACHE, async () => {
172
- var _a;
173
170
  if (ctx.isLocal) {
174
171
  ctx.logger.info('Local builds do not support saving cache.');
175
172
  return;
176
173
  }
177
- await ((_a = ctx.cacheManager) === null || _a === void 0 ? void 0 : _a.saveCache(ctx));
174
+ await ctx.cacheManager?.saveCache(ctx);
178
175
  await (0, saveBuildCache_1.saveCcacheAsync)({
179
176
  logger: ctx.logger,
180
177
  workingDirectory,
@@ -251,23 +248,22 @@ async function runInstallPodsAsync(ctx) {
251
248
  try {
252
249
  const installPodsSpawnPromise = (await (0, pod_1.installPods)(ctx, {
253
250
  infoCallbackFn: () => {
254
- warnTimeout === null || warnTimeout === void 0 ? void 0 : warnTimeout.refresh();
255
- killTimeout === null || killTimeout === void 0 ? void 0 : killTimeout.refresh();
251
+ warnTimeout?.refresh();
252
+ killTimeout?.refresh();
256
253
  },
257
254
  })).spawnPromise;
258
255
  warnTimeout = setTimeout(() => {
259
256
  ctx.logger.warn('"Install pods" phase takes longer then expected and it did not produce any logs in the past 15 minutes');
260
257
  }, INSTALL_PODS_WARN_TIMEOUT_MS);
261
258
  killTimeout = setTimeout(async () => {
262
- var _a;
263
259
  timedOutToKill = true;
264
260
  ctx.logger.error('"Install pods" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened which caused the process to hang and it will be terminated');
265
261
  const ppid = (0, nullthrows_1.default)(installPodsSpawnPromise.child.pid);
266
262
  const pids = await (0, processes_1.getParentAndDescendantProcessPidsAsync)(ppid);
267
- pids.forEach((pid) => {
263
+ pids.forEach(pid => {
268
264
  process.kill(pid);
269
265
  });
270
- (_a = ctx.reportError) === null || _a === void 0 ? void 0 : _a.call(ctx, '"Install pods" phase takes a very long time', undefined, {
266
+ ctx.reportError?.('"Install pods" phase takes a very long time', undefined, {
271
267
  extras: { buildId: ctx.env.EAS_BUILD_ID },
272
268
  });
273
269
  }, INSTALL_PODS_KILL_TIMEOUT_MS);
@@ -288,4 +284,3 @@ async function runInstallPodsAsync(ctx) {
288
284
  }
289
285
  }
290
286
  }
291
- //# sourceMappingURL=ios.js.map
@@ -19,8 +19,7 @@ async function eagerBundleAsync({ platform, workingDir, logger, env, packageMana
19
19
  });
20
20
  }
21
21
  function shouldUseEagerBundle(metadata) {
22
- return Boolean(!(metadata === null || metadata === void 0 ? void 0 : metadata.developmentClient) &&
23
- (metadata === null || metadata === void 0 ? void 0 : metadata.sdkVersion) &&
24
- semver_1.default.satisfies(metadata === null || metadata === void 0 ? void 0 : metadata.sdkVersion, '>=52'));
22
+ return Boolean(!metadata?.developmentClient &&
23
+ metadata?.sdkVersion &&
24
+ semver_1.default.satisfies(metadata?.sdkVersion, '>=52'));
25
25
  }
26
- //# sourceMappingURL=eagerBundle.js.map
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.runEasBuildInternalAsync = runEasBuildInternalAsync;
7
7
  exports.resolveEnvFromBuildProfileAsync = resolveEnvFromBuildProfileAsync;
8
- const assert_1 = __importDefault(require("assert"));
9
8
  const eas_build_job_1 = require("@expo/eas-build-job");
10
9
  const logger_1 = require("@expo/logger");
11
10
  const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
11
+ const assert_1 = __importDefault(require("assert"));
12
12
  const joi_1 = __importDefault(require("joi"));
13
13
  const nullthrows_1 = __importDefault(require("nullthrows"));
14
14
  const packageManager_1 = require("../utils/packageManager");
@@ -21,11 +21,11 @@ async function runEasBuildInternalAsync({ job, logger, env, cwd, projectRootOver
21
21
  const { buildProfile, githubTriggerOptions } = job;
22
22
  (0, assert_1.default)(buildProfile, 'build profile is missing in a build from git-based integration.');
23
23
  const autoSubmitArgs = [];
24
- if (githubTriggerOptions === null || githubTriggerOptions === void 0 ? void 0 : githubTriggerOptions.submitProfile) {
24
+ if (githubTriggerOptions?.submitProfile) {
25
25
  autoSubmitArgs.push('--auto-submit-with-profile');
26
26
  autoSubmitArgs.push(githubTriggerOptions.submitProfile);
27
27
  }
28
- else if (githubTriggerOptions === null || githubTriggerOptions === void 0 ? void 0 : githubTriggerOptions.autoSubmit) {
28
+ else if (githubTriggerOptions?.autoSubmit) {
29
29
  autoSubmitArgs.push('--auto-submit');
30
30
  }
31
31
  const result = await (0, turtle_spawn_1.default)(cmd, [
@@ -57,7 +57,6 @@ async function runEasBuildInternalAsync({ job, logger, env, cwd, projectRootOver
57
57
  });
58
58
  }
59
59
  async function resolveEnvFromBuildProfileAsync(ctx, { cwd }) {
60
- var _a;
61
60
  const { cmd, args, extraEnv } = await resolveEasCommandPrefixAndEnvAsync();
62
61
  const { buildProfile } = ctx.job;
63
62
  (0, assert_1.default)(buildProfile, 'build profile is missing in a build from git-based integration.');
@@ -80,7 +79,7 @@ async function resolveEnvFromBuildProfileAsync(ctx, { cwd }) {
80
79
  }
81
80
  catch (err) {
82
81
  ctx.logger.error(`Failed to the read build profile ${buildProfile} from eas.json.`);
83
- ctx.logger.error((_a = err.stderr) === null || _a === void 0 ? void 0 : _a.toString());
82
+ ctx.logger.error(err.stderr?.toString());
84
83
  throw Error(`Failed to read the build profile ${buildProfile} from eas.json.`);
85
84
  }
86
85
  const stdout = spawnResult.stdout.toString();
@@ -142,6 +141,5 @@ function validateEnvs(result) {
142
141
  if (error) {
143
142
  throw error;
144
143
  }
145
- return value === null || value === void 0 ? void 0 : value.env;
144
+ return value?.env;
146
145
  }
147
- //# sourceMappingURL=easBuildInternal.js.map
@@ -8,4 +8,3 @@ exports.COMMON_FASTLANE_ENV = {
8
8
  FASTLANE_HIDE_TIMESTAMP: 'true',
9
9
  LC_ALL: 'en_US.UTF-8',
10
10
  };
11
- //# sourceMappingURL=fastlane.js.map
@@ -81,4 +81,3 @@ function getStrippedBranchOrTagName(ref) {
81
81
  type: 'other',
82
82
  };
83
83
  }
84
- //# sourceMappingURL=git.js.map
@@ -1,5 +1,5 @@
1
1
  import { Job } from '@expo/eas-build-job';
2
- import { SpawnPromise, SpawnResult, SpawnOptions } from '@expo/turtle-spawn';
2
+ import { SpawnOptions, SpawnPromise, SpawnResult } from '@expo/turtle-spawn';
3
3
  import { BuildContext } from '../context';
4
4
  import { PackageManager } from '../utils/packageManager';
5
5
  export declare function installDependenciesAsync({ packageManager, env, logger, infoCallbackFn, cwd, useFrozenLockfile, }: {
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.installDependenciesAsync = installDependenciesAsync;
7
7
  exports.resolvePackagerDir = resolvePackagerDir;
8
- const path_1 = __importDefault(require("path"));
9
8
  const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
9
+ const path_1 = __importDefault(require("path"));
10
10
  const packageManager_1 = require("../utils/packageManager");
11
11
  const project_1 = require("../utils/project");
12
12
  async function installDependenciesAsync({ packageManager, env, logger, infoCallbackFn, cwd, useFrozenLockfile, }) {
@@ -66,4 +66,3 @@ function resolvePackagerDir(ctx) {
66
66
  }
67
67
  return packagerRunDir;
68
68
  }
69
- //# sourceMappingURL=installDependencies.js.map
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.prebuildAsync = prebuildAsync;
4
- const project_1 = require("../utils/project");
5
4
  const installDependencies_1 = require("./installDependencies");
5
+ const project_1 = require("../utils/project");
6
6
  async function prebuildAsync(ctx, { logger, workingDir, options }) {
7
7
  const spawnOptions = {
8
8
  cwd: workingDir,
9
9
  logger,
10
10
  env: {
11
11
  EXPO_IMAGE_UTILS_NO_SHARP: '1',
12
- ...options === null || options === void 0 ? void 0 : options.extraEnvs,
12
+ ...options?.extraEnvs,
13
13
  ...ctx.env,
14
14
  },
15
15
  };
@@ -30,8 +30,7 @@ async function prebuildAsync(ctx, { logger, workingDir, options }) {
30
30
  await installDependenciesSpawnPromise;
31
31
  }
32
32
  function getPrebuildCommandArgs(ctx) {
33
- var _a, _b;
34
- let prebuildCommand = (_b = (_a = ctx.job.experimental) === null || _a === void 0 ? void 0 : _a.prebuildCommand) !== null && _b !== void 0 ? _b : `prebuild --no-install --platform ${ctx.job.platform}`;
33
+ let prebuildCommand = ctx.job.experimental?.prebuildCommand ?? `prebuild --no-install --platform ${ctx.job.platform}`;
35
34
  if (!prebuildCommand.match(/(?:--platform| -p)/)) {
36
35
  prebuildCommand = `${prebuildCommand} --platform ${ctx.job.platform}`;
37
36
  }
@@ -49,4 +48,3 @@ function getPrebuildCommandArgs(ctx) {
49
48
  }
50
49
  return prebuildCommand.split(' ');
51
50
  }
52
- //# sourceMappingURL=prebuild.js.map
@@ -5,20 +5,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.prepareProjectSourcesAsync = prepareProjectSourcesAsync;
7
7
  exports.downloadAndUnpackProjectFromTarGzAsync = downloadAndUnpackProjectFromTarGzAsync;
8
- const path_1 = __importDefault(require("path"));
9
- const promises_1 = __importDefault(require("fs/promises"));
10
- const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
11
- const node_fetch_1 = __importDefault(require("node-fetch"));
12
- const eas_build_job_1 = require("@expo/eas-build-job");
13
8
  const downloader_1 = __importDefault(require("@expo/downloader"));
14
- const zod_1 = require("zod");
9
+ const eas_build_job_1 = require("@expo/eas-build-job");
15
10
  const results_1 = require("@expo/results");
16
- const nullthrows_1 = __importDefault(require("nullthrows"));
11
+ const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
12
+ const promises_1 = __importDefault(require("fs/promises"));
17
13
  const gql_tada_1 = require("gql.tada");
18
- const turtleFetch_1 = require("../utils/turtleFetch");
14
+ const node_fetch_1 = __importDefault(require("node-fetch"));
15
+ const nullthrows_1 = __importDefault(require("nullthrows"));
16
+ const path_1 = __importDefault(require("path"));
17
+ const zod_1 = require("zod");
19
18
  const git_1 = require("./git");
19
+ const turtleFetch_1 = require("../utils/turtleFetch");
20
20
  async function prepareProjectSourcesAsync(ctx, destinationDirectory) {
21
- var _a;
22
21
  let projectArchive = ctx.job.projectArchive;
23
22
  if (ctx.isLocal) {
24
23
  console.warn('Local build, skipping project archive refresh');
@@ -28,7 +27,7 @@ async function prepareProjectSourcesAsync(ctx, destinationDirectory) {
28
27
  if (!projectArchiveResult.ok) {
29
28
  ctx.logger.error({ err: projectArchiveResult.reason }, 'Failed to refresh project archive, falling back to the original one');
30
29
  }
31
- projectArchive = (_a = projectArchiveResult.value) !== null && _a !== void 0 ? _a : ctx.job.projectArchive;
30
+ projectArchive = projectArchiveResult.value ?? ctx.job.projectArchive;
32
31
  }
33
32
  switch (projectArchive.type) {
34
33
  case eas_build_job_1.ArchiveSourceType.R2:
@@ -60,13 +59,12 @@ async function prepareProjectSourcesAsync(ctx, destinationDirectory) {
60
59
  }
61
60
  }
62
61
  async function downloadAndUnpackProjectFromTarGzAsync(ctx, projectArchiveUrl, destinationDirectory) {
63
- var _a;
64
62
  const projectTarball = path_1.default.join(ctx.workingdir, 'project.tar.gz');
65
63
  try {
66
64
  await (0, downloader_1.default)(projectArchiveUrl, projectTarball, { retry: 3 });
67
65
  }
68
66
  catch (err) {
69
- (_a = ctx.reportError) === null || _a === void 0 ? void 0 : _a.call(ctx, 'Failed to download project archive', err, {
67
+ ctx.reportError?.('Failed to download project archive', err, {
70
68
  extras: { buildId: ctx.env.EAS_BUILD_ID },
71
69
  });
72
70
  throw err;
@@ -135,7 +133,7 @@ async function uploadProjectMetadataAsync(ctx, { projectDirectory }) {
135
133
  const sortedFiles = files
136
134
  .map(
137
135
  // Prepend entries with "project/"
138
- (f) => path_1.default.join('project', f))
136
+ f => path_1.default.join('project', f))
139
137
  .sort(); // Sort for consistent ordering
140
138
  const result = await ctx.graphqlClient
141
139
  .mutation((0, gql_tada_1.graphql)(`
@@ -183,10 +181,9 @@ async function uploadProjectMetadataAsync(ctx, { projectDirectory }) {
183
181
  }
184
182
  }
185
183
  async function fetchProjectArchiveSourceAsync(ctx) {
186
- var _a;
187
184
  const taskId = (0, nullthrows_1.default)(ctx.env.EAS_BUILD_ID, 'EAS_BUILD_ID is not set');
188
185
  const expoApiServerURL = (0, nullthrows_1.default)(ctx.env.__API_SERVER_URL, '__API_SERVER_URL is not set');
189
- const robotAccessToken = (0, nullthrows_1.default)((_a = ctx.job.secrets) === null || _a === void 0 ? void 0 : _a.robotAccessToken, 'robot access token is not set');
186
+ const robotAccessToken = (0, nullthrows_1.default)(ctx.job.secrets?.robotAccessToken, 'robot access token is not set');
190
187
  const response = await (0, turtleFetch_1.turtleFetch)(new URL(ctx.job.platform
191
188
  ? `/v2/turtle-builds/${taskId}/download-project-archive`
192
189
  : `/v2/turtle-job-runs/${taskId}/download-project-archive`, expoApiServerURL).toString(), 'POST', {
@@ -211,4 +208,3 @@ async function fetchProjectArchiveSourceAsync(ctx) {
211
208
  }
212
209
  return dataResult.data.data;
213
210
  }
214
- //# sourceMappingURL=projectSources.js.map
@@ -4,23 +4,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.setupAsync = setupAsync;
7
- const path_1 = __importDefault(require("path"));
8
- const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
9
- const fs_extra_1 = __importDefault(require("fs-extra"));
10
7
  const eas_build_job_1 = require("@expo/eas-build-job");
11
8
  const common_1 = require("@expo/eas-build-job/dist/common");
12
- const nullthrows_1 = __importDefault(require("nullthrows"));
13
9
  const errors_1 = require("@expo/eas-build-job/dist/errors");
10
+ const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
11
+ const fs_extra_1 = __importDefault(require("fs-extra"));
12
+ const nullthrows_1 = __importDefault(require("nullthrows"));
13
+ const path_1 = __importDefault(require("path"));
14
+ const easBuildInternal_1 = require("./easBuildInternal");
15
+ const installDependencies_1 = require("./installDependencies");
16
+ const projectSources_1 = require("./projectSources");
14
17
  const xcodeEnv_1 = require("../ios/xcodeEnv");
15
18
  const hooks_1 = require("../utils/hooks");
16
19
  const npmrc_1 = require("../utils/npmrc");
17
20
  const packageManager_1 = require("../utils/packageManager");
18
- const project_1 = require("../utils/project");
19
21
  const processes_1 = require("../utils/processes");
22
+ const project_1 = require("../utils/project");
20
23
  const retry_1 = require("../utils/retry");
21
- const projectSources_1 = require("./projectSources");
22
- const installDependencies_1 = require("./installDependencies");
23
- const easBuildInternal_1 = require("./easBuildInternal");
24
24
  const MAX_EXPO_DOCTOR_TIMEOUT_MS = 30 * 1000;
25
25
  const INSTALL_DEPENDENCIES_WARN_TIMEOUT_MS = 15 * 60 * 1000;
26
26
  const INSTALL_DEPENDENCIES_KILL_TIMEOUT_MS = 30 * 60 * 1000;
@@ -29,7 +29,6 @@ class DoctorTimeoutError extends Error {
29
29
  class InstallDependenciesTimeoutError extends Error {
30
30
  }
31
31
  async function setupAsync(ctx) {
32
- var _a;
33
32
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PREPARE_PROJECT, async () => {
34
33
  await (0, retry_1.retryAsync)(async () => {
35
34
  await fs_extra_1.default.rm(ctx.buildDirectory, { recursive: true, force: true });
@@ -38,7 +37,7 @@ async function setupAsync(ctx) {
38
37
  }, {
39
38
  retryOptions: {
40
39
  retries: 3,
41
- retryIntervalMs: 1000,
40
+ retryIntervalMs: 1_000,
42
41
  },
43
42
  });
44
43
  await (0, npmrc_1.setUpNpmrcAsync)(ctx, ctx.logger);
@@ -74,15 +73,16 @@ async function setupAsync(ctx) {
74
73
  return packageJson;
75
74
  });
76
75
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.INSTALL_DEPENDENCIES, async () => {
77
- var _a, _b, _c, _d;
78
- const expoVersion = (_b = (_a = ctx.metadata) === null || _a === void 0 ? void 0 : _a.sdkVersion) !== null && _b !== void 0 ? _b : (0, packageManager_1.getPackageVersionFromPackageJson)({
79
- packageJson,
80
- packageName: 'expo',
81
- });
82
- const reactNativeVersion = (_d = (_c = ctx.metadata) === null || _c === void 0 ? void 0 : _c.reactNativeVersion) !== null && _d !== void 0 ? _d : (0, packageManager_1.getPackageVersionFromPackageJson)({
83
- packageJson,
84
- packageName: 'react-native',
85
- });
76
+ const expoVersion = ctx.metadata?.sdkVersion ??
77
+ (0, packageManager_1.getPackageVersionFromPackageJson)({
78
+ packageJson,
79
+ packageName: 'expo',
80
+ });
81
+ const reactNativeVersion = ctx.metadata?.reactNativeVersion ??
82
+ (0, packageManager_1.getPackageVersionFromPackageJson)({
83
+ packageJson,
84
+ packageName: 'react-native',
85
+ });
86
86
  await runInstallDependenciesAsync(ctx, {
87
87
  useFrozenLockfile: (0, packageManager_1.shouldUseFrozenLockfile)({
88
88
  env: ctx.env,
@@ -99,11 +99,10 @@ async function setupAsync(ctx) {
99
99
  });
100
100
  if (ctx.job.triggeredBy === common_1.BuildTrigger.GIT_BASED_INTEGRATION) {
101
101
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.EAS_BUILD_INTERNAL, async () => {
102
- var _a, _b;
103
- if (!((_a = ctx.appConfig.ios) === null || _a === void 0 ? void 0 : _a.bundleIdentifier) && ctx.job.platform === eas_build_job_1.Platform.IOS) {
102
+ if (!ctx.appConfig.ios?.bundleIdentifier && ctx.job.platform === eas_build_job_1.Platform.IOS) {
104
103
  throw new Error('The "ios.bundleIdentifier" is required to be set in app config for builds triggered by GitHub integration. Learn more: https://docs.expo.dev/versions/latest/config/app/#bundleidentifier.');
105
104
  }
106
- if (!((_b = ctx.appConfig.android) === null || _b === void 0 ? void 0 : _b.package) && ctx.job.platform === eas_build_job_1.Platform.ANDROID) {
105
+ if (!ctx.appConfig.android?.package && ctx.job.platform === eas_build_job_1.Platform.ANDROID) {
107
106
  throw new Error('The "android.package" is required to be set in app config for builds triggered by GitHub integration. Learn more: https://docs.expo.dev/versions/latest/config/app/#package.');
108
107
  }
109
108
  const { newJob, newMetadata } = await (0, easBuildInternal_1.runEasBuildInternalAsync)({
@@ -116,7 +115,7 @@ async function setupAsync(ctx) {
116
115
  ctx.updateJobInformation(newJob, newMetadata);
117
116
  });
118
117
  }
119
- const hasExpoPackage = !!((_a = packageJson.dependencies) === null || _a === void 0 ? void 0 : _a.expo);
118
+ const hasExpoPackage = !!packageJson.dependencies?.expo;
120
119
  if (!ctx.env.EAS_BUILD_DISABLE_EXPO_DOCTOR_STEP && hasExpoPackage) {
121
120
  await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_EXPO_DOCTOR, async () => {
122
121
  try {
@@ -147,14 +146,13 @@ async function runExpoDoctor(ctx) {
147
146
  env: ctx.env,
148
147
  });
149
148
  timeout = setTimeout(async () => {
150
- var _a;
151
149
  timedOut = true;
152
150
  const ppid = (0, nullthrows_1.default)(promise.child.pid);
153
151
  const pids = await (0, processes_1.getParentAndDescendantProcessPidsAsync)(ppid);
154
- pids.forEach((pid) => {
152
+ pids.forEach(pid => {
155
153
  process.kill(pid);
156
154
  });
157
- (_a = ctx.reportError) === null || _a === void 0 ? void 0 : _a.call(ctx, `"expo doctor" timed out`, undefined, {
155
+ ctx.reportError?.(`"expo doctor" timed out`, undefined, {
158
156
  extras: { buildId: ctx.env.EAS_BUILD_ID },
159
157
  });
160
158
  }, MAX_EXPO_DOCTOR_TIMEOUT_MS);
@@ -196,15 +194,14 @@ async function runInstallDependenciesAsync(ctx, { useFrozenLockfile, }) {
196
194
  ctx.logger.warn('"Install dependencies" phase takes longer then expected and it did not produce any logs in the past 15 minutes. Consider evaluating your package.json file for possible issues with dependencies');
197
195
  }, INSTALL_DEPENDENCIES_WARN_TIMEOUT_MS);
198
196
  killTimeout = setTimeout(async () => {
199
- var _a;
200
197
  killTimedOut = true;
201
198
  ctx.logger.error('"Install dependencies" phase takes a very long time and it did not produce any logs in the past 30 minutes. Most likely an unexpected error happened with your dependencies which caused the process to hang and it will be terminated');
202
199
  const ppid = (0, nullthrows_1.default)(installDependenciesSpawnPromise.child.pid);
203
200
  const pids = await (0, processes_1.getParentAndDescendantProcessPidsAsync)(ppid);
204
- pids.forEach((pid) => {
201
+ pids.forEach(pid => {
205
202
  process.kill(pid);
206
203
  });
207
- (_a = ctx.reportError) === null || _a === void 0 ? void 0 : _a.call(ctx, '"Install dependencies" phase takes a very long time', undefined, {
204
+ ctx.reportError?.('"Install dependencies" phase takes a very long time', undefined, {
208
205
  extras: { buildId: ctx.env.EAS_BUILD_ID },
209
206
  });
210
207
  }, INSTALL_DEPENDENCIES_KILL_TIMEOUT_MS);
@@ -226,8 +223,7 @@ async function runInstallDependenciesAsync(ctx, { useFrozenLockfile, }) {
226
223
  }
227
224
  }
228
225
  async function validateAppConfigAsync(ctx, appConfig) {
229
- var _a, _b, _c, _d;
230
- if (((_b = (_a = appConfig === null || appConfig === void 0 ? void 0 : appConfig.extra) === null || _a === void 0 ? void 0 : _a.eas) === null || _b === void 0 ? void 0 : _b.projectId) &&
226
+ if (appConfig?.extra?.eas?.projectId &&
231
227
  ctx.env.EAS_BUILD_PROJECT_ID &&
232
228
  appConfig.extra.eas.projectId !== ctx.env.EAS_BUILD_PROJECT_ID) {
233
229
  const isUsingDynamicConfig = (await fs_extra_1.default.pathExists(path_1.default.join(ctx.getReactNativeProjectDirectory(), 'app.config.ts'))) ||
@@ -247,9 +243,8 @@ async function validateAppConfigAsync(ctx, appConfig) {
247
243
  }
248
244
  throw new errors_1.UserFacingError('EAS_BUILD_PROJECT_ID_MISMATCH', `The value of the "extra.eas.projectId" field (${appConfig.extra.eas.projectId}) in the app config does not match the current project id (${ctx.env.EAS_BUILD_PROJECT_ID}). ${extraMessage}Learn more: https://expo.fyi/eas-config-mismatch.`);
249
245
  }
250
- else if (ctx.env.EAS_BUILD_PROJECT_ID && !((_d = (_c = appConfig === null || appConfig === void 0 ? void 0 : appConfig.extra) === null || _c === void 0 ? void 0 : _c.eas) === null || _d === void 0 ? void 0 : _d.projectId)) {
246
+ else if (ctx.env.EAS_BUILD_PROJECT_ID && !appConfig?.extra?.eas?.projectId) {
251
247
  ctx.logger.error(`The "extra.eas.projectId" field is missing from your app config.`);
252
248
  ctx.markBuildPhaseHasWarnings();
253
249
  }
254
250
  }
255
- //# sourceMappingURL=setup.js.map
package/dist/context.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ManagedArtifactType, BuildPhase, BuildPhaseStats, Job, Env, Metadata, GenericArtifactType } from '@expo/eas-build-job';
2
1
  import { ExpoConfig } from '@expo/config';
2
+ import { BuildPhase, BuildPhaseStats, Env, GenericArtifactType, Job, ManagedArtifactType, Metadata } from '@expo/eas-build-job';
3
3
  import { bunyan } from '@expo/logger';
4
4
  import { Client } from '@urql/core';
5
5
  import { PackageManager } from './utils/packageManager';