eas-cli 0.33.1 → 0.36.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 (195) hide show
  1. package/README.md +27 -27
  2. package/build/analytics/common.d.ts +8 -0
  3. package/build/analytics/common.js +19 -0
  4. package/build/analytics/events.d.ts +43 -0
  5. package/build/analytics/events.js +51 -0
  6. package/build/{analytics.d.ts → analytics/rudderstackClient.d.ts} +0 -0
  7. package/build/{analytics.js → analytics/rudderstackClient.js} +4 -10
  8. package/build/api.js +3 -3
  9. package/build/build/android/configure.js +2 -2
  10. package/build/build/android/graphql.js +2 -4
  11. package/build/build/android/prepareJob.js +4 -3
  12. package/build/build/build.js +20 -29
  13. package/build/build/configure.js +14 -7
  14. package/build/build/context.d.ts +1 -1
  15. package/build/build/context.js +2 -2
  16. package/build/build/ios/UpdatesModule.js +2 -2
  17. package/build/build/ios/credentials.js +3 -3
  18. package/build/build/ios/graphql.js +2 -23
  19. package/build/build/ios/prepareJob.js +4 -6
  20. package/build/build/local.js +18 -27
  21. package/build/build/metadata.js +5 -10
  22. package/build/build/types.d.ts +0 -1
  23. package/build/build/utils/devClient.js +8 -5
  24. package/build/build/utils/formatBuild.js +1 -9
  25. package/build/build/utils/repository.js +10 -7
  26. package/build/build/utils/url.js +1 -1
  27. package/build/build/validate.js +4 -4
  28. package/build/commandUtils/EasCommand.d.ts +1 -0
  29. package/build/commandUtils/EasCommand.js +25 -4
  30. package/build/commands/branch/create.js +3 -2
  31. package/build/commands/branch/delete.js +1 -1
  32. package/build/commands/branch/list.js +1 -1
  33. package/build/commands/branch/publish.js +6 -5
  34. package/build/commands/branch/view.js +1 -1
  35. package/build/commands/build/index.js +44 -25
  36. package/build/commands/channel/edit.js +1 -1
  37. package/build/commands/channel/list.js +1 -1
  38. package/build/commands/channel/view.js +1 -1
  39. package/build/commands/diagnostics.js +2 -2
  40. package/build/commands/project/info.js +1 -1
  41. package/build/commands/secret/delete.js +1 -1
  42. package/build/commands/update/view.js +1 -1
  43. package/build/credentials/android/AndroidCredentialsProvider.js +2 -2
  44. package/build/credentials/android/actions/RemoveFcm.js +4 -4
  45. package/build/credentials/android/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  46. package/build/credentials/android/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +3 -3
  47. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  48. package/build/credentials/android/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +3 -3
  49. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.d.ts → SetUpGoogleServiceAccountKey.d.ts} +1 -1
  50. package/build/credentials/android/actions/{SetupGoogleServiceAccountKey.js → SetUpGoogleServiceAccountKey.js} +3 -3
  51. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
  52. package/build/credentials/android/utils/keystore.js +67 -32
  53. package/build/credentials/credentialsJson/update.js +5 -4
  54. package/build/credentials/errors.d.ts +4 -0
  55. package/build/credentials/errors.js +8 -1
  56. package/build/credentials/ios/IosCredentialsProvider.js +4 -4
  57. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +17 -1
  58. package/build/credentials/ios/actions/AscApiKeyUtils.js +158 -24
  59. package/build/credentials/ios/actions/AssignAscApiKey.d.ts +9 -0
  60. package/build/credentials/ios/actions/AssignAscApiKey.js +29 -0
  61. package/build/credentials/ios/actions/CreateAscApiKey.d.ts +9 -0
  62. package/build/credentials/ios/actions/CreateAscApiKey.js +21 -0
  63. package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
  64. package/build/credentials/ios/actions/CreatePushKey.js +1 -1
  65. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
  66. package/build/credentials/ios/actions/DistributionCertificateUtils.js +6 -8
  67. package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
  68. package/build/credentials/ios/actions/PushKeyUtils.js +6 -6
  69. package/build/credentials/ios/actions/RemoveAscApiKey.d.ts +14 -0
  70. package/build/credentials/ios/actions/RemoveAscApiKey.js +55 -0
  71. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.d.ts → SetUpAdhocProvisioningProfile.d.ts} +1 -1
  72. package/build/credentials/ios/actions/{SetupAdhocProvisioningProfile.js → SetUpAdhocProvisioningProfile.js} +5 -5
  73. package/build/credentials/ios/actions/SetUpAscApiKey.d.ts +21 -0
  74. package/build/credentials/ios/actions/SetUpAscApiKey.js +114 -0
  75. package/build/credentials/ios/actions/{SetupBuildCredentials.d.ts → SetUpBuildCredentials.d.ts} +1 -1
  76. package/build/credentials/ios/actions/{SetupBuildCredentials.js → SetUpBuildCredentials.js} +5 -5
  77. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.d.ts → SetUpBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  78. package/build/credentials/ios/actions/{SetupBuildCredentialsFromCredentialsJson.js → SetUpBuildCredentialsFromCredentialsJson.js} +5 -5
  79. package/build/credentials/ios/actions/{SetupDistributionCertificate.d.ts → SetUpDistributionCertificate.d.ts} +1 -1
  80. package/build/credentials/ios/actions/{SetupDistributionCertificate.js → SetUpDistributionCertificate.js} +3 -3
  81. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.d.ts → SetUpInternalProvisioningProfile.d.ts} +1 -1
  82. package/build/credentials/ios/actions/{SetupInternalProvisioningProfile.js → SetUpInternalProvisioningProfile.js} +7 -7
  83. package/build/credentials/ios/actions/{SetupProvisioningProfile.d.ts → SetUpProvisioningProfile.d.ts} +1 -1
  84. package/build/credentials/ios/actions/{SetupProvisioningProfile.js → SetUpProvisioningProfile.js} +5 -5
  85. package/build/credentials/ios/actions/{SetupPushKey.d.ts → SetUpPushKey.d.ts} +1 -1
  86. package/build/credentials/ios/actions/{SetupPushKey.js → SetUpPushKey.js} +3 -3
  87. package/build/credentials/ios/actions/SetUpSubmissionCredentials.d.ts +10 -0
  88. package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +53 -0
  89. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.d.ts → SetUpTargetBuildCredentials.d.ts} +1 -1
  90. package/build/credentials/ios/actions/{SetupTargetBuildCredentials.js → SetUpTargetBuildCredentials.js} +10 -10
  91. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.d.ts → SetUpTargetBuildCredentialsFromCredentialsJson.d.ts} +1 -1
  92. package/build/credentials/ios/actions/{SetupTargetBuildCredentialsFromCredentialsJson.js → SetUpTargetBuildCredentialsFromCredentialsJson.js} +3 -3
  93. package/build/credentials/ios/api/GraphqlClient.d.ts +8 -2
  94. package/build/credentials/ios/api/GraphqlClient.js +74 -2
  95. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.d.ts +5 -0
  96. package/build/credentials/ios/api/graphql/mutations/AppStoreConnectApiKeyMutation.js +54 -0
  97. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.d.ts +1 -0
  98. package/build/credentials/ios/api/graphql/mutations/IosAppCredentialsMutation.js +25 -0
  99. package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
  100. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +4 -0
  101. package/build/credentials/ios/api/graphql/queries/AppStoreConnectApiKeyQuery.js +33 -0
  102. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
  103. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
  104. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
  105. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
  106. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
  107. package/build/credentials/ios/appstore/AppStoreApi.d.ts +1 -1
  108. package/build/credentials/ios/appstore/Credentials.types.d.ts +1 -0
  109. package/build/credentials/ios/appstore/ascApiKey.d.ts +1 -1
  110. package/build/credentials/ios/appstore/ascApiKey.js +11 -1
  111. package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
  112. package/build/credentials/ios/appstore/entitlements.js +20 -10
  113. package/build/credentials/ios/credentials.d.ts +2 -1
  114. package/build/credentials/ios/credentials.js +7 -2
  115. package/build/credentials/ios/utils/printCredentials.js +30 -1
  116. package/build/credentials/ios/validators/validateAscApiKey.d.ts +5 -0
  117. package/build/credentials/ios/validators/validateAscApiKey.js +21 -0
  118. package/build/credentials/manager/Actions.d.ts +52 -0
  119. package/build/credentials/manager/Actions.js +53 -0
  120. package/build/credentials/manager/AndroidActions.d.ts +6 -0
  121. package/build/credentials/manager/AndroidActions.js +114 -0
  122. package/build/credentials/manager/IosActions.d.ts +7 -0
  123. package/build/credentials/manager/IosActions.js +145 -0
  124. package/build/credentials/manager/ManageAndroid.d.ts +1 -29
  125. package/build/credentials/manager/ManageAndroid.js +30 -163
  126. package/build/credentials/manager/ManageIos.d.ts +1 -29
  127. package/build/credentials/manager/ManageIos.js +81 -169
  128. package/build/credentials/utils/promptForCredentials.d.ts +2 -1
  129. package/build/credentials/utils/promptForCredentials.js +3 -2
  130. package/build/graphql/client.d.ts +8 -2
  131. package/build/graphql/client.js +1 -1
  132. package/build/graphql/generated.d.ts +313 -85
  133. package/build/graphql/generated.js +23 -1
  134. package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
  135. package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
  136. package/build/graphql/queries/BuildQuery.js +4 -1
  137. package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
  138. package/build/graphql/queries/ProjectQuery.js +3 -1
  139. package/build/graphql/queries/PublishQuery.js +4 -1
  140. package/build/graphql/queries/SubmissionQuery.js +5 -2
  141. package/build/graphql/queries/UserQuery.js +4 -1
  142. package/build/graphql/queries/WebhookQuery.js +6 -2
  143. package/build/graphql/types/Build.js +1 -6
  144. package/build/graphql/types/credentials/AppStoreConnectApiKey.d.ts +1 -0
  145. package/build/graphql/types/credentials/AppStoreConnectApiKey.js +23 -0
  146. package/build/graphql/types/credentials/IosAppCredentials.js +6 -0
  147. package/build/log.d.ts +0 -2
  148. package/build/log.js +2 -12
  149. package/build/project/projectUtils.js +1 -1
  150. package/build/project/publish.js +2 -2
  151. package/build/project/workflow.js +2 -2
  152. package/build/submit/ArchiveSource.js +2 -1
  153. package/build/submit/BaseSubmitter.d.ts +20 -4
  154. package/build/submit/BaseSubmitter.js +34 -1
  155. package/build/submit/android/AndroidSubmitter.d.ts +12 -6
  156. package/build/submit/android/AndroidSubmitter.js +31 -20
  157. package/build/submit/android/ServiceAccountSource.js +2 -2
  158. package/build/submit/context.d.ts +2 -0
  159. package/build/submit/context.js +14 -0
  160. package/build/submit/ios/AppSpecificPasswordSource.d.ts +9 -6
  161. package/build/submit/ios/AppSpecificPasswordSource.js +42 -20
  162. package/build/submit/ios/AscApiKeySource.d.ts +9 -3
  163. package/build/submit/ios/AscApiKeySource.js +10 -10
  164. package/build/submit/ios/CredentialsServiceSource.d.ts +15 -0
  165. package/build/submit/ios/CredentialsServiceSource.js +52 -0
  166. package/build/submit/ios/IosSubmitCommand.d.ts +1 -2
  167. package/build/submit/ios/IosSubmitCommand.js +24 -53
  168. package/build/submit/ios/IosSubmitter.d.ts +20 -7
  169. package/build/submit/ios/IosSubmitter.js +79 -43
  170. package/build/submit/submit.js +13 -4
  171. package/build/submit/utils/errors.js +2 -0
  172. package/build/user/User.js +2 -1
  173. package/build/utils/easCli.d.ts +1 -0
  174. package/build/utils/easCli.js +5 -0
  175. package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
  176. package/build/utils/{expoCommand.js → expoCli.js} +0 -0
  177. package/build/utils/profiles.js +9 -2
  178. package/build/vcs/clients/git.d.ts +26 -0
  179. package/build/vcs/clients/git.js +184 -0
  180. package/build/vcs/clients/gitNoCommit.d.ts +7 -0
  181. package/build/vcs/clients/gitNoCommit.js +27 -0
  182. package/build/vcs/clients/noVcs.d.ts +6 -0
  183. package/build/vcs/clients/noVcs.js +19 -0
  184. package/build/vcs/git.d.ts +10 -17
  185. package/build/vcs/git.js +7 -175
  186. package/build/vcs/index.d.ts +2 -2
  187. package/build/vcs/index.js +15 -6
  188. package/build/vcs/local.d.ts +18 -5
  189. package/build/vcs/local.js +61 -32
  190. package/build/vcs/vcs.d.ts +2 -1
  191. package/build/vcs/vcs.js +8 -4
  192. package/oclif.manifest.json +1 -1
  193. package/package.json +7 -7
  194. package/build/build/utils/analytics.d.ts +0 -22
  195. package/build/build/utils/analytics.js +0 -28
@@ -13,7 +13,8 @@ const platform_1 = require("../platform");
13
13
  const workflow_1 = require("../project/workflow");
14
14
  const prompts_1 = require("../prompts");
15
15
  const actions_1 = require("../user/actions");
16
- const vcs_1 = (0, tslib_1.__importDefault)(require("../vcs"));
16
+ const easCli_1 = require("../utils/easCli");
17
+ const vcs_1 = require("../vcs");
17
18
  const configure_1 = require("./android/configure");
18
19
  const configure_2 = require("./ios/configure");
19
20
  const repository_1 = require("./utils/repository");
@@ -33,7 +34,7 @@ async function ensureProjectConfiguredAsync(projectDir, requestedPlatform) {
33
34
  projectDir,
34
35
  platform: requestedPlatform,
35
36
  });
36
- if (await vcs_1.default.hasUncommittedChangesAsync()) {
37
+ if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
37
38
  (0, errors_1.error)('Build process requires clean working tree, please commit all your changes and run `eas build` again', { exit: 1 });
38
39
  }
39
40
  }
@@ -43,7 +44,7 @@ async function ensureProjectConfiguredAsync(projectDir, requestedPlatform) {
43
44
  }
44
45
  exports.ensureProjectConfiguredAsync = ensureProjectConfiguredAsync;
45
46
  async function configureAsync(options) {
46
- await vcs_1.default.ensureRepoExistsAsync();
47
+ await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
47
48
  await (0, repository_1.maybeBailOnRepoStatusAsync)();
48
49
  const { exp } = (0, config_1.getConfig)(options.projectDir, { skipSDKVersionRequirement: true });
49
50
  const ctx = {
@@ -64,17 +65,20 @@ async function configureAsync(options) {
64
65
  if (ctx.shouldConfigureIos) {
65
66
  await (0, configure_2.configureIosAsync)(ctx);
66
67
  }
67
- if (await vcs_1.default.hasUncommittedChangesAsync()) {
68
+ if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
68
69
  log_1.default.newLine();
69
70
  await reviewAndCommitChangesAsync(configureCommitMessage[options.platform]);
70
71
  }
71
- else {
72
+ else if (!(await (0, vcs_1.getVcsClient)().hasUncommittedChangesAsync())) {
72
73
  log_1.default.newLine();
73
74
  log_1.default.withTick('No changes were necessary, the project is already configured correctly.');
74
75
  }
75
76
  }
76
77
  exports.configureAsync = configureAsync;
77
78
  const EAS_JSON_MANAGED_DEFAULT = {
79
+ cli: {
80
+ version: `>= ${easCli_1.easCliVersion}`,
81
+ },
78
82
  build: {
79
83
  development: {
80
84
  developmentClient: true,
@@ -90,6 +94,9 @@ const EAS_JSON_MANAGED_DEFAULT = {
90
94
  },
91
95
  };
92
96
  const EAS_JSON_BARE_DEFAULT = {
97
+ cli: {
98
+ version: `>= ${easCli_1.easCliVersion}`,
99
+ },
93
100
  build: {
94
101
  development: {
95
102
  distribution: 'internal',
@@ -121,7 +128,7 @@ async function ensureEasJsonExistsAsync(ctx) {
121
128
  ? EAS_JSON_BARE_DEFAULT
122
129
  : EAS_JSON_MANAGED_DEFAULT;
123
130
  await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
124
- await vcs_1.default.trackFileAsync(easJsonPath);
131
+ await (0, vcs_1.getVcsClient)().trackFileAsync(easJsonPath);
125
132
  log_1.default.withTick('Generated eas.json');
126
133
  }
127
134
  exports.ensureEasJsonExistsAsync = ensureEasJsonExistsAsync;
@@ -152,7 +159,7 @@ async function reviewAndCommitChangesAsync(initialCommitMessage, askedFirstTime
152
159
  log_1.default.withTick('Committed changes');
153
160
  }
154
161
  else if (selected === ShouldCommitChanges.ShowDiffFirst) {
155
- await vcs_1.default.showDiffAsync();
162
+ await (0, vcs_1.getVcsClient)().showDiffAsync();
156
163
  await reviewAndCommitChangesAsync(initialCommitMessage, false);
157
164
  }
158
165
  }
@@ -1,10 +1,10 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Platform, Workflow } from '@expo/eas-build-job';
3
3
  import { BuildProfile } from '@expo/eas-json';
4
+ import { TrackingContext } from '../analytics/common';
4
5
  import { CredentialsContext } from '../credentials/context';
5
6
  import { RequestedPlatform } from '../platform';
6
7
  import { Actor } from '../user/User';
7
- import { TrackingContext } from './types';
8
8
  export interface ConfigureContext {
9
9
  user: Actor;
10
10
  projectDir: string;
@@ -6,13 +6,13 @@ const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
7
7
  const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
8
8
  const uuid_1 = require("uuid");
9
+ const events_1 = require("../analytics/events");
9
10
  const context_1 = require("../credentials/context");
10
11
  const expoConfig_1 = require("../project/expoConfig");
11
12
  const projectUtils_1 = require("../project/projectUtils");
12
13
  const workflow_1 = require("../project/workflow");
13
14
  const Account_1 = require("../user/Account");
14
15
  const actions_1 = require("../user/actions");
15
- const analytics_1 = (0, tslib_1.__importStar)(require("./utils/analytics"));
16
16
  async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, local, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
17
17
  var _a;
18
18
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
@@ -42,7 +42,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
42
42
  project_type: workflow,
43
43
  ...devClientProperties,
44
44
  };
45
- analytics_1.default.logEvent(analytics_1.Event.BUILD_COMMAND, trackingCtx);
45
+ events_1.Analytics.logEvent(events_1.BuildEvent.BUILD_COMMAND, trackingCtx);
46
46
  return {
47
47
  accountName,
48
48
  buildProfile,
@@ -6,7 +6,7 @@ const config_plugins_1 = require("@expo/config-plugins");
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
7
7
  const projectUtils_1 = require("../../project/projectUtils");
8
8
  const actions_1 = require("../../user/actions");
9
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
9
+ const vcs_1 = require("../../vcs");
10
10
  const updates_1 = require("../utils/updates");
11
11
  const plist_1 = require("./plist");
12
12
  async function configureUpdatesAsync(projectDir, exp) {
@@ -55,7 +55,7 @@ async function readExpoPlistAsync(projectDir) {
55
55
  async function writeExpoPlistAsync(projectDir, expoPlist) {
56
56
  const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
57
57
  await (0, plist_1.writePlistAsync)(expoPlistPath, expoPlist);
58
- await vcs_1.default.trackFileAsync(expoPlistPath);
58
+ await (0, vcs_1.getVcsClient)().trackFileAsync(expoPlistPath);
59
59
  }
60
60
  async function readReleaseChannelSafelyAsync(projectDir) {
61
61
  var _a;
@@ -8,7 +8,7 @@ const BuildCredentialsUtils_1 = require("../../credentials/ios/actions/BuildCred
8
8
  const entitlements_1 = require("../../credentials/ios/appstore/entitlements");
9
9
  const credentials_1 = require("../utils/credentials");
10
10
  async function ensureIosCredentialsAsync(buildCtx, targets) {
11
- var _a;
11
+ var _a, _b;
12
12
  if (!shouldProvideCredentials(buildCtx)) {
13
13
  return;
14
14
  }
@@ -16,9 +16,9 @@ async function ensureIosCredentialsAsync(buildCtx, targets) {
16
16
  app: (0, BuildCredentialsUtils_1.getAppFromContext)(buildCtx.credentialsCtx),
17
17
  targets,
18
18
  iosCapabilitiesOptions: {
19
- entitlements: await (0, entitlements_1.resolveEntitlementsJsonAsync)(buildCtx.projectDir, buildCtx.workflow),
19
+ entitlements: await (0, entitlements_1.resolveEntitlementsJsonAsync)(buildCtx.projectDir, buildCtx.workflow, (_a = buildCtx.buildProfile.env) !== null && _a !== void 0 ? _a : {}),
20
20
  },
21
- distribution: (_a = buildCtx.buildProfile.distribution) !== null && _a !== void 0 ? _a : 'store',
21
+ distribution: (_b = buildCtx.buildProfile.distribution) !== null && _b !== void 0 ? _b : 'store',
22
22
  enterpriseProvisioning: buildCtx.buildProfile.enterpriseProvisioning,
23
23
  });
24
24
  const { credentialsSource } = buildCtx.buildProfile;
@@ -2,9 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformJob = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const eas_build_job_1 = require("@expo/eas-build-job");
6
5
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
7
- const generated_1 = require("../../graphql/generated");
8
6
  const graphql_1 = require("../graphql");
9
7
  function transformJob(job) {
10
8
  return {
@@ -13,29 +11,18 @@ function transformJob(job) {
13
11
  projectRootDirectory: job.projectRootDirectory,
14
12
  releaseChannel: job.releaseChannel,
15
13
  updates: job.updates,
16
- distribution: job.distribution && transformDistributionType(job.distribution),
17
14
  secrets: transformIosSecrets(job.secrets),
18
15
  builderEnvironment: job.builderEnvironment,
19
16
  cache: job.cache,
20
17
  scheme: job.scheme,
21
18
  buildConfiguration: job.buildConfiguration,
22
19
  artifactPath: job.artifactPath,
23
- buildType: job.buildType && transformBuildType(job.buildType),
24
20
  username: job.username,
21
+ developmentClient: job.developmentClient,
22
+ simulator: job.simulator,
25
23
  };
26
24
  }
27
25
  exports.transformJob = transformJob;
28
- function transformDistributionType(distributionType) {
29
- if (distributionType === 'store') {
30
- return generated_1.DistributionType.Store;
31
- }
32
- else if (distributionType === 'internal') {
33
- return generated_1.DistributionType.Internal;
34
- }
35
- else {
36
- return generated_1.DistributionType.Simulator;
37
- }
38
- }
39
26
  function transformIosSecrets(secrets) {
40
27
  var _a, _b, _c;
41
28
  const buildCredentials = [];
@@ -53,11 +40,3 @@ function transformIosSecrets(secrets) {
53
40
  environmentSecrets: secrets.env,
54
41
  };
55
42
  }
56
- function transformBuildType(buildType) {
57
- if (buildType === eas_build_job_1.Ios.BuildType.DEVELOPMENT_CLIENT) {
58
- return generated_1.IosBuildType.DevelopmentClient;
59
- }
60
- else {
61
- return generated_1.IosBuildType.Release;
62
- }
63
- }
@@ -7,14 +7,14 @@ const path_1 = (0, tslib_1.__importDefault)(require("path"));
7
7
  const slash_1 = (0, tslib_1.__importDefault)(require("slash"));
8
8
  const projectUtils_1 = require("../../project/projectUtils");
9
9
  const actions_1 = require("../../user/actions");
10
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
10
+ const vcs_1 = require("../../vcs");
11
11
  const cacheDefaults = {
12
12
  disabled: false,
13
13
  customPaths: [],
14
14
  cacheDefaultPaths: true,
15
15
  };
16
16
  async function prepareJobAsync(ctx, jobData) {
17
- const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await vcs_1.default.getRootPathAsync(), ctx.projectDir)) || '.';
17
+ const projectRootDirectory = (0, slash_1.default)(path_1.default.relative(await (0, vcs_1.getVcsClient)().getRootPathAsync(), ctx.projectDir)) || '.';
18
18
  const username = (0, projectUtils_1.getUsername)(ctx.exp, await (0, actions_1.ensureLoggedInAsync)());
19
19
  const buildCredentials = {};
20
20
  if (jobData.credentials) {
@@ -28,7 +28,6 @@ async function prepareJobAsync(ctx, jobData) {
28
28
  platform: eas_build_job_1.Platform.IOS,
29
29
  projectArchive: jobData.projectArchive,
30
30
  projectRootDirectory,
31
- distribution: ctx.buildProfile.simulator ? 'simulator' : ctx.buildProfile.distribution,
32
31
  builderEnvironment: {
33
32
  image: ctx.buildProfile.image,
34
33
  node: ctx.buildProfile.node,
@@ -49,12 +48,11 @@ async function prepareJobAsync(ctx, jobData) {
49
48
  },
50
49
  releaseChannel: ctx.buildProfile.releaseChannel,
51
50
  updates: { channel: ctx.buildProfile.channel },
51
+ developmentClient: ctx.buildProfile.developmentClient,
52
+ simulator: ctx.buildProfile.simulator,
52
53
  scheme: jobData.buildScheme,
53
54
  buildConfiguration: ctx.buildProfile.buildConfiguration,
54
55
  artifactPath: ctx.buildProfile.artifactPath,
55
- buildType: ctx.buildProfile.developmentClient
56
- ? eas_build_job_1.Ios.BuildType.DEVELOPMENT_CLIENT
57
- : eas_build_job_1.Ios.BuildType.RELEASE,
58
56
  username,
59
57
  };
60
58
  return (0, eas_build_job_1.sanitizeJob)(job);
@@ -3,36 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.runLocalBuildAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"));
6
- const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
8
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
9
- const log_1 = (0, tslib_1.__importDefault)(require("../log"));
10
6
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
7
+ const PLUGIN_PACKAGE_VERSION = '0.0.47';
11
8
  async function runLocalBuildAsync(job) {
12
- var _a, _b;
13
- const execNameOrPath = (_b = (_a = process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) !== null && _a !== void 0 ? _a : (await findWithNodeResolutionAsync())) !== null && _b !== void 0 ? _b : PLUGIN_PACKAGE_NAME;
14
- try {
15
- const arg = Buffer.from(JSON.stringify({ job })).toString('base64');
16
- await (0, spawn_async_1.default)(execNameOrPath, [arg], {
17
- stdio: 'inherit',
18
- });
19
- }
20
- catch (err) {
21
- if (err.code === 'ENOENT') {
22
- log_1.default.warn(`Could not resolve executable ${execNameOrPath}.`);
23
- log_1.default.warn(`Install ${PLUGIN_PACKAGE_NAME} package from npm e.g. ${chalk_1.default.bold(`npm install -g ${PLUGIN_PACKAGE_NAME}`)} and make sure it's in PATH.`);
24
- throw err;
25
- }
26
- }
9
+ const { command, args } = getCommandAndArgs(job);
10
+ await (0, spawn_async_1.default)(command, args, {
11
+ stdio: 'inherit',
12
+ });
27
13
  }
28
14
  exports.runLocalBuildAsync = runLocalBuildAsync;
29
- async function findWithNodeResolutionAsync() {
30
- try {
31
- const resolvedPath = path_1.default.resolve(path_1.default.dirname(require.resolve(PLUGIN_PACKAGE_NAME)), '../bin/run');
32
- if (await fs_extra_1.default.pathExists(resolvedPath)) {
33
- return resolvedPath;
34
- }
15
+ function getCommandAndArgs(job) {
16
+ const jobBase64 = Buffer.from(JSON.stringify({ job })).toString('base64');
17
+ if (process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) {
18
+ return {
19
+ command: process.env.EAS_LOCAL_BUILD_PLUGIN_PATH,
20
+ args: [jobBase64],
21
+ };
22
+ }
23
+ else {
24
+ return {
25
+ command: 'npx',
26
+ args: ['-y', `${PLUGIN_PACKAGE_NAME}@${PLUGIN_PACKAGE_VERSION}`, jobBase64],
27
+ };
35
28
  }
36
- catch { }
37
- return undefined;
38
29
  }
@@ -1,24 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.collectMetadataAsync = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const eas_build_job_1 = require("@expo/eas-build-job");
6
5
  const applicationId_1 = require("../project/android/applicationId");
7
6
  const bundleIdentifier_1 = require("../project/ios/bundleIdentifier");
8
7
  const projectUtils_1 = require("../project/projectUtils");
9
8
  const actions_1 = require("../user/actions");
10
- const vcs_1 = (0, tslib_1.__importDefault)(require("../vcs"));
9
+ const easCli_1 = require("../utils/easCli");
10
+ const vcs_1 = require("../vcs");
11
11
  const UpdatesModule_1 = require("./android/UpdatesModule");
12
12
  const version_1 = require("./android/version");
13
13
  const UpdatesModule_2 = require("./ios/UpdatesModule");
14
14
  const version_2 = require("./ios/version");
15
15
  const updates_1 = require("./utils/updates");
16
- /**
17
- * We use require() to exclude package.json from TypeScript's analysis since it lives outside
18
- * the src directory and would change the directory structure of the emitted files
19
- * under the build directory
20
- */
21
- const packageJSON = require('../../package.json');
22
16
  async function collectMetadataAsync(ctx, platformContext) {
23
17
  var _a;
24
18
  const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx);
@@ -28,7 +22,7 @@ async function collectMetadataAsync(ctx, platformContext) {
28
22
  const metadata = {
29
23
  trackingContext: ctx.trackingCtx,
30
24
  ...(await maybeResolveVersionsAsync(ctx, platformContext)),
31
- cliVersion: packageJSON.version,
25
+ cliVersion: easCli_1.easCliVersion,
32
26
  workflow: ctx.workflow,
33
27
  credentialsSource: ctx.buildProfile.credentialsSource,
34
28
  sdkVersion: ctx.exp.sdkVersion,
@@ -38,7 +32,8 @@ async function collectMetadataAsync(ctx, platformContext) {
38
32
  appName: ctx.exp.name,
39
33
  appIdentifier: await resolveAppIdentifierAsync(ctx, platformContext),
40
34
  buildProfile: ctx.buildProfileName,
41
- gitCommitHash: await vcs_1.default.getCommitHashAsync(),
35
+ gitCommitHash: await (0, vcs_1.getVcsClient)().getCommitHashAsync(),
36
+ isGitWorkingTreeDirty: await (0, vcs_1.getVcsClient)().hasUncommittedChangesAsync(),
42
37
  username: (0, projectUtils_1.getUsername)(ctx.exp, await (0, actions_1.ensureLoggedInAsync)()),
43
38
  ...(ctx.platform === eas_build_job_1.Platform.IOS && {
44
39
  iosEnterpriseProvisioning: resolveIosEnterpriseProvisioning(ctx),
@@ -11,4 +11,3 @@ export declare enum BuildDistributionType {
11
11
  INTERNAL = "internal",
12
12
  SIMULATOR = "simulator"
13
13
  }
14
- export declare type TrackingContext = Record<string, string | number | boolean>;
@@ -11,7 +11,8 @@ const log_1 = (0, tslib_1.__importStar)(require("../../log"));
11
11
  const platform_1 = require("../../platform");
12
12
  const workflow_1 = require("../../project/workflow");
13
13
  const prompts_1 = require("../../prompts");
14
- const expoCommand_1 = require("../../utils/expoCommand");
14
+ const expoCli_1 = require("../../utils/expoCli");
15
+ const vcs_1 = require("../../vcs");
15
16
  const repository_1 = require("./repository");
16
17
  async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive = false, buildProfiles = [], }) {
17
18
  if (await isExpoDevClientInstalledAsync(projectDir)) {
@@ -76,9 +77,11 @@ async function installExpoDevClientAsync(projectDir, { nonInteractive }) {
76
77
  log_1.default.newLine();
77
78
  log_1.default.log(`Running ${chalk_1.default.bold('expo install expo-dev-client')}`);
78
79
  log_1.default.newLine();
79
- await (0, expoCommand_1.expoCommandAsync)(projectDir, ['install', 'expo-dev-client']);
80
+ await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-dev-client']);
80
81
  log_1.default.newLine();
81
- await (0, repository_1.reviewAndCommitChangesAsync)('Install expo-dev-client', {
82
- nonInteractive,
83
- });
82
+ if (await (0, vcs_1.getVcsClient)().isCommitRequiredAsync()) {
83
+ await (0, repository_1.reviewAndCommitChangesAsync)('Install expo-dev-client', {
84
+ nonInteractive,
85
+ });
86
+ }
84
87
  }
@@ -117,13 +117,5 @@ function formatGraphQLBuild(build) {
117
117
  exports.formatGraphQLBuild = formatGraphQLBuild;
118
118
  const getActorName = (build) => {
119
119
  var _a;
120
- if (!build.initiatingActor) {
121
- return 'unknown';
122
- }
123
- else if (build.initiatingActor.__typename === 'User') {
124
- return build.initiatingActor.username;
125
- }
126
- else {
127
- return (_a = build.initiatingActor.firstName) !== null && _a !== void 0 ? _a : 'unknown';
128
- }
120
+ return ((_a = build.initiatingActor) === null || _a === void 0 ? void 0 : _a.displayName) || 'unknown';
129
121
  };
@@ -13,9 +13,9 @@ const prompts_1 = require("../../prompts");
13
13
  const files_1 = require("../../utils/files");
14
14
  const paths_1 = require("../../utils/paths");
15
15
  const timer_1 = require("../../utils/timer");
16
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
16
+ const vcs_1 = require("../../vcs");
17
17
  async function maybeBailOnRepoStatusAsync() {
18
- if (!(await vcs_1.default.hasUncommittedChangesAsync())) {
18
+ if (!(await (0, vcs_1.getVcsClient)().isCommitRequiredAsync())) {
19
19
  return;
20
20
  }
21
21
  log_1.default.addNewLineIfNone();
@@ -30,7 +30,7 @@ async function maybeBailOnRepoStatusAsync() {
30
30
  }
31
31
  exports.maybeBailOnRepoStatusAsync = maybeBailOnRepoStatusAsync;
32
32
  async function ensureRepoIsCleanAsync(nonInteractive = false) {
33
- if (!(await vcs_1.default.hasUncommittedChangesAsync())) {
33
+ if (!(await (0, vcs_1.getVcsClient)().isCommitRequiredAsync())) {
34
34
  return;
35
35
  }
36
36
  log_1.default.addNewLineIfNone();
@@ -58,7 +58,7 @@ async function commitPromptAsync({ initialCommitMessage, commitAllFiles, } = {})
58
58
  initial: initialCommitMessage,
59
59
  validate: (input) => input !== '',
60
60
  });
61
- await vcs_1.default.commitAsync({ commitAllFiles, commitMessage: message });
61
+ await (0, vcs_1.getVcsClient)().commitAsync({ commitAllFiles, commitMessage: message });
62
62
  }
63
63
  exports.commitPromptAsync = commitPromptAsync;
64
64
  async function makeProjectTarballAsync() {
@@ -77,7 +77,7 @@ async function makeProjectTarballAsync() {
77
77
  const compressTimerLabel = 'makeProjectTarballAsync';
78
78
  (0, timer_1.startTimer)(compressTimerLabel);
79
79
  try {
80
- await vcs_1.default.makeShallowCopyAsync(shallowClonePath);
80
+ await (0, vcs_1.getVcsClient)().makeShallowCopyAsync(shallowClonePath);
81
81
  await tar_1.default.create({ cwd: shallowClonePath, file: tarPath, prefix: 'project', gzip: true }, [
82
82
  '.',
83
83
  ]);
@@ -110,7 +110,10 @@ var ShouldCommitChanges;
110
110
  })(ShouldCommitChanges || (ShouldCommitChanges = {}));
111
111
  async function reviewAndCommitChangesAsync(initialCommitMessage, { nonInteractive, askedFirstTime = true }) {
112
112
  if (process.env.EAS_BUILD_AUTOCOMMIT) {
113
- await vcs_1.default.commitAsync({ commitMessage: initialCommitMessage, commitAllFiles: false });
113
+ await (0, vcs_1.getVcsClient)().commitAsync({
114
+ commitMessage: initialCommitMessage,
115
+ commitAllFiles: false,
116
+ });
114
117
  log_1.default.withTick('Committed changes.');
115
118
  return;
116
119
  }
@@ -140,7 +143,7 @@ async function reviewAndCommitChangesAsync(initialCommitMessage, { nonInteractiv
140
143
  log_1.default.withTick('Committed changes.');
141
144
  }
142
145
  else if (selected === ShouldCommitChanges.ShowDiffFirst) {
143
- await vcs_1.default.showDiffAsync();
146
+ await (0, vcs_1.getVcsClient)().showDiffAsync();
144
147
  await reviewAndCommitChangesAsync(initialCommitMessage, {
145
148
  nonInteractive,
146
149
  askedFirstTime: false,
@@ -26,7 +26,7 @@ exports.getArtifactUrl = getArtifactUrl;
26
26
  function getInternalDistributionInstallUrl(build) {
27
27
  var _a;
28
28
  if (build.platform === generated_1.AppPlatform.Ios) {
29
- return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/--/api/v2/projects/${build.project.id}/builds/${build.id}/manifest.plist`;
29
+ return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/v2/projects/${build.project.id}/builds/${build.id}/manifest.plist`;
30
30
  }
31
31
  (0, assert_1.default)((_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.buildUrl, 'buildUrl is missing');
32
32
  return build.artifacts.buildUrl;
@@ -6,7 +6,7 @@ const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
7
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
8
8
  const log_1 = (0, tslib_1.__importStar)(require("../log"));
9
- const vcs_1 = (0, tslib_1.__importDefault)(require("../vcs"));
9
+ const vcs_1 = require("../vcs");
10
10
  function checkNodeEnvVariable(ctx) {
11
11
  var _a;
12
12
  if (((_a = ctx.buildProfile.env) === null || _a === void 0 ? void 0 : _a.NODE_ENV) === 'production') {
@@ -24,14 +24,14 @@ async function checkGoogleServicesFileAsync(ctx) {
24
24
  if (!googleServicesFilePath) {
25
25
  return;
26
26
  }
27
- const rootDir = path_1.default.normalize(await vcs_1.default.getRootPathAsync());
27
+ const rootDir = path_1.default.normalize(await (0, vcs_1.getVcsClient)().getRootPathAsync());
28
28
  const absGoogleServicesFilePath = path_1.default.resolve(ctx.projectDir, googleServicesFilePath);
29
29
  if ((await fs_extra_1.default.pathExists(absGoogleServicesFilePath)) &&
30
30
  (!isInsideDirectory(absGoogleServicesFilePath, rootDir) ||
31
- (await vcs_1.default.isFileIgnoredAsync(path_1.default.relative(rootDir, absGoogleServicesFilePath))))) {
31
+ (await (0, vcs_1.getVcsClient)().isFileIgnoredAsync(path_1.default.relative(rootDir, absGoogleServicesFilePath))))) {
32
32
  log_1.default.warn(`File specified via "${ctx.platform}.googleServicesFile" field in your app.json is not checked in to your repository and won't be uploaded to the builder.`);
33
33
  log_1.default.warn(`Use EAS Secret to pass all values that you don't want to include in your version control. ${(0, log_1.learnMore)('https://docs.expo.dev/build-reference/variables/#using-secrets-in-environment-variables')}`);
34
- log_1.default.warn('If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting GOOGLE_SERVICES_FILE in your build profile in eas.json to any non-falsy value.');
34
+ log_1.default.warn(`If you are using that file for compatibility with the classic build service (expo build) you can silence this warning by setting your build profile's env.GOOGLE_SERVICES_FILE in eas.json to any non-empty string.`);
35
35
  log_1.default.newLine();
36
36
  }
37
37
  }
@@ -8,4 +8,5 @@ export default abstract class EasCommand extends Command {
8
8
  protected abstract runAsync(): Promise<any>;
9
9
  run(): Promise<any>;
10
10
  finally(err: Error): Promise<any>;
11
+ private applyCliConfigAsync;
11
12
  }
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const eas_json_1 = require("@expo/eas-json");
3
5
  const command_1 = require("@oclif/command");
4
- const analytics_1 = require("../analytics");
6
+ const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
7
+ const rudderstackClient_1 = require("../analytics/rudderstackClient");
8
+ const log_1 = (0, tslib_1.__importDefault)(require("../log"));
9
+ const projectUtils_1 = require("../project/projectUtils");
5
10
  const User_1 = require("../user/User");
6
11
  const actions_1 = require("../user/actions");
12
+ const easCli_1 = require("../utils/easCli");
13
+ const vcs_1 = require("../vcs");
14
+ const git_1 = (0, tslib_1.__importDefault)(require("../vcs/clients/git"));
7
15
  class EasCommand extends command_1.Command {
8
16
  constructor() {
9
17
  super(...arguments);
@@ -16,7 +24,9 @@ class EasCommand extends command_1.Command {
16
24
  // eslint-disable-next-line async-protect/async-suffix
17
25
  async run() {
18
26
  var _a;
19
- await (0, analytics_1.initAsync)();
27
+ eas_json_1.EasJsonReader.setLog(log_1.default);
28
+ await (0, rudderstackClient_1.initAsync)();
29
+ await this.applyCliConfigAsync();
20
30
  if (this.requiresAuthentication) {
21
31
  const { flags } = this.parse();
22
32
  const nonInteractive = (_a = flags['non-interactive']) !== null && _a !== void 0 ? _a : false;
@@ -25,7 +35,7 @@ class EasCommand extends command_1.Command {
25
35
  else {
26
36
  await (0, User_1.getUserAsync)();
27
37
  }
28
- (0, analytics_1.logEvent)(analytics_1.AnalyticsEvent.ACTION, {
38
+ (0, rudderstackClient_1.logEvent)(rudderstackClient_1.AnalyticsEvent.ACTION, {
29
39
  // id is assigned by oclif in constructor based on the filepath:
30
40
  // commands/submit === submit, commands/build/list === build:list
31
41
  action: `eas ${this.id}`,
@@ -34,8 +44,19 @@ class EasCommand extends command_1.Command {
34
44
  }
35
45
  // eslint-disable-next-line async-protect/async-suffix
36
46
  async finally(err) {
37
- await (0, analytics_1.flushAsync)();
47
+ await (0, rudderstackClient_1.flushAsync)();
38
48
  return super.finally(err);
39
49
  }
50
+ async applyCliConfigAsync() {
51
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
52
+ const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
53
+ const config = await easJsonReader.getCliConfigAsync();
54
+ if ((config === null || config === void 0 ? void 0 : config.version) && !semver_1.default.satisfies(easCli_1.easCliVersion, config.version)) {
55
+ throw new Error(`You are on eas-cli@${easCli_1.easCliVersion} which does not satisfy the CLI version constraint in eas.json (${config.version})`);
56
+ }
57
+ if (config === null || config === void 0 ? void 0 : config.requireCommit) {
58
+ (0, vcs_1.setVcsClient)(new git_1.default());
59
+ }
60
+ }
40
61
  }
41
62
  exports.default = EasCommand;
@@ -11,7 +11,7 @@ const client_1 = require("../../graphql/client");
11
11
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
14
+ const vcs_1 = require("../../vcs");
15
15
  async function createUpdateBranchOnAppAsync({ appId, name, }) {
16
16
  const result = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
17
17
  .mutation((0, graphql_tag_1.default) `
@@ -51,7 +51,8 @@ class BranchCreate extends EasCommand_1.default {
51
51
  type: 'text',
52
52
  name: 'name',
53
53
  message: 'Please name the branch:',
54
- initial: (await vcs_1.default.getBranchNameAsync()) || `branch-${Math.random().toString(36).substr(2, 4)}`,
54
+ initial: (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
55
+ `branch-${Math.random().toString(36).substr(2, 4)}`,
55
56
  validate: value => (value ? true : validationMessage),
56
57
  }));
57
58
  }
@@ -27,7 +27,7 @@ async function getBranchInfoAsync({ appId, name, }) {
27
27
  `, {
28
28
  appId,
29
29
  name,
30
- })
30
+ }, { additionalTypenames: ['UpdateBranch'] })
31
31
  .toPromise());
32
32
  return data;
33
33
  }
@@ -34,7 +34,7 @@ async function listBranchesAsync({ projectId, }) {
34
34
  `, {
35
35
  appId: projectId,
36
36
  limit: BRANCHES_LIMIT,
37
- })
37
+ }, { additionalTypenames: ['UpdateBranch'] })
38
38
  .toPromise());
39
39
  return (_b = (_a = data === null || data === void 0 ? void 0 : data.app) === null || _a === void 0 ? void 0 : _a.byId.updateBranches) !== null && _b !== void 0 ? _b : [];
40
40
  }