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
@@ -106,9 +106,8 @@ class ProjectInit extends EasCommand_1.default {
106
106
  }
107
107
  }
108
108
  static async setExplicitIDAsync(projectId, projectDir, { force, nonInteractive }) {
109
- var _c, _d;
110
109
  const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir);
111
- const existingProjectId = (_d = (_c = exp.extra) === null || _c === void 0 ? void 0 : _c.eas) === null || _d === void 0 ? void 0 : _d.projectId;
110
+ const existingProjectId = exp.extra?.eas?.projectId;
112
111
  if (projectId === existingProjectId) {
113
112
  log_1.default.succeed(`Project already linked (ID: ${chalk_1.default.bold(existingProjectId)})`);
114
113
  return;
@@ -141,16 +140,15 @@ class ProjectInit extends EasCommand_1.default {
141
140
  });
142
141
  }
143
142
  static async initializeWithInteractiveSelectionAsync(graphqlClient, actor, projectDir) {
144
- var _c, _d, _e;
145
143
  const exp = (0, expoConfig_1.getPrivateExpoConfig)(projectDir);
146
- const existingProjectId = (_d = (_c = exp.extra) === null || _c === void 0 ? void 0 : _c.eas) === null || _d === void 0 ? void 0 : _d.projectId;
144
+ const existingProjectId = exp.extra?.eas?.projectId;
147
145
  if (existingProjectId) {
148
146
  log_1.default.succeed(`Project already linked (ID: ${chalk_1.default.bold(existingProjectId)}). To re-configure, remove the "extra.eas.projectId" field from your app config.`);
149
147
  return existingProjectId;
150
148
  }
151
149
  const allAccounts = actor.accounts;
152
150
  const accountNamesWhereUserHasSufficientPermissionsToCreateApp = new Set(allAccounts
153
- .filter(a => { var _c; return ((_c = a.users.find(it => it.actor.id === actor.id)) === null || _c === void 0 ? void 0 : _c.role) !== generated_1.Role.ViewOnly; })
151
+ .filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
154
152
  .map(it => it.name));
155
153
  // if no owner field, ask the user which account they want to use to create/link the project
156
154
  let accountName = exp.owner;
@@ -202,7 +200,7 @@ class ProjectInit extends EasCommand_1.default {
202
200
  createdProjectId = await AppMutation_1.AppMutation.createAppAsync(graphqlClient, {
203
201
  accountId: account.id,
204
202
  projectName,
205
- privacy: (_e = (0, projectUtils_1.toAppPrivacy)(exp.privacy)) !== null && _e !== void 0 ? _e : generated_1.AppPrivacy.Public,
203
+ privacy: (0, projectUtils_1.toAppPrivacy)(exp.privacy) ?? generated_1.AppPrivacy.Public,
206
204
  });
207
205
  spinner.succeed(`Created ${chalk_1.default.bold(projectLink)}`);
208
206
  }
@@ -219,7 +217,7 @@ class ProjectInit extends EasCommand_1.default {
219
217
  ? allAccounts
220
218
  : [...allAccounts].sort((a, _b) => actor.__typename === 'User' ? (a.name === actor.username ? -1 : 1) : 0);
221
219
  if (actor.__typename !== 'Robot') {
222
- const personalAccount = allAccounts === null || allAccounts === void 0 ? void 0 : allAccounts.find(account => { var _c; return ((_c = account === null || account === void 0 ? void 0 : account.ownerUserActor) === null || _c === void 0 ? void 0 : _c.id) === actor.id; });
220
+ const personalAccount = allAccounts?.find(account => account?.ownerUserActor?.id === actor.id);
223
221
  const personalAccountChoice = personalAccount
224
222
  ? {
225
223
  title: personalAccount.name,
@@ -229,14 +227,18 @@ class ProjectInit extends EasCommand_1.default {
229
227
  : '(Personal)',
230
228
  }
231
229
  : undefined;
232
- const userAccounts = allAccounts === null || allAccounts === void 0 ? void 0 : allAccounts.filter(account => account.ownerUserActor && account.name !== actor.username).map(account => ({
230
+ const userAccounts = allAccounts
231
+ ?.filter(account => account.ownerUserActor && account.name !== actor.username)
232
+ .map(account => ({
233
233
  title: account.name,
234
234
  value: account,
235
235
  description: !namesWithSufficientPermissions.has(account.name)
236
236
  ? '(Team) (Viewer Role)'
237
237
  : '(Team)',
238
238
  }));
239
- const organizationAccounts = allAccounts === null || allAccounts === void 0 ? void 0 : allAccounts.filter(account => account.name !== actor.username && !account.ownerUserActor).map(account => ({
239
+ const organizationAccounts = allAccounts
240
+ ?.filter(account => account.name !== actor.username && !account.ownerUserActor)
241
+ .map(account => ({
240
242
  title: account.name,
241
243
  value: account,
242
244
  description: !namesWithSufficientPermissions.has(account.name)
@@ -3,7 +3,11 @@ var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
8
+ const path_1 = tslib_1.__importDefault(require("path"));
6
9
  const api_1 = require("../../api");
10
+ const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
7
11
  const repository_1 = require("../../build/utils/repository");
8
12
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
13
  const getProjectIdAsync_1 = require("../../commandUtils/context/contextUtils/getProjectIdAsync");
@@ -14,8 +18,11 @@ const AppQuery_1 = require("../../graphql/queries/AppQuery");
14
18
  const log_1 = tslib_1.__importStar(require("../../log"));
15
19
  const git_1 = require("../../onboarding/git");
16
20
  const installDependencies_1 = require("../../onboarding/installDependencies");
21
+ const runCommand_1 = require("../../onboarding/runCommand");
22
+ const platform_1 = require("../../platform");
17
23
  const expoConfig_1 = require("../../project/expoConfig");
18
24
  const prompts_1 = require("../../prompts");
25
+ const easCli_1 = require("../../utils/easCli");
19
26
  const git_2 = tslib_1.__importDefault(require("../../vcs/clients/git"));
20
27
  class Onboarding extends EasCommand_1.default {
21
28
  async runAsync() {
@@ -41,7 +48,6 @@ class Onboarding extends EasCommand_1.default {
41
48
  if (new Date(actor.preferences.onboarding.lastUsed) < new Date(Date.now() - 1000 * 60 * 60 * 24)) {
42
49
  log_1.default.warn('It seems like you started an onboarding process, but it has been a while since you last used it. If you want to start a new onboarding process, visit https://expo.new.');
43
50
  log_1.default.log();
44
- return;
45
51
  }
46
52
  const platform = actor.preferences.onboarding.platform === generated_1.AppPlatform.Android
47
53
  ? eas_build_job_1.Platform.ANDROID
@@ -52,8 +58,7 @@ class Onboarding extends EasCommand_1.default {
52
58
  : 'expo';
53
59
  const githubRepositoryName = app.githubRepository
54
60
  ? app.githubRepository.metadata.githubRepoName
55
- : 'expo-default-template';
56
- const initialTargetProjectDir = targetProjectDirInput !== null && targetProjectDirInput !== void 0 ? targetProjectDirInput : `./${githubRepositoryName}`;
61
+ : 'expo-template-default';
57
62
  log_1.default.log(`👋 Welcome to Expo, ${actor.username}!`);
58
63
  log_1.default.log();
59
64
  log_1.default.log('✨ We will continue your onboarding process in EAS CLI');
@@ -62,66 +67,150 @@ class Onboarding extends EasCommand_1.default {
62
67
  ? `your project (${githubUsername}/${githubRepositoryName})`
63
68
  : `default Expo template project (${githubUsername}/${githubRepositoryName})`} from GitHub and installing dependencies.`);
64
69
  log_1.default.log();
65
- const shouldContinueWithDefaultTargetDirectory = await (0, prompts_1.confirmAsync)({
66
- message: `Do you want to clone your project into ${initialTargetProjectDir}?`,
67
- });
68
- let targetProjectDir = initialTargetProjectDir;
69
- if (!shouldContinueWithDefaultTargetDirectory) {
70
- const { newTargetProjectDir } = await (0, prompts_1.promptAsync)({
70
+ let initialTargetProjectDirectory;
71
+ if (targetProjectDirInput) {
72
+ initialTargetProjectDirectory = targetProjectDirInput;
73
+ log_1.default.log(`📂 Cloning the project to ${initialTargetProjectDirectory}`);
74
+ }
75
+ else {
76
+ const { selectedTargetProjectDirectory } = await (0, prompts_1.promptAsync)({
71
77
  type: 'text',
72
- name: 'newTargetProjectDir',
73
- message: 'Provide a new target directory path:',
74
- validate: (input) => input !== '',
78
+ name: 'selectedTargetProjectDirectory',
79
+ message: app.githubRepository
80
+ ? '📂 Where would you like to clone the project to?'
81
+ : '📂 Where would you like to create your new project directory?',
82
+ initial: app.githubRepository
83
+ ? path_1.default.join(process.cwd(), githubRepositoryName)
84
+ : path_1.default.join(process.cwd(), `${actor.username}-first-project`),
75
85
  });
76
- targetProjectDir = newTargetProjectDir;
86
+ initialTargetProjectDirectory = selectedTargetProjectDirectory;
77
87
  }
78
88
  log_1.default.log();
79
89
  const { targetProjectDir: finalTargetProjectDirectory } = await (0, git_1.runGitCloneAsync)({
80
90
  githubUsername,
81
91
  githubRepositoryName,
82
- targetProjectDir,
92
+ targetProjectDir: initialTargetProjectDirectory,
83
93
  });
84
94
  const vcsClient = new git_2.default(finalTargetProjectDirectory);
95
+ if (!app.githubRepository) {
96
+ await fs_extra_1.default.remove(path_1.default.join(finalTargetProjectDirectory, '.git'));
97
+ await (0, runCommand_1.runCommandAsync)({
98
+ cwd: finalTargetProjectDirectory,
99
+ command: 'git',
100
+ args: ['init'],
101
+ });
102
+ log_1.default.log();
103
+ await configureProjectFromBareDefaultExpoTemplateAsync({
104
+ app,
105
+ vcsClient,
106
+ targetDir: finalTargetProjectDirectory,
107
+ });
108
+ }
109
+ const exp = await getPrivateExpoConfigWithProjectIdAsync({
110
+ projectDir: finalTargetProjectDirectory,
111
+ graphqlClient,
112
+ actor,
113
+ });
114
+ const getDynamicProjectConfigFn = getDynamicPrivateProjectConfigGetter({
115
+ projectDir: finalTargetProjectDirectory,
116
+ graphqlClient,
117
+ actor,
118
+ });
85
119
  await (0, installDependencies_1.installDependenciesAsync)({
86
120
  projectDir: finalTargetProjectDirectory,
87
121
  });
122
+ if (!app.githubRepository) {
123
+ await (0, runCommand_1.runCommandAsync)({
124
+ cwd: finalTargetProjectDirectory,
125
+ command: 'npx',
126
+ args: ['expo', 'install', 'expo-updates'],
127
+ });
128
+ log_1.default.log();
129
+ await (0, runCommand_1.runCommandAsync)({
130
+ cwd: finalTargetProjectDirectory,
131
+ command: 'npx',
132
+ args: ['expo', 'install', 'expo-insights'],
133
+ });
134
+ log_1.default.log();
135
+ await (0, runCommand_1.runCommandAsync)({
136
+ cwd: finalTargetProjectDirectory,
137
+ command: 'npx',
138
+ args: ['expo', 'install', 'expo-dev-client'],
139
+ });
140
+ log_1.default.log();
141
+ }
88
142
  await vcsClient.trackFileAsync('package-lock.json');
89
- const shouldSetupCredentials = actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Device &&
143
+ const shouldSetupCredentials = ((platform === eas_build_job_1.Platform.IOS &&
144
+ actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Device) ||
145
+ platform === eas_build_job_1.Platform.ANDROID) &&
90
146
  actor.preferences.onboarding.environment === generated_1.OnboardingEnvironment.DevBuild;
91
147
  if (shouldSetupCredentials) {
92
148
  log_1.default.log('🔑 Now we need to set up build credentials for your project:');
93
- await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, await getPrivateExpoConfigWithProjectIdAsync({
94
- projectDir: finalTargetProjectDirectory,
95
- graphqlClient,
96
- actor,
97
- }), getDynamicPrivateProjectConfigGetter({
98
- projectDir: finalTargetProjectDirectory,
99
- graphqlClient,
100
- actor,
101
- }), platform, 'development', finalTargetProjectDirectory).runAsync();
149
+ await new SetUpBuildCredentialsCommandAction_1.SetUpBuildCredentialsCommandAction(actor, graphqlClient, vcsClient, analytics, exp, getDynamicProjectConfigFn, platform, actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Simulator
150
+ ? 'development-simulator'
151
+ : 'development', finalTargetProjectDirectory).runAsync();
102
152
  }
103
- if (await vcsClient.hasUncommittedChangesAsync()) {
153
+ if (app.githubRepository && (await vcsClient.hasUncommittedChangesAsync())) {
104
154
  log_1.default.log('📦 We will now commit the changes made by the configuration process and push them to GitHub:');
105
155
  log_1.default.log();
106
156
  log_1.default.log('🔍 Checking for changes in the repository...');
107
157
  await vcsClient.showChangedFilesAsync();
108
- await (0, repository_1.reviewAndCommitChangesAsync)(vcsClient, `[eas-onboarding] Install dependencies${shouldSetupCredentials ? 'and set up build credentials' : ''}`, { nonInteractive: false });
158
+ await (0, repository_1.reviewAndCommitChangesAsync)(vcsClient, `[eas-onboarding] Install dependencies${shouldSetupCredentials ? ' and set up build credentials' : ''}`, { nonInteractive: false });
109
159
  log_1.default.log('📤 Pushing changes to GitHub...');
110
160
  await (0, git_1.runGitPushAsync)({
111
161
  targetProjectDir: finalTargetProjectDirectory,
112
162
  });
113
163
  }
164
+ else if (!app.githubRepository) {
165
+ await (0, runCommand_1.runCommandAsync)({
166
+ cwd: finalTargetProjectDirectory,
167
+ command: 'git',
168
+ args: ['add', '.'],
169
+ });
170
+ log_1.default.log();
171
+ await (0, runCommand_1.runCommandAsync)({
172
+ cwd: finalTargetProjectDirectory,
173
+ command: 'git',
174
+ args: ['commit', '-m', 'Initial commit'],
175
+ });
176
+ log_1.default.log();
177
+ }
178
+ log_1.default.log();
179
+ log_1.default.log('🎉 We finished configuring your project.');
180
+ log_1.default.log();
181
+ if (app.githubRepository ||
182
+ actor.preferences.onboarding.environment === generated_1.OnboardingEnvironment.ExpoGo) {
183
+ log_1.default.log('🚀 You can now go back to the website to continue:');
184
+ const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
185
+ log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
186
+ }
187
+ else {
188
+ log_1.default.log('🚀 Now we are going to trigger your first build');
189
+ log_1.default.log();
190
+ const { buildIds } = await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(graphqlClient, analytics, vcsClient, finalTargetProjectDirectory, {
191
+ nonInteractive: true,
192
+ requestedPlatform: platform === eas_build_job_1.Platform.ANDROID ? platform_1.RequestedPlatform.Android : platform_1.RequestedPlatform.Ios,
193
+ profile: actor.preferences.onboarding.deviceType === generated_1.OnboardingDeviceType.Simulator
194
+ ? 'development-simulator'
195
+ : 'development',
196
+ wait: false,
197
+ clearCache: false,
198
+ json: false,
199
+ autoSubmit: false,
200
+ localBuildOptions: {},
201
+ freezeCredentials: false,
202
+ }, actor, getDynamicProjectConfigFn);
203
+ const buildId = buildIds[0];
204
+ log_1.default.log();
205
+ log_1.default.log('🚀 You can now go back to the website to continue:');
206
+ const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}&buildId=${buildId}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
207
+ log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
208
+ }
114
209
  const { __typename, ...previousPreferences } = actor.preferences.onboarding;
115
210
  await UserPreferencesMutation_1.UserPreferencesMutation.markCliDoneInOnboardingUserPreferencesAsync(graphqlClient, {
116
211
  ...previousPreferences,
117
212
  appId: app.id,
118
213
  });
119
- log_1.default.log();
120
- log_1.default.log('🎉 We finished configuring your project.');
121
- log_1.default.log();
122
- log_1.default.log('🚀 You can now go back to the website to continue:');
123
- const url = new URL(`/onboarding/develop/set-up-project-on-your-machine?project=${app.slug}&accountId=${app.ownerAccount.id}`, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
124
- log_1.default.log(`👉 ${(0, log_1.link)(url)}`);
125
214
  }
126
215
  }
127
216
  _a = Onboarding;
@@ -166,3 +255,86 @@ function getDynamicPrivateProjectConfigGetter({ projectDir, graphqlClient, actor
166
255
  };
167
256
  };
168
257
  }
258
+ async function configureProjectFromBareDefaultExpoTemplateAsync({ app, vcsClient, targetDir, }) {
259
+ // Android package name requires each component to start with a lowercase letter.
260
+ const isUsernameValidSegment = /^[^a-z]/.test(app.ownerAccount.name);
261
+ const userPrefix = isUsernameValidSegment ? 'user' : '';
262
+ const isSlugValidSegment = /^[^a-z]/.test(app.slug);
263
+ const slugPrefix = isSlugValidSegment ? 'app' : '';
264
+ const bundleIdentifier = `com.${userPrefix}${stripInvalidCharactersForBundleIdentifier(app.ownerAccount.name)}.${slugPrefix}${stripInvalidCharactersForBundleIdentifier(app.slug)}`;
265
+ const updateUrl = (0, api_1.getEASUpdateURL)(app.id);
266
+ const easBuildGitHubConfig = {
267
+ android: {
268
+ image: 'latest',
269
+ },
270
+ ios: {
271
+ image: 'latest',
272
+ },
273
+ };
274
+ const easJson = {
275
+ cli: {
276
+ version: `>= ${easCli_1.easCliVersion}`,
277
+ },
278
+ build: {
279
+ development: {
280
+ developmentClient: true,
281
+ distribution: 'internal',
282
+ channel: 'development',
283
+ ...easBuildGitHubConfig,
284
+ },
285
+ 'development-simulator': {
286
+ extends: 'development',
287
+ ios: {
288
+ simulator: true,
289
+ },
290
+ },
291
+ preview: {
292
+ distribution: 'internal',
293
+ channel: 'preview',
294
+ ...easBuildGitHubConfig,
295
+ },
296
+ production: {
297
+ channel: 'production',
298
+ ...easBuildGitHubConfig,
299
+ },
300
+ },
301
+ submit: {
302
+ production: {},
303
+ },
304
+ };
305
+ const easJsonPath = path_1.default.join(targetDir, 'eas.json');
306
+ await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
307
+ await vcsClient.trackFileAsync(easJsonPath);
308
+ log_1.default.log(`✅ Generated ${chalk_1.default.bold('eas.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/eas-json/')}`);
309
+ log_1.default.log();
310
+ const expoConfig = {
311
+ name: app.name ?? app.slug,
312
+ slug: app.slug,
313
+ extra: {
314
+ eas: {
315
+ projectId: app.id,
316
+ },
317
+ },
318
+ owner: app.ownerAccount.name,
319
+ updates: {
320
+ url: updateUrl,
321
+ },
322
+ runtimeVersion: {
323
+ policy: 'appVersion',
324
+ },
325
+ ios: {
326
+ bundleIdentifier,
327
+ },
328
+ android: {
329
+ package: bundleIdentifier,
330
+ },
331
+ };
332
+ const appJsonPath = path_1.default.join(targetDir, 'app.json');
333
+ await fs_extra_1.default.writeFile(appJsonPath, `${JSON.stringify({ expo: expoConfig }, null, 2)}\n`);
334
+ await vcsClient.trackFileAsync(appJsonPath);
335
+ log_1.default.log(`✅ Generated ${chalk_1.default.bold('app.json')}. ${(0, log_1.learnMore)('https://docs.expo.dev/versions/latest/config/app/')}`);
336
+ log_1.default.log();
337
+ }
338
+ function stripInvalidCharactersForBundleIdentifier(string) {
339
+ return string.replaceAll(/[^A-Za-z0-9]/g, '');
340
+ }
@@ -31,27 +31,27 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
31
31
  value: secret,
32
32
  })),
33
33
  }));
34
- id = secret === null || secret === void 0 ? void 0 : secret.id;
34
+ id = secret?.id;
35
35
  if (!id) {
36
36
  throw new Error(validationMessage);
37
37
  }
38
38
  }
39
39
  if (!nonInteractive) {
40
40
  log_1.default.addNewLineIfNone();
41
- log_1.default.warn(`You are about to permanently delete secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
41
+ log_1.default.warn(`You are about to permanently delete secret${secret?.name ? ` "${secret?.name}"` : ''} with id: "${id}".\nThis action is irreversible.`);
42
42
  log_1.default.newLine();
43
43
  const confirmed = await (0, prompts_1.toggleConfirmAsync)({
44
- message: `Are you sure you wish to proceed?${(secret === null || secret === void 0 ? void 0 : secret.scope) === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
44
+ message: `Are you sure you wish to proceed?${secret?.scope === EnvironmentSecretsQuery_1.EnvironmentSecretScope.ACCOUNT
45
45
  ? ' This secret is applied across your whole account and may affect multiple apps.'
46
46
  : ''}`,
47
47
  });
48
48
  if (!confirmed) {
49
- log_1.default.error(`Canceled deletion of secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id: "${id}".`);
49
+ log_1.default.error(`Canceled deletion of secret${secret?.name ? ` "${secret?.name}"` : ''} with id: "${id}".`);
50
50
  process.exit(1);
51
51
  }
52
52
  }
53
53
  await EnvironmentSecretMutation_1.EnvironmentSecretMutation.deleteAsync(graphqlClient, id);
54
- log_1.default.withTick(`️Deleted secret${(secret === null || secret === void 0 ? void 0 : secret.name) ? ` "${secret === null || secret === void 0 ? void 0 : secret.name}"` : ''} with id "${id}".`);
54
+ log_1.default.withTick(`️Deleted secret${secret?.name ? ` "${secret?.name}"` : ''} with id "${id}".`);
55
55
  }
56
56
  }
57
57
  _a = EnvironmentSecretDelete;
@@ -133,7 +133,7 @@ class UpdatePublish extends EasCommand_1.default {
133
133
  cancelationToken.isCanceledOrFinished = true;
134
134
  const timedOutAssets = lastAssetUploadResults
135
135
  .filter(r => !r.finished)
136
- .map(r => { var _b; return `\n- ${(_b = r.asset.originalPath) !== null && _b !== void 0 ? _b : r.asset.path}`; });
136
+ .map(r => `\n- ${r.asset.originalPath ?? r.asset.path}`);
137
137
  throw new Error(`Asset processing timed out for assets: ${timedOutAssets}`);
138
138
  })(),
139
139
  ]);
@@ -277,7 +277,7 @@ class UpdatePublish extends EasCommand_1.default {
277
277
  ? [{ label: 'Android update ID', value: newAndroidUpdate.id }]
278
278
  : []),
279
279
  ...(newIosUpdate ? [{ label: 'iOS update ID', value: newIosUpdate.id }] : []),
280
- { label: 'Message', value: updateMessage !== null && updateMessage !== void 0 ? updateMessage : '' },
280
+ { label: 'Message', value: updateMessage ?? '' },
281
281
  ...(gitCommitHash
282
282
  ? [
283
283
  {
@@ -286,7 +286,7 @@ class UpdatePublish extends EasCommand_1.default {
286
286
  },
287
287
  ]
288
288
  : []),
289
- { label: 'Website link', value: updateGroupLink },
289
+ { label: 'EAS Dashboard', value: updateGroupLink },
290
290
  ]));
291
291
  log_1.default.addNewLineIfNone();
292
292
  if ((0, publish_1.isUploadedAssetCountAboveWarningThreshold)(uploadedAssetCount, assetLimitPerUpdateGroup)) {
@@ -301,8 +301,7 @@ class UpdatePublish extends EasCommand_1.default {
301
301
  }
302
302
  }
303
303
  sanitizeFlags(flags) {
304
- var _b, _c;
305
- const nonInteractive = (_b = flags['non-interactive']) !== null && _b !== void 0 ? _b : false;
304
+ const nonInteractive = flags['non-interactive'] ?? false;
306
305
  const { auto, branch: branchName, channel: channelName, message: updateMessage } = flags;
307
306
  if (nonInteractive && !auto && !(updateMessage && (branchName || channelName))) {
308
307
  core_1.Errors.error('--branch and --message, or --channel and --message are required when updating in non-interactive mode unless --auto is specified', { exit: 1 });
@@ -315,7 +314,7 @@ class UpdatePublish extends EasCommand_1.default {
315
314
  ].filter(([_, value]) => value)[0];
316
315
  log_1.default.newLine();
317
316
  log_1.default.warn('The --group and --republish flags are deprecated, use the republish command instead:');
318
- log_1.default.warn(` ${chalk_1.default.bold([`eas update:republish`, ...(args !== null && args !== void 0 ? args : [])].join(' '))}`);
317
+ log_1.default.warn(` ${chalk_1.default.bold([`eas update:republish`, ...(args ?? [])].join(' '))}`);
319
318
  log_1.default.newLine();
320
319
  core_1.Errors.error('--group and --republish flags are deprecated', { exit: 1 });
321
320
  }
@@ -330,7 +329,7 @@ class UpdatePublish extends EasCommand_1.default {
330
329
  platform: flags.platform,
331
330
  privateKeyPath: flags['private-key-path'],
332
331
  nonInteractive,
333
- json: (_c = flags.json) !== null && _c !== void 0 ? _c : false,
332
+ json: flags.json ?? false,
334
333
  };
335
334
  }
336
335
  }
@@ -60,7 +60,6 @@ class UpdateRepublish extends EasCommand_1.default {
60
60
  });
61
61
  }
62
62
  sanitizeFlags(rawFlags) {
63
- var _b;
64
63
  const branchName = rawFlags.branch;
65
64
  const channelName = rawFlags.channel;
66
65
  const groupId = rawFlags.group;
@@ -77,7 +76,7 @@ class UpdateRepublish extends EasCommand_1.default {
77
76
  platform,
78
77
  updateMessage: rawFlags.message,
79
78
  privateKeyPath,
80
- json: (_b = rawFlags.json) !== null && _b !== void 0 ? _b : false,
79
+ json: rawFlags.json ?? false,
81
80
  nonInteractive,
82
81
  };
83
82
  }
@@ -135,7 +135,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
135
135
  ? [{ label: 'Android update ID', value: newAndroidUpdate.id }]
136
136
  : []),
137
137
  ...(newIosUpdate ? [{ label: 'iOS update ID', value: newIosUpdate.id }] : []),
138
- { label: 'Message', value: updateMessage !== null && updateMessage !== void 0 ? updateMessage : '' },
138
+ { label: 'Message', value: updateMessage ?? '' },
139
139
  ...(gitCommitHash
140
140
  ? [
141
141
  {
@@ -144,7 +144,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
144
144
  },
145
145
  ]
146
146
  : []),
147
- { label: 'Website link', value: updateGroupLink },
147
+ { label: 'EAS Dashboard', value: updateGroupLink },
148
148
  ]));
149
149
  log_1.default.addNewLineIfNone();
150
150
  }
@@ -197,8 +197,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
197
197
  return newUpdates;
198
198
  }
199
199
  sanitizeFlags(flags) {
200
- var _b, _c;
201
- const nonInteractive = (_b = flags['non-interactive']) !== null && _b !== void 0 ? _b : false;
200
+ const nonInteractive = flags['non-interactive'] ?? false;
202
201
  const { auto, branch: branchName, channel: channelName, message: updateMessage } = flags;
203
202
  if (nonInteractive && !auto && !(updateMessage && (branchName || channelName))) {
204
203
  core_1.Errors.error('--branch and --message, or --channel and --message are required when updating in non-interactive mode unless --auto is specified', { exit: 1 });
@@ -211,7 +210,7 @@ class UpdateRollBackToEmbedded extends EasCommand_1.default {
211
210
  platform: flags.platform,
212
211
  privateKeyPath: flags['private-key-path'],
213
212
  nonInteractive,
214
- json: (_c = flags.json) !== null && _c !== void 0 ? _c : false,
213
+ json: flags.json ?? false,
215
214
  };
216
215
  }
217
216
  }
@@ -26,13 +26,12 @@ class AndroidCredentialsProvider {
26
26
  return this.toAndroidCredentials(buildCredentials);
27
27
  }
28
28
  toAndroidCredentials(androidBuildCredentials) {
29
- var _a, _b, _c, _d, _e;
30
29
  return {
31
30
  keystore: {
32
- keystore: (0, nullthrows_1.default)((_a = androidBuildCredentials.androidKeystore) === null || _a === void 0 ? void 0 : _a.keystore),
33
- keystorePassword: (0, nullthrows_1.default)((_b = androidBuildCredentials.androidKeystore) === null || _b === void 0 ? void 0 : _b.keystorePassword),
34
- keyAlias: (0, nullthrows_1.default)((_c = androidBuildCredentials.androidKeystore) === null || _c === void 0 ? void 0 : _c.keyAlias),
35
- keyPassword: (_e = (_d = androidBuildCredentials.androidKeystore) === null || _d === void 0 ? void 0 : _d.keyPassword) !== null && _e !== void 0 ? _e : undefined,
31
+ keystore: (0, nullthrows_1.default)(androidBuildCredentials.androidKeystore?.keystore),
32
+ keystorePassword: (0, nullthrows_1.default)(androidBuildCredentials.androidKeystore?.keystorePassword),
33
+ keyAlias: (0, nullthrows_1.default)(androidBuildCredentials.androidKeystore?.keyAlias),
34
+ keyPassword: androidBuildCredentials.androidKeystore?.keyPassword ?? undefined,
36
35
  },
37
36
  };
38
37
  }
@@ -23,7 +23,6 @@ async function canCopyLegacyCredentialsAsync(ctx, app) {
23
23
  }
24
24
  exports.canCopyLegacyCredentialsAsync = canCopyLegacyCredentialsAsync;
25
25
  async function promptUserAndCopyLegacyCredentialsAsync(ctx, app) {
26
- var _a, _b;
27
26
  (0, assert_1.default)(await canCopyLegacyCredentialsAsync(ctx, app), 'User not eligible to copy classic build credentials to EAS');
28
27
  const spinner = (0, ora_1.ora)('Classic credentials detected, copying to EAS...').start();
29
28
  try {
@@ -40,13 +39,13 @@ async function promptUserAndCopyLegacyCredentialsAsync(ctx, app) {
40
39
  });
41
40
  }
42
41
  const legacyBuildCredentials = await ctx.android.getLegacyAndroidAppBuildCredentialsAsync(ctx.graphqlClient, app);
43
- const legacyKeystore = (_a = legacyBuildCredentials === null || legacyBuildCredentials === void 0 ? void 0 : legacyBuildCredentials.androidKeystore) !== null && _a !== void 0 ? _a : null;
42
+ const legacyKeystore = legacyBuildCredentials?.androidKeystore ?? null;
44
43
  if (legacyKeystore) {
45
44
  const clonedKeystore = await ctx.android.createKeystoreAsync(ctx.graphqlClient, app.account, {
46
45
  keystore: legacyKeystore.keystore,
47
46
  keystorePassword: legacyKeystore.keystorePassword,
48
47
  keyAlias: legacyKeystore.keyAlias,
49
- keyPassword: (_b = legacyKeystore.keyPassword) !== null && _b !== void 0 ? _b : undefined,
48
+ keyPassword: legacyKeystore.keyPassword ?? undefined,
50
49
  type: legacyKeystore.type,
51
50
  });
52
51
  await createOrUpdateDefaultAndroidAppBuildCredentialsAsync(ctx, app, {
@@ -14,20 +14,19 @@ class DownloadKeystore {
14
14
  this.options = options;
15
15
  }
16
16
  async runAsync(ctx, buildCredentials) {
17
- var _a, _b, _c;
18
17
  const keystore = buildCredentials.androidKeystore;
19
18
  if (!keystore) {
20
19
  log_1.default.warn(`There is no valid Keystore defined for build credentials: ${buildCredentials.name}`);
21
20
  return;
22
21
  }
23
- let displaySensitiveInformation = (_a = this.options) === null || _a === void 0 ? void 0 : _a.displaySensitiveInformation;
22
+ let displaySensitiveInformation = this.options?.displaySensitiveInformation;
24
23
  if (displaySensitiveInformation === undefined && !ctx.nonInteractive) {
25
24
  displaySensitiveInformation = await (0, prompts_1.confirmAsync)({
26
25
  message: 'Do you want to display the sensitive information of the Android Keystore?',
27
26
  });
28
27
  }
29
28
  const projectFullName = (0, GraphqlClient_1.formatProjectFullName)(this.options.app);
30
- const keystorePath = (_c = (_b = this.options) === null || _b === void 0 ? void 0 : _b.outputPath) !== null && _c !== void 0 ? _c : `${projectFullName.replace('/', '__')}.jks`;
29
+ const keystorePath = this.options?.outputPath ?? `${projectFullName.replace('/', '__')}.jks`;
31
30
  await (0, files_1.maybeRenameExistingFileAsync)(ctx.projectDir, keystorePath);
32
31
  log_1.default.log(`Saving Keystore to ${keystorePath}`);
33
32
  await fs_extra_1.default.writeFile(keystorePath, keystore.keystore, 'base64');
@@ -14,7 +14,7 @@ class RemoveFcm {
14
14
  throw new Error("Deleting an FCM API Key is a destructive operation. Start the CLI without the '--non-interactive' flag to delete the credentials.");
15
15
  }
16
16
  const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(ctx.graphqlClient, this.app);
17
- const fcm = appCredentials === null || appCredentials === void 0 ? void 0 : appCredentials.androidFcm;
17
+ const fcm = appCredentials?.androidFcm;
18
18
  if (!fcm) {
19
19
  log_1.default.warn(`There is no valid FCM API Key defined for ${(0, GraphqlClient_1.formatProjectFullName)(this.app)}, ${this.app.androidApplicationIdentifier}`);
20
20
  return;
@@ -49,12 +49,11 @@ class SetUpBuildCredentials {
49
49
  });
50
50
  }
51
51
  async getFullySetupBuildCredentialsAsync({ ctx, app, name, }) {
52
- var _a;
53
52
  if (name) {
54
53
  return await this.getFullySetupBuildCredentialsByNameAsync({ ctx, app, name });
55
54
  }
56
55
  const defaultBuildCredentials = await ctx.android.getDefaultAndroidAppBuildCredentialsAsync(ctx.graphqlClient, app);
57
- const defaultKeystore = (_a = defaultBuildCredentials === null || defaultBuildCredentials === void 0 ? void 0 : defaultBuildCredentials.androidKeystore) !== null && _a !== void 0 ? _a : null;
56
+ const defaultKeystore = defaultBuildCredentials?.androidKeystore ?? null;
58
57
  if (defaultKeystore) {
59
58
  (0, ora_1.ora)(`Using Keystore from configuration: ${(0, nullthrows_1.default)(defaultBuildCredentials).name} (default)`).succeed();
60
59
  return defaultBuildCredentials;
@@ -62,15 +61,14 @@ class SetUpBuildCredentials {
62
61
  return null;
63
62
  }
64
63
  async getFullySetupBuildCredentialsByNameAsync({ ctx, app, name, }) {
65
- var _a;
66
64
  const maybeBuildCredentials = await ctx.android.getAndroidAppBuildCredentialsByNameAsync(ctx.graphqlClient, app, name);
67
- const keystore = (_a = maybeBuildCredentials === null || maybeBuildCredentials === void 0 ? void 0 : maybeBuildCredentials.androidKeystore) !== null && _a !== void 0 ? _a : null;
65
+ const keystore = maybeBuildCredentials?.androidKeystore ?? null;
68
66
  if (keystore) {
69
67
  const buildCredentials = (0, nullthrows_1.default)(maybeBuildCredentials);
70
68
  (0, ora_1.ora)(`Using Keystore from configuration: ${buildCredentials.name}${buildCredentials.isDefault ? ' (default)' : ''}`).succeed();
71
69
  return buildCredentials;
72
70
  }
73
- log_1.default.log(`No Keystore found for configuration: ${name}${(maybeBuildCredentials === null || maybeBuildCredentials === void 0 ? void 0 : maybeBuildCredentials.isDefault) ? ' (default)' : ''}`);
71
+ log_1.default.log(`No Keystore found for configuration: ${name}${maybeBuildCredentials?.isDefault ? ' (default)' : ''}`);
74
72
  return null;
75
73
  }
76
74
  }