eas-cli 10.2.3 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/README.md +63 -65
  2. package/build/branch/actions/SelectBranch.d.ts +1 -1
  3. package/build/branch/actions/SelectBranch.js +2 -2
  4. package/build/branch/queries.js +3 -1
  5. package/build/build/android/build.js +1 -1
  6. package/build/build/android/version.js +1 -1
  7. package/build/build/build.js +21 -10
  8. package/build/build/context.d.ts +1 -0
  9. package/build/build/createContext.d.ts +2 -1
  10. package/build/build/createContext.js +6 -3
  11. package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +16 -0
  12. package/build/build/evaluateConfigWithEnvVarsAsync.js +44 -0
  13. package/build/build/ios/build.js +4 -4
  14. package/build/build/local.d.ts +1 -1
  15. package/build/build/local.js +3 -2
  16. package/build/build/queries.js +3 -1
  17. package/build/build/runBuildAndSubmit.d.ts +2 -0
  18. package/build/build/runBuildAndSubmit.js +14 -7
  19. package/build/build/utils/printBuildInfo.js +6 -2
  20. package/build/build/validate.js +2 -2
  21. package/build/channel/actions/SelectChannel.d.ts +1 -1
  22. package/build/channel/actions/SelectChannel.js +2 -2
  23. package/build/channel/queries.js +6 -2
  24. package/build/commandUtils/EasCommand.js +2 -2
  25. package/build/commandUtils/context/contextUtils/createGraphqlClient.js +1 -1
  26. package/build/commandUtils/flags.d.ts +16 -0
  27. package/build/commandUtils/flags.js +61 -1
  28. package/build/commandUtils/gating/FeatureGating.js +6 -2
  29. package/build/commands/analytics.js +1 -1
  30. package/build/commands/build/index.d.ts +4 -1
  31. package/build/commands/build/index.js +3 -0
  32. package/build/commands/build/resign.d.ts +4 -1
  33. package/build/commands/build/resign.js +12 -3
  34. package/build/commands/build/version/get.d.ts +1 -0
  35. package/build/commands/build/version/get.js +9 -2
  36. package/build/commands/build/version/set.d.ts +1 -0
  37. package/build/commands/build/version/set.js +11 -1
  38. package/build/commands/build/version/sync.d.ts +1 -0
  39. package/build/commands/build/version/sync.js +13 -5
  40. package/build/commands/config.d.ts +2 -0
  41. package/build/commands/config.js +10 -3
  42. package/build/commands/device/delete.js +1 -1
  43. package/build/commands/device/rename.js +1 -1
  44. package/build/commands/env/create.d.ts +23 -0
  45. package/build/commands/env/create.js +169 -0
  46. package/build/commands/env/delete.d.ts +18 -0
  47. package/build/commands/env/delete.js +95 -0
  48. package/build/commands/env/get.d.ts +19 -0
  49. package/build/commands/env/get.js +100 -0
  50. package/build/commands/env/link.d.ts +15 -0
  51. package/build/commands/env/link.js +59 -0
  52. package/build/commands/env/list.d.ts +18 -0
  53. package/build/commands/env/list.js +82 -0
  54. package/build/commands/env/pull.d.ts +15 -0
  55. package/build/commands/env/pull.js +64 -0
  56. package/build/commands/env/push.d.ts +17 -0
  57. package/build/commands/env/push.js +148 -0
  58. package/build/commands/env/unlink.d.ts +15 -0
  59. package/build/commands/env/unlink.js +65 -0
  60. package/build/commands/env/update.d.ts +21 -0
  61. package/build/commands/env/update.js +135 -0
  62. package/build/commands/metadata/lint.js +4 -2
  63. package/build/commands/project/onboarding.js +1 -1
  64. package/build/commands/update/edit.d.ts +19 -0
  65. package/build/commands/update/edit.js +102 -0
  66. package/build/commands/update/index.d.ts +1 -2
  67. package/build/commands/update/index.js +53 -25
  68. package/build/commands/update/list.js +6 -3
  69. package/build/commands/update/roll-back-to-embedded.js +1 -1
  70. package/build/credentials/android/AndroidCredentialsProvider.d.ts +2 -2
  71. package/build/credentials/android/actions/AssignFcm.d.ts +1 -1
  72. package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForFcmV1.d.ts +1 -1
  73. package/build/credentials/android/actions/AssignGoogleServiceAccountKeyForSubmissions.d.ts +1 -1
  74. package/build/credentials/android/actions/CreateFcm.d.ts +1 -1
  75. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.d.ts +1 -1
  76. package/build/credentials/android/actions/CreateKeystore.d.ts +1 -1
  77. package/build/credentials/android/actions/DownloadKeystore.d.ts +2 -2
  78. package/build/credentials/android/actions/RemoveFcm.d.ts +1 -1
  79. package/build/credentials/android/actions/RemoveGoogleServiceAccountKey.d.ts +2 -2
  80. package/build/credentials/android/actions/RemoveKeystore.d.ts +1 -1
  81. package/build/credentials/android/actions/SetUpBuildCredentials.d.ts +1 -1
  82. package/build/credentials/android/actions/SetUpBuildCredentialsFromCredentialsJson.d.ts +1 -1
  83. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForFcmV1.d.ts +1 -1
  84. package/build/credentials/android/actions/SetUpGoogleServiceAccountKeyForSubmissions.d.ts +1 -1
  85. package/build/credentials/android/actions/UseExistingGoogleServiceAccountKey.d.ts +1 -1
  86. package/build/credentials/android/api/GraphqlClient.js +3 -3
  87. package/build/credentials/context.d.ts +2 -2
  88. package/build/credentials/context.js +1 -1
  89. package/build/credentials/ios/IosCredentialsProvider.d.ts +2 -2
  90. package/build/credentials/ios/IosCredentialsProvider.js +1 -1
  91. package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
  92. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +1 -1
  93. package/build/credentials/ios/actions/AssignPushKey.d.ts +1 -1
  94. package/build/credentials/ios/actions/ConfigureProvisioningProfile.d.ts +4 -4
  95. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +1 -1
  96. package/build/credentials/ios/actions/CreateDistributionCertificate.d.ts +1 -1
  97. package/build/credentials/ios/actions/CreateProvisioningProfile.d.ts +3 -3
  98. package/build/credentials/ios/actions/CreatePushKey.d.ts +1 -1
  99. package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -5
  100. package/build/credentials/ios/actions/ProvisioningProfileUtils.js +1 -1
  101. package/build/credentials/ios/actions/PushKeyUtils.js +2 -2
  102. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +2 -2
  103. package/build/credentials/ios/actions/RemoveDistributionCertificate.d.ts +3 -3
  104. package/build/credentials/ios/actions/RemoveProvisioningProfile.d.ts +2 -2
  105. package/build/credentials/ios/actions/RemovePushKey.d.ts +2 -2
  106. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.d.ts +1 -1
  107. package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +1 -1
  108. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +2 -2
  109. package/build/credentials/ios/actions/SetUpBuildCredentials.d.ts +1 -1
  110. package/build/credentials/ios/actions/SetUpBuildCredentialsFromCredentialsJson.d.ts +3 -3
  111. package/build/credentials/ios/actions/SetUpDistributionCertificate.d.ts +2 -2
  112. package/build/credentials/ios/actions/SetUpDistributionCertificate.js +1 -1
  113. package/build/credentials/ios/actions/SetUpInternalProvisioningProfile.d.ts +1 -1
  114. package/build/credentials/ios/actions/SetUpProvisioningProfile.d.ts +3 -3
  115. package/build/credentials/ios/actions/SetUpProvisioningProfile.js +1 -1
  116. package/build/credentials/ios/actions/SetUpPushKey.d.ts +1 -1
  117. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +1 -1
  118. package/build/credentials/ios/actions/SetUpTargetBuildCredentialsFromCredentialsJson.d.ts +3 -3
  119. package/build/credentials/ios/actions/UpdateCredentialsJson.d.ts +3 -3
  120. package/build/credentials/ios/api/GraphqlClient.js +4 -4
  121. package/build/credentials/ios/appstore/AppStoreApi.js +4 -4
  122. package/build/credentials/ios/appstore/authenticate.js +1 -1
  123. package/build/credentials/ios/appstore/bundleId.js +1 -1
  124. package/build/credentials/ios/appstore/bundleIdCapabilities.js +1 -1
  125. package/build/credentials/ios/appstore/ensureAppExists.js +1 -1
  126. package/build/credentials/ios/appstore/keychain.js +8 -6
  127. package/build/credentials/ios/appstore/provisioningProfile.js +1 -1
  128. package/build/credentials/ios/appstore/pushKey.js +1 -1
  129. package/build/credentials/ios/appstore/resolveCredentials.js +2 -2
  130. package/build/credentials/ios/credentials.js +1 -1
  131. package/build/credentials/ios/utils/convertHTMLToASCII.js +1 -1
  132. package/build/credentials/ios/validators/validateProvisioningProfile.js +2 -4
  133. package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.d.ts +3 -3
  134. package/build/credentials/manager/CreateAndroidBuildCredentials.d.ts +1 -1
  135. package/build/credentials/manager/ManageAndroid.js +2 -1
  136. package/build/credentials/manager/ManageIos.js +3 -2
  137. package/build/credentials/manager/SelectAndroidBuildCredentials.d.ts +2 -2
  138. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -2
  139. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +1 -1
  140. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.js +1 -1
  141. package/build/credentials/manager/SelectPlatform.js +3 -2
  142. package/build/credentials/manager/SetDefaultAndroidKeystore.d.ts +1 -1
  143. package/build/credentials/manager/SetUpAndroidBuildCredentials.d.ts +1 -1
  144. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.js +3 -2
  145. package/build/credentials/manager/SetUpIosBuildCredentials.d.ts +1 -1
  146. package/build/devices/actions/create/action.d.ts +4 -4
  147. package/build/devices/actions/create/registrationUrlMethod.js +3 -1
  148. package/build/devices/manager.d.ts +4 -4
  149. package/build/devices/queries.js +3 -1
  150. package/build/easMultiselect.js +6 -2
  151. package/build/graphql/generated.d.ts +874 -62
  152. package/build/graphql/generated.js +92 -2
  153. package/build/graphql/mutations/EnvironmentVariableMutation.d.ts +39 -0
  154. package/build/graphql/mutations/EnvironmentVariableMutation.js +133 -0
  155. package/build/graphql/mutations/PublishMutation.d.ts +1 -0
  156. package/build/graphql/mutations/PublishMutation.js +16 -0
  157. package/build/graphql/queries/BranchQuery.d.ts +7 -1
  158. package/build/graphql/queries/BranchQuery.js +42 -0
  159. package/build/graphql/queries/EnvironmentVariablesQuery.d.ts +22 -0
  160. package/build/graphql/queries/EnvironmentVariablesQuery.js +106 -0
  161. package/build/graphql/types/EnvironmentVariable.d.ts +1 -0
  162. package/build/graphql/types/EnvironmentVariable.js +16 -0
  163. package/build/graphql/types/Update.js +4 -0
  164. package/build/metadata/apple/config/reader.js +1 -1
  165. package/build/metadata/apple/tasks/age-rating.js +1 -1
  166. package/build/metadata/apple/tasks/app-review-detail.js +2 -1
  167. package/build/metadata/apple/tasks/app-version.d.ts +1 -1
  168. package/build/metadata/config/resolve.js +2 -1
  169. package/build/metadata/errors.js +2 -1
  170. package/build/metadata/utils/log.js +1 -1
  171. package/build/metadata/utils/retry.js +1 -1
  172. package/build/onboarding/runCommand.js +1 -1
  173. package/build/ora.js +12 -4
  174. package/build/project/android/applicationId.js +1 -1
  175. package/build/project/applicationIdentifier.d.ts +3 -2
  176. package/build/project/applicationIdentifier.js +2 -2
  177. package/build/project/expoConfig.js +2 -2
  178. package/build/project/ios/entitlements.js +1 -1
  179. package/build/project/publish.d.ts +31 -18
  180. package/build/project/publish.js +61 -37
  181. package/build/project/resolveRuntimeVersionAsync.d.ts +4 -1
  182. package/build/project/resolveRuntimeVersionAsync.js +9 -3
  183. package/build/rollout/actions/CreateRollout.d.ts +2 -2
  184. package/build/rollout/actions/EditRollout.d.ts +2 -2
  185. package/build/rollout/actions/EndRollout.d.ts +2 -2
  186. package/build/rollout/actions/ManageRollout.d.ts +2 -2
  187. package/build/rollout/actions/NonInteractiveRollout.d.ts +1 -1
  188. package/build/rollout/actions/RolloutMainMenu.d.ts +1 -1
  189. package/build/rollout/actions/SelectRuntime.d.ts +3 -3
  190. package/build/run/android/adb.js +1 -1
  191. package/build/run/ios/simctl.js +1 -1
  192. package/build/run/ios/systemRequirements.js +1 -1
  193. package/build/submit/ArchiveSource.js +15 -15
  194. package/build/submit/BaseSubmitter.js +2 -2
  195. package/build/submit/submit.js +1 -1
  196. package/build/update/android/UpdatesModule.js +1 -1
  197. package/build/update/configure.d.ts +1 -1
  198. package/build/update/queries.js +8 -3
  199. package/build/update/republish.js +2 -1
  200. package/build/update/utils.d.ts +1 -0
  201. package/build/update/utils.js +7 -0
  202. package/build/user/expoSsoLauncher.js +1 -1
  203. package/build/utils/download.js +2 -2
  204. package/build/utils/filterAsync.js +1 -1
  205. package/build/utils/formatVariable.d.ts +2 -0
  206. package/build/utils/formatVariable.js +16 -0
  207. package/build/utils/image.js +2 -2
  208. package/build/utils/progress.js +1 -1
  209. package/build/utils/promise.js +1 -1
  210. package/build/utils/prompts.d.ts +9 -0
  211. package/build/utils/prompts.js +68 -0
  212. package/build/utils/queries.js +2 -2
  213. package/build/vcs/clients/git.d.ts +1 -1
  214. package/build/vcs/local.d.ts +1 -1
  215. package/oclif.manifest.json +627 -22
  216. package/package.json +15 -15
@@ -47,7 +47,9 @@ async function prepareBuildRequestForPlatformAsync(builder) {
47
47
  failureEvent: AnalyticsManager_1.BuildEvent.GATHER_CREDENTIALS_FAIL,
48
48
  properties: ctx.analyticsEventProperties,
49
49
  });
50
- await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () => await builder.syncProjectConfigurationAsync(ctx), {
50
+ await (0, common_1.withAnalyticsAsync)(ctx.analytics, async () => {
51
+ await builder.syncProjectConfigurationAsync(ctx);
52
+ }, {
51
53
  attemptEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_ATTEMPT,
52
54
  successEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_SUCCESS,
53
55
  failureEvent: AnalyticsManager_1.BuildEvent.CONFIGURE_PROJECT_FAIL,
@@ -55,7 +57,11 @@ async function prepareBuildRequestForPlatformAsync(builder) {
55
57
  });
56
58
  if (await ctx.vcsClient.isCommitRequiredAsync()) {
57
59
  log_1.default.addNewLineIfNone();
58
- await (0, repository_1.reviewAndCommitChangesAsync)(ctx.vcsClient, `[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[ctx.platform]}`, { nonInteractive: ctx.nonInteractive });
60
+ const platformToRequestedPlatform = {
61
+ [eas_build_job_1.Platform.ANDROID]: platform_1.RequestedPlatform.Android,
62
+ [eas_build_job_1.Platform.IOS]: platform_1.RequestedPlatform.Ios,
63
+ };
64
+ await (0, repository_1.reviewAndCommitChangesAsync)(ctx.vcsClient, `[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[platformToRequestedPlatform[ctx.platform]]}`, { nonInteractive: ctx.nonInteractive });
59
65
  }
60
66
  let projectArchive;
61
67
  if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
@@ -87,7 +93,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
87
93
  });
88
94
  return async () => {
89
95
  if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
90
- await (0, local_1.runLocalBuildAsync)(job, metadata, ctx.localBuildOptions);
96
+ await (0, local_1.runLocalBuildAsync)(job, metadata, ctx.localBuildOptions, ctx.env);
91
97
  return undefined;
92
98
  }
93
99
  else if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.INTERNAL) {
@@ -433,30 +439,34 @@ async function createAndMaybeUploadFingerprintAsync(ctx) {
433
439
  platform: ctx.platform,
434
440
  workflow: ctx.workflow,
435
441
  projectDir: ctx.projectDir,
436
- env: ctx.buildProfile.env,
442
+ env: ctx.env,
437
443
  cwd: ctx.projectDir,
438
444
  });
445
+ if (!resolvedRuntimeVersion) {
446
+ return {};
447
+ }
439
448
  /**
440
449
  * It's ok for fingerprintSources to be empty
441
450
  * fingerprintSources only exist if the project is using runtimeVersion.policy: fingerprint
442
451
  */
443
- if (!resolvedRuntimeVersion?.fingerprintSources) {
452
+ if (!resolvedRuntimeVersion.fingerprint) {
444
453
  return {
445
- runtimeVersion: resolvedRuntimeVersion?.runtimeVersion ?? undefined,
454
+ runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
446
455
  };
447
456
  }
448
457
  await fs_extra_1.default.mkdirp((0, paths_1.getTmpDirectory)());
449
458
  const fingerprintLocation = path_1.default.join((0, paths_1.getTmpDirectory)(), `${(0, uuid_1.v4)()}-runtime-fingerprint.json`);
450
459
  await fs_extra_1.default.writeJSON(fingerprintLocation, {
451
460
  hash: resolvedRuntimeVersion.runtimeVersion,
452
- sources: resolvedRuntimeVersion.fingerprintSources,
461
+ sources: resolvedRuntimeVersion.fingerprint.fingerprintSources,
453
462
  });
454
463
  if (ctx.localBuildOptions.localBuildMode === local_1.LocalBuildMode.LOCAL_BUILD_PLUGIN) {
455
464
  return {
456
- runtimeVersion: resolvedRuntimeVersion?.runtimeVersion ?? undefined,
465
+ runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
457
466
  fingerprintSource: {
458
467
  type: eas_build_job_1.FingerprintSourceType.PATH,
459
468
  path: fingerprintLocation,
469
+ isDebugFingerprint: resolvedRuntimeVersion.fingerprint.isDebugFingerprintSource,
460
470
  },
461
471
  };
462
472
  }
@@ -471,17 +481,18 @@ async function createAndMaybeUploadFingerprintAsync(ctx) {
471
481
  }
472
482
  log_1.default.warn(errMessage);
473
483
  return {
474
- runtimeVersion: resolvedRuntimeVersion?.runtimeVersion ?? undefined,
484
+ runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
475
485
  };
476
486
  }
477
487
  finally {
478
488
  await fs_extra_1.default.remove(fingerprintLocation);
479
489
  }
480
490
  return {
481
- runtimeVersion: resolvedRuntimeVersion?.runtimeVersion ?? undefined,
491
+ runtimeVersion: resolvedRuntimeVersion.runtimeVersion ?? undefined,
482
492
  fingerprintSource: {
483
493
  type: eas_build_job_1.FingerprintSourceType.GCS,
484
494
  bucketKey: fingerprintGCSBucketKey,
495
+ isDebugFingerprint: resolvedRuntimeVersion.fingerprint.isDebugFingerprintSource,
485
496
  },
486
497
  };
487
498
  }
@@ -58,4 +58,5 @@ export interface BuildContext<T extends Platform> {
58
58
  vcsClient: Client;
59
59
  loggerLevel?: LoggerLevel;
60
60
  repack: boolean;
61
+ env: Record<string, string>;
61
62
  }
@@ -9,7 +9,7 @@ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGr
9
9
  import { CustomBuildConfigMetadata } from '../project/customBuildConfig';
10
10
  import { Actor } from '../user/User';
11
11
  import { Client } from '../vcs/vcs';
12
- export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, }: {
12
+ export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, env, }: {
13
13
  buildProfileName: string;
14
14
  buildProfile: BuildProfile<T>;
15
15
  easJsonCliConfig: EasJson['cli'];
@@ -30,4 +30,5 @@ export declare function createBuildContextAsync<T extends Platform>({ buildProfi
30
30
  buildLoggerLevel?: LoggerLevel;
31
31
  freezeCredentials: boolean;
32
32
  repack: boolean;
33
+ env: Record<string, string>;
33
34
  }): Promise<BuildContext<T>>;
@@ -16,8 +16,10 @@ const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
16
16
  const context_1 = require("../credentials/context");
17
17
  const projectUtils_1 = require("../project/projectUtils");
18
18
  const workflow_1 = require("../project/workflow");
19
- async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, }) {
20
- const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({ env: buildProfile.env });
19
+ async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClassFlag, message, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, repack, env, }) {
20
+ const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({
21
+ env,
22
+ });
21
23
  const projectName = exp.slug;
22
24
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
23
25
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform, vcsClient);
@@ -36,7 +38,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
36
38
  user: actor,
37
39
  graphqlClient,
38
40
  analytics,
39
- env: buildProfile.env,
41
+ env,
40
42
  easJsonCliConfig,
41
43
  vcsClient,
42
44
  freezeCredentials,
@@ -89,6 +91,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, easJson
89
91
  requiredPackageManager,
90
92
  loggerLevel: buildLoggerLevel,
91
93
  repack,
94
+ env,
92
95
  };
93
96
  if (platform === eas_build_job_1.Platform.ANDROID) {
94
97
  const common = commonContext;
@@ -0,0 +1,16 @@
1
+ import { Env } from '@expo/eas-build-job';
2
+ import { BuildProfile } from '@expo/eas-json';
3
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
4
+ export declare function evaluateConfigWithEnvVarsAsync<Config extends {
5
+ projectId: string;
6
+ }, Opts>({ flags, buildProfile, graphqlClient, getProjectConfig, opts, }: {
7
+ flags: {
8
+ environment?: string;
9
+ };
10
+ buildProfile: BuildProfile;
11
+ graphqlClient: ExpoGraphqlClient | null;
12
+ opts: Opts;
13
+ getProjectConfig(opts: Opts): Promise<Config>;
14
+ }): Promise<Config & {
15
+ env: Env;
16
+ }>;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.evaluateConfigWithEnvVarsAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const generated_1 = require("../graphql/generated");
6
+ const EnvironmentVariablesQuery_1 = require("../graphql/queries/EnvironmentVariablesQuery");
7
+ const log_1 = tslib_1.__importDefault(require("../log"));
8
+ function isEnvironment(env) {
9
+ return Object.values(generated_1.EnvironmentVariableEnvironment).includes(env.toUpperCase());
10
+ }
11
+ async function evaluateConfigWithEnvVarsAsync({ flags, buildProfile, graphqlClient, getProjectConfig, opts, }) {
12
+ if (!graphqlClient) {
13
+ log_1.default.warn('An Expo user account is required to fetch environment variables.');
14
+ const config = await getProjectConfig(opts);
15
+ return { env: buildProfile.env ?? {}, ...config };
16
+ }
17
+ const { projectId } = await getProjectConfig({ env: buildProfile.env, ...opts });
18
+ const env = await resolveEnvVarsAsync({ flags, buildProfile, graphqlClient, projectId });
19
+ const config = await getProjectConfig({ ...opts, env });
20
+ return { env, ...config };
21
+ }
22
+ exports.evaluateConfigWithEnvVarsAsync = evaluateConfigWithEnvVarsAsync;
23
+ async function resolveEnvVarsAsync({ flags, buildProfile, graphqlClient, projectId, }) {
24
+ const environment = flags.environment ?? buildProfile.environment ?? process.env.EAS_CURRENT_ENVIRONMENT;
25
+ if (!environment || !isEnvironment(environment)) {
26
+ return { ...buildProfile.env };
27
+ }
28
+ try {
29
+ const environmentVariables = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
30
+ appId: projectId,
31
+ environment,
32
+ });
33
+ const envVars = Object.fromEntries(environmentVariables
34
+ .filter(({ name, value }) => name && value)
35
+ .map(({ name, value }) => [name, value]));
36
+ return { ...envVars, ...buildProfile.env };
37
+ }
38
+ catch (e) {
39
+ log_1.default.error('Failed to pull env variables for environment ${environment} from EAS servers');
40
+ log_1.default.error(e);
41
+ log_1.default.error('This can possibly be a bug in EAS/EAS CLI. Report it here: https://github.com/expo/eas-cli/issues');
42
+ return { ...buildProfile.env };
43
+ }
44
+ }
@@ -16,7 +16,7 @@ const build_1 = require("../build");
16
16
  const graphql_2 = require("../graphql");
17
17
  const validate_1 = require("../validate");
18
18
  async function createIosContextAsync(ctx) {
19
- const { buildProfile } = ctx;
19
+ const { buildProfile, env } = ctx;
20
20
  if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
21
21
  await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx);
22
22
  }
@@ -33,7 +33,7 @@ async function createIosContextAsync(ctx) {
33
33
  projectDir: ctx.projectDir,
34
34
  exp: ctx.exp,
35
35
  xcodeBuildContext,
36
- env: buildProfile.env,
36
+ env,
37
37
  vcsClient: ctx.vcsClient,
38
38
  });
39
39
  const applicationTarget = (0, target_1.findApplicationTarget)(targets);
@@ -60,7 +60,7 @@ async function prepareIosBuildAsync(ctx) {
60
60
  return await (0, build_1.prepareBuildRequestForPlatformAsync)({
61
61
  ctx,
62
62
  ensureCredentialsAsync: async (ctx) => {
63
- return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
63
+ return await (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
64
64
  },
65
65
  syncProjectConfigurationAsync: async () => {
66
66
  await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
@@ -71,7 +71,7 @@ async function prepareIosBuildAsync(ctx) {
71
71
  ? false
72
72
  : ctx.buildProfile.autoIncrement,
73
73
  vcsClient: ctx.vcsClient,
74
- env: ctx.buildProfile.env,
74
+ env: ctx.env,
75
75
  });
76
76
  },
77
77
  prepareJobAsync: async (ctx, jobData) => {
@@ -25,4 +25,4 @@ export interface LocalBuildOptions {
25
25
  workingdir?: string;
26
26
  verbose?: boolean;
27
27
  }
28
- export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions): Promise<void>;
28
+ export declare function runLocalBuildAsync(job: Job, metadata: Metadata, options: LocalBuildOptions, env: Record<string, string>): Promise<void>;
@@ -6,7 +6,7 @@ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
6
  const semver_1 = tslib_1.__importDefault(require("semver"));
7
7
  const ora_1 = require("../ora");
8
8
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
9
- const PLUGIN_PACKAGE_VERSION = '1.0.130';
9
+ const PLUGIN_PACKAGE_VERSION = '1.0.131';
10
10
  var LocalBuildMode;
11
11
  (function (LocalBuildMode) {
12
12
  /**
@@ -25,7 +25,7 @@ var LocalBuildMode;
25
25
  */
26
26
  LocalBuildMode["INTERNAL"] = "internal";
27
27
  })(LocalBuildMode || (exports.LocalBuildMode = LocalBuildMode = {}));
28
- async function runLocalBuildAsync(job, metadata, options) {
28
+ async function runLocalBuildAsync(job, metadata, options, env) {
29
29
  const { command, args } = await getCommandAndArgsAsync(job, metadata);
30
30
  let spinner;
31
31
  if (!options.verbose) {
@@ -42,6 +42,7 @@ async function runLocalBuildAsync(job, metadata, options) {
42
42
  const spawnPromise = (0, spawn_async_1.default)(command, args, {
43
43
  stdio: options.verbose ? 'inherit' : 'pipe',
44
44
  env: {
45
+ ...env,
45
46
  ...process.env,
46
47
  EAS_LOCAL_BUILD_WORKINGDIR: options.workingdir ?? process.env.EAS_LOCAL_BUILD_WORKINGDIR,
47
48
  ...(options.skipCleanup || options.skipNativeBuild
@@ -33,7 +33,9 @@ async function listAndRenderBuildsOnAppAsync(graphqlClient, { projectId, project
33
33
  }),
34
34
  promptOptions: {
35
35
  title: 'Load more builds?',
36
- renderListItems: builds => renderPageOfBuilds({ builds, projectDisplayName, paginatedQueryOptions }),
36
+ renderListItems: builds => {
37
+ renderPageOfBuilds({ builds, projectDisplayName, paginatedQueryOptions });
38
+ },
37
39
  },
38
40
  });
39
41
  }
@@ -4,6 +4,7 @@ import { LocalBuildOptions } from './local';
4
4
  import { Analytics } from '../analytics/AnalyticsManager';
5
5
  import { DynamicConfigContextFn } from '../commandUtils/context/DynamicProjectConfigContextField';
6
6
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
7
+ import { EnvironmentVariableEnvironment } from '../graphql/generated';
7
8
  import { RequestedPlatform } from '../platform';
8
9
  import { Actor } from '../user/User';
9
10
  import { Client } from '../vcs/vcs';
@@ -22,6 +23,7 @@ export interface BuildFlags {
22
23
  buildLoggerLevel?: LoggerLevel;
23
24
  freezeCredentials: boolean;
24
25
  repack: boolean;
26
+ environment?: EnvironmentVariableEnvironment;
25
27
  }
26
28
  export declare function runBuildAndSubmitAsync(graphqlClient: ExpoGraphqlClient, analytics: Analytics, vcsClient: Client, projectDir: string, flags: BuildFlags, actor: Actor, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn): Promise<{
27
29
  buildIds: string[];
@@ -11,6 +11,7 @@ const build_1 = require("./android/build");
11
11
  const build_2 = require("./build");
12
12
  const configure_1 = require("./configure");
13
13
  const createContext_1 = require("./createContext");
14
+ const evaluateConfigWithEnvVarsAsync_1 = require("./evaluateConfigWithEnvVarsAsync");
14
15
  const build_3 = require("./ios/build");
15
16
  const local_1 = require("./local");
16
17
  const devClient_1 = require("./utils/devClient");
@@ -58,9 +59,6 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
58
59
  profileName: flags.profile ?? undefined,
59
60
  projectDir,
60
61
  });
61
- log_1.default.log(`Loaded "env" configuration for the "${buildProfiles[0].profileName}" profile: ${buildProfiles[0].profile.env
62
- ? Object.keys(buildProfiles[0].profile.env).join(', ')
63
- : 'no environment variables specified'}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/')}`);
64
62
  for (const buildProfile of buildProfiles) {
65
63
  if (buildProfile.profile.image && ['default', 'stable'].includes(buildProfile.profile.image)) {
66
64
  log_1.default.warn(`The "image" field in the build profile "${buildProfile.profileName}" is set to "${buildProfile.profile.image}". This tag is deprecated and will be removed in the future. Use other images or tags listed here: https://docs.expo.dev/build-reference/infrastructure/`);
@@ -99,6 +97,14 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
99
97
  const buildCtxByPlatform = {};
100
98
  for (const buildProfile of buildProfiles) {
101
99
  const platform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
100
+ const { env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
101
+ flags,
102
+ buildProfile: buildProfile.profile,
103
+ graphqlClient,
104
+ getProjectConfig: getDynamicPrivateProjectConfigAsync,
105
+ opts: { env: buildProfile.profile.env },
106
+ });
107
+ log_1.default.log(`Loaded "env" configuration for the "${buildProfile.profileName}" profile: ${env ? Object.keys(env).join(', ') : 'no environment variables specified'}. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/')}`);
102
108
  const { build: maybeBuild, buildCtx } = await prepareAndStartBuildAsync({
103
109
  projectDir,
104
110
  flags,
@@ -111,6 +117,7 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
111
117
  vcsClient,
112
118
  getDynamicPrivateProjectConfigAsync,
113
119
  customBuildConfigMetadata: customBuildConfigMetadataByPlatform[platform],
120
+ env,
114
121
  });
115
122
  if (maybeBuild) {
116
123
  startedBuilds.push({ build: maybeBuild, buildProfile });
@@ -147,7 +154,6 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
147
154
  buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
148
155
  moreBuilds: startedBuilds.length > 1,
149
156
  projectDir,
150
- buildProfile: startedBuild.buildProfile.profile,
151
157
  submitProfile,
152
158
  nonInteractive: flags.nonInteractive,
153
159
  selectedSubmitProfileName: flags.submitProfile,
@@ -205,7 +211,7 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
205
211
  };
206
212
  }
207
213
  exports.runBuildAndSubmitAsync = runBuildAndSubmitAsync;
208
- async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, easJsonCliConfig, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, }) {
214
+ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, easJsonCliConfig, actor, graphqlClient, analytics, vcsClient, getDynamicPrivateProjectConfigAsync, customBuildConfigMetadata, env, }) {
209
215
  const buildCtx = await (0, createContext_1.createBuildContextAsync)({
210
216
  buildProfileName: buildProfile.profileName,
211
217
  resourceClassFlag: flags.resourceClass,
@@ -227,6 +233,7 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
227
233
  buildLoggerLevel: flags.buildLoggerLevel,
228
234
  freezeCredentials: flags.freezeCredentials,
229
235
  repack: flags.repack,
236
+ env,
230
237
  });
231
238
  if (moreBuilds) {
232
239
  log_1.default.newLine();
@@ -287,7 +294,7 @@ async function startBuildAsync(ctx) {
287
294
  }
288
295
  return await sendBuildRequestAsync();
289
296
  }
290
- async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, selectedSubmitProfileName, nonInteractive, }) {
297
+ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, submitProfile, selectedSubmitProfileName, nonInteractive, }) {
291
298
  const platform = (0, AppPlatform_1.toPlatform)(build.platform);
292
299
  const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
293
300
  platform,
@@ -295,7 +302,7 @@ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, pro
295
302
  profile: submitProfile,
296
303
  archiveFlags: { id: build.id },
297
304
  nonInteractive,
298
- env: buildProfile.env,
305
+ env: buildCtx.env,
299
306
  credentialsCtx: buildCtx.credentialsCtx,
300
307
  applicationIdentifier: buildCtx.android?.applicationId ?? buildCtx.ios?.bundleIdentifier,
301
308
  actor: buildCtx.user,
@@ -44,7 +44,9 @@ function printBuildResults(builds) {
44
44
  printBuildResult(build);
45
45
  }
46
46
  else {
47
- builds.filter(i => i).forEach(build => printBuildResult(build));
47
+ builds.filter(i => i).forEach(build => {
48
+ printBuildResult(build);
49
+ });
48
50
  }
49
51
  }
50
52
  exports.printBuildResults = printBuildResults;
@@ -69,7 +71,9 @@ function printBuildResult(build) {
69
71
  // It's tricky to install the .apk file directly on Android so let's fallback
70
72
  // to the build details page and let people press the button to download there
71
73
  const qrcodeUrl = build.platform === generated_1.AppPlatform.Ios ? (0, url_1.getInternalDistributionInstallUrl)(build) : logsUrl;
72
- qrcode_terminal_1.default.generate(qrcodeUrl, { small: true }, code => log_1.default.log(`${(0, indent_string_1.default)(code, 2)}\n`));
74
+ qrcode_terminal_1.default.generate(qrcodeUrl, { small: true }, code => {
75
+ log_1.default.log(`${(0, indent_string_1.default)(code, 2)}\n`);
76
+ });
73
77
  log_1.default.log(`${platform_1.appPlatformEmojis[build.platform]} Open this link on your ${platform_1.appPlatformDisplayNames[build.platform]} devices (or scan the QR code) to install the app:`);
74
78
  log_1.default.log(`${(0, log_1.link)(logsUrl)}`);
75
79
  }
@@ -10,8 +10,8 @@ const semver_1 = tslib_1.__importDefault(require("semver"));
10
10
  const log_1 = tslib_1.__importStar(require("../log"));
11
11
  const image_1 = require("../utils/image");
12
12
  function checkNodeEnvVariable(ctx) {
13
- if (ctx.buildProfile.env?.NODE_ENV === 'production') {
14
- log_1.default.warn('You set NODE_ENV=production in the build profile. Remember that it will be available during the entire build process. In particular, it will make yarn/npm install only production packages.');
13
+ if (ctx.env?.NODE_ENV === 'production') {
14
+ log_1.default.warn('You set NODE_ENV=production in the build profile or environment variables. Remember that it will be available during the entire build process. In particular, it will make yarn/npm install only production packages.');
15
15
  log_1.default.newLine();
16
16
  }
17
17
  }
@@ -19,7 +19,7 @@ import { Connection, Edge, QueryParams } from '../../utils/relay';
19
19
  * @args willFetchAgain If the query will fetch again to get a complete page.
20
20
  */
21
21
  export declare class SelectChannel implements EASUpdateAction<UpdateChannelBasicInfoFragment | null> {
22
- private options;
22
+ private readonly options;
23
23
  constructor(options?: {
24
24
  filterPredicate?: (channelInfo: UpdateChannelBasicInfoFragment) => boolean;
25
25
  printedType?: string;
@@ -52,8 +52,8 @@ class SelectChannel {
52
52
  throw new utils_1.NonInteractiveError(`${printedType} selection cannot be run in non-interactive mode.`);
53
53
  }
54
54
  const queryAsync = async (queryParams) => filterPredicate
55
- ? this.filterQueryAsync(ctx, queryParams, filterPredicate)
56
- : this.queryAsync(ctx, queryParams);
55
+ ? await this.filterQueryAsync(ctx, queryParams, filterPredicate)
56
+ : await this.queryAsync(ctx, queryParams);
57
57
  const getTitleAsync = async (channelInfo) => channelInfo.name;
58
58
  return await (0, relay_1.selectPaginatedAsync)({
59
59
  queryAsync,
@@ -55,7 +55,9 @@ async function listAndRenderChannelsOnAppAsync(graphqlClient, { projectId, pagin
55
55
  queryToPerform: (limit, offset) => queryChannelsOnAppAsync(graphqlClient, { limit, offset, appId: projectId }),
56
56
  promptOptions: {
57
57
  title: 'Load more channels?',
58
- renderListItems: channels => renderPageOfChannels(channels, paginatedQueryOptions),
58
+ renderListItems: channels => {
59
+ renderPageOfChannels(channels, paginatedQueryOptions);
60
+ },
59
61
  },
60
62
  });
61
63
  }
@@ -85,7 +87,9 @@ async function listAndRenderBranchesAndUpdatesOnChannelAsync(graphqlClient, { pr
85
87
  }),
86
88
  promptOptions: {
87
89
  title: 'Load more channels?',
88
- renderListItems: branches => renderPageOfBranchesOnChannel(channel, branches, paginatedQueryOptions),
90
+ renderListItems: branches => {
91
+ renderPageOfBranchesOnChannel(channel, branches, paginatedQueryOptions);
92
+ },
89
93
  },
90
94
  });
91
95
  }
@@ -58,12 +58,12 @@ class EasCommand extends core_1.Command {
58
58
  // commands/submit === submit, commands/build/list === build:list
59
59
  action: `eas ${this.id}`,
60
60
  });
61
- return this.runAsync();
61
+ return await this.runAsync();
62
62
  }
63
63
  // eslint-disable-next-line async-protect/async-suffix
64
64
  async finally(err) {
65
65
  await this.analytics.flushAsync();
66
- return super.finally(err);
66
+ return await super.finally(err);
67
67
  }
68
68
  catch(err) {
69
69
  let baseMessage = `${this.id} command failed.`;
@@ -17,7 +17,7 @@ function createGraphqlClient(authInfo) {
17
17
  retryIf: (err, operation) => {
18
18
  return !!(err &&
19
19
  !operation.context.noRetry &&
20
- (err.networkError || err.graphQLErrors.some(e => e?.extensions?.isTransient)));
20
+ (err.networkError ?? err.graphQLErrors.some(e => e?.extensions?.isTransient)));
21
21
  },
22
22
  }),
23
23
  core_1.fetchExchange,
@@ -1,7 +1,23 @@
1
+ import { EnvironmentVariableEnvironment, EnvironmentVariableScope, EnvironmentVariableVisibility } from '../graphql/generated';
1
2
  export declare const EasNonInteractiveAndJsonFlags: {
2
3
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
3
4
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
4
5
  };
6
+ export declare const EASEnvironmentFlag: {
7
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
8
+ };
9
+ export declare const EASEnvironmentFlagHidden: {
10
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
11
+ };
12
+ export declare const EASVariableFormatFlag: {
13
+ format: import("@oclif/core/lib/interfaces").OptionFlag<string>;
14
+ };
15
+ export declare const EASVariableVisibilityFlag: {
16
+ visibility: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableVisibility | undefined>;
17
+ };
18
+ export declare const EASVariableScopeFlag: {
19
+ scope: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableScope>;
20
+ };
5
21
  export declare const EASNonInteractiveFlag: {
6
22
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
23
  };
@@ -1,7 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
3
+ exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASEnvironmentFlagHidden = exports.EASEnvironmentFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
4
4
  const core_1 = require("@oclif/core");
5
+ const generated_1 = require("../graphql/generated");
6
+ // NOTE: not exactly true, but, provided mapToLowercase and upperCaseAsync
7
+ // are used in tandem, it saves on unnecessary typying in commands
8
+ async function upperCaseAsync(input) {
9
+ return input.toUpperCase();
10
+ }
11
+ function mapToLowercase(options) {
12
+ return options.map(option => option.toLowerCase());
13
+ }
5
14
  exports.EasNonInteractiveAndJsonFlags = {
6
15
  json: core_1.Flags.boolean({
7
16
  description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
@@ -11,6 +20,57 @@ exports.EasNonInteractiveAndJsonFlags = {
11
20
  description: 'Run the command in non-interactive mode.',
12
21
  }),
13
22
  };
23
+ exports.EASEnvironmentFlag = {
24
+ environment: core_1.Flags.enum({
25
+ description: "Environment variable's environment",
26
+ parse: upperCaseAsync,
27
+ options: mapToLowercase([
28
+ generated_1.EnvironmentVariableEnvironment.Development,
29
+ generated_1.EnvironmentVariableEnvironment.Preview,
30
+ generated_1.EnvironmentVariableEnvironment.Production,
31
+ ]),
32
+ }),
33
+ };
34
+ // NOTE: Used in build commands, should be replaced with EASEnvironmentFlag when
35
+ // the feature is public
36
+ exports.EASEnvironmentFlagHidden = {
37
+ environment: core_1.Flags.enum({
38
+ description: "Environment variable's environment",
39
+ parse: upperCaseAsync,
40
+ hidden: true,
41
+ options: mapToLowercase([
42
+ generated_1.EnvironmentVariableEnvironment.Development,
43
+ generated_1.EnvironmentVariableEnvironment.Preview,
44
+ generated_1.EnvironmentVariableEnvironment.Production,
45
+ ]),
46
+ }),
47
+ };
48
+ exports.EASVariableFormatFlag = {
49
+ format: core_1.Flags.enum({
50
+ description: 'Output format',
51
+ options: ['long', 'short'],
52
+ default: 'short',
53
+ }),
54
+ };
55
+ exports.EASVariableVisibilityFlag = {
56
+ visibility: core_1.Flags.enum({
57
+ description: 'Visibility of the variable',
58
+ options: mapToLowercase([
59
+ generated_1.EnvironmentVariableVisibility.Secret,
60
+ generated_1.EnvironmentVariableVisibility.Sensitive,
61
+ generated_1.EnvironmentVariableVisibility.Public,
62
+ ]),
63
+ parse: upperCaseAsync,
64
+ }),
65
+ };
66
+ exports.EASVariableScopeFlag = {
67
+ scope: core_1.Flags.enum({
68
+ description: 'Scope for the variable',
69
+ options: mapToLowercase([generated_1.EnvironmentVariableScope.Shared, generated_1.EnvironmentVariableScope.Project]),
70
+ parse: upperCaseAsync,
71
+ default: generated_1.EnvironmentVariableScope.Project,
72
+ }),
73
+ };
14
74
  exports.EASNonInteractiveFlag = {
15
75
  'non-interactive': core_1.Flags.boolean({
16
76
  description: 'Run the command in non-interactive mode.',
@@ -48,8 +48,12 @@ class FeatureGating {
48
48
  }
49
49
  }
50
50
  static overrideKeyForEachInTest(key, enabled) {
51
- beforeEach(() => FeatureGateTestOverrides.setOverride(key, enabled));
52
- afterEach(() => FeatureGateTestOverrides.removeOverride(key));
51
+ beforeEach(() => {
52
+ FeatureGateTestOverrides.setOverride(key, enabled);
53
+ });
54
+ afterEach(() => {
55
+ FeatureGateTestOverrides.removeOverride(key);
56
+ });
53
57
  }
54
58
  }
55
59
  exports.default = FeatureGating;
@@ -8,7 +8,7 @@ class AnalyticsView extends EasCommand_1.default {
8
8
  async runAsync() {
9
9
  const { STATUS: status } = (await this.parse(AnalyticsView)).args;
10
10
  if (status) {
11
- (0, AnalyticsManager_1.setAnalyticsEnabledAsync)(status === 'on');
11
+ await (0, AnalyticsManager_1.setAnalyticsEnabledAsync)(status === 'on');
12
12
  log_1.default.withTick(`${status === 'on' ? 'Enabling' : 'Disabling'} analytics.`);
13
13
  }
14
14
  else {