eas-cli 0.33.1 → 0.34.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 (90) hide show
  1. package/README.md +26 -26
  2. package/build/analytics.js +3 -9
  3. package/build/build/android/configure.js +2 -2
  4. package/build/build/android/graphql.js +2 -4
  5. package/build/build/android/prepareJob.js +4 -3
  6. package/build/build/build.js +2 -2
  7. package/build/build/configure.js +14 -7
  8. package/build/build/ios/UpdatesModule.js +2 -2
  9. package/build/build/ios/graphql.js +2 -23
  10. package/build/build/ios/prepareJob.js +4 -6
  11. package/build/build/metadata.js +5 -10
  12. package/build/build/utils/devClient.js +2 -2
  13. package/build/build/utils/repository.js +10 -7
  14. package/build/build/validate.js +4 -4
  15. package/build/commandUtils/EasCommand.d.ts +1 -0
  16. package/build/commandUtils/EasCommand.js +21 -0
  17. package/build/commands/branch/create.js +3 -2
  18. package/build/commands/branch/delete.js +1 -1
  19. package/build/commands/branch/list.js +1 -1
  20. package/build/commands/branch/publish.js +6 -5
  21. package/build/commands/branch/view.js +1 -1
  22. package/build/commands/build/index.js +35 -25
  23. package/build/commands/channel/edit.js +1 -1
  24. package/build/commands/channel/list.js +1 -1
  25. package/build/commands/channel/view.js +1 -1
  26. package/build/commands/diagnostics.js +2 -2
  27. package/build/commands/project/info.js +1 -1
  28. package/build/commands/update/view.js +1 -1
  29. package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
  30. package/build/credentials/credentialsJson/update.js +5 -4
  31. package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
  32. package/build/credentials/ios/actions/CreatePushKey.js +1 -1
  33. package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
  34. package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -7
  35. package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
  36. package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
  37. package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
  38. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
  39. package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
  40. package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
  41. package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
  42. package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
  43. package/build/credentials/manager/Actions.d.ts +47 -0
  44. package/build/credentials/manager/Actions.js +48 -0
  45. package/build/credentials/manager/AndroidActions.d.ts +6 -0
  46. package/build/credentials/manager/AndroidActions.js +114 -0
  47. package/build/credentials/manager/IosActions.d.ts +6 -0
  48. package/build/credentials/manager/IosActions.js +110 -0
  49. package/build/credentials/manager/ManageAndroid.d.ts +1 -29
  50. package/build/credentials/manager/ManageAndroid.js +26 -159
  51. package/build/credentials/manager/ManageIos.d.ts +1 -29
  52. package/build/credentials/manager/ManageIos.js +28 -155
  53. package/build/graphql/client.d.ts +8 -2
  54. package/build/graphql/generated.d.ts +85 -8
  55. package/build/graphql/generated.js +23 -1
  56. package/build/graphql/queries/BuildQuery.js +4 -1
  57. package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
  58. package/build/graphql/queries/ProjectQuery.js +3 -1
  59. package/build/graphql/queries/PublishQuery.js +4 -1
  60. package/build/graphql/queries/SubmissionQuery.js +5 -2
  61. package/build/graphql/queries/UserQuery.js +4 -1
  62. package/build/graphql/queries/WebhookQuery.js +6 -2
  63. package/build/log.d.ts +0 -2
  64. package/build/log.js +2 -12
  65. package/build/project/projectUtils.js +1 -1
  66. package/build/project/publish.js +2 -2
  67. package/build/project/workflow.js +2 -2
  68. package/build/submit/ios/IosSubmitter.js +1 -1
  69. package/build/user/User.js +1 -0
  70. package/build/utils/easCli.d.ts +1 -0
  71. package/build/utils/easCli.js +5 -0
  72. package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
  73. package/build/utils/{expoCommand.js → expoCli.js} +0 -0
  74. package/build/utils/profiles.js +9 -2
  75. package/build/vcs/clients/git.d.ts +26 -0
  76. package/build/vcs/clients/git.js +184 -0
  77. package/build/vcs/clients/gitNoCommit.d.ts +7 -0
  78. package/build/vcs/clients/gitNoCommit.js +27 -0
  79. package/build/vcs/clients/noVcs.d.ts +6 -0
  80. package/build/vcs/clients/noVcs.js +19 -0
  81. package/build/vcs/git.d.ts +10 -17
  82. package/build/vcs/git.js +7 -175
  83. package/build/vcs/index.d.ts +2 -2
  84. package/build/vcs/index.js +15 -6
  85. package/build/vcs/local.d.ts +18 -5
  86. package/build/vcs/local.js +61 -32
  87. package/build/vcs/vcs.d.ts +2 -1
  88. package/build/vcs/vcs.js +8 -4
  89. package/oclif.manifest.json +1 -1
  90. package/package.json +4 -4
@@ -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,
@@ -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");
6
+ const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
4
7
  const analytics_1 = require("../analytics");
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;
27
+ eas_json_1.EasJsonReader.setLog(log_1.default);
19
28
  await (0, analytics_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;
@@ -37,5 +47,16 @@ class EasCommand extends command_1.Command {
37
47
  await (0, analytics_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
  }
@@ -22,7 +22,7 @@ const prompts_1 = require("../../prompts");
22
22
  const utils_1 = require("../../update/utils");
23
23
  const uniqBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/uniqBy"));
24
24
  const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
25
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
25
+ const vcs_1 = require("../../vcs");
26
26
  const create_1 = require("./create");
27
27
  const list_1 = require("./list");
28
28
  const view_1 = require("./view");
@@ -42,7 +42,7 @@ async function getUpdateGroupAsync({ group, }) {
42
42
  }
43
43
  `, {
44
44
  group,
45
- })
45
+ }, { additionalTypenames: ['Update'] })
46
46
  .toPromise());
47
47
  return updatesByGroup;
48
48
  }
@@ -75,7 +75,8 @@ class BranchPublish extends EasCommand_1.default {
75
75
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
76
76
  if (!branchName && autoFlag) {
77
77
  branchName =
78
- (await vcs_1.default.getBranchNameAsync()) || `branch-${Math.random().toString(36).substr(2, 4)}`;
78
+ (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
79
+ `branch-${Math.random().toString(36).substr(2, 4)}`;
79
80
  }
80
81
  if (!branchName) {
81
82
  const validationMessage = 'branch name may not be empty.';
@@ -172,7 +173,7 @@ class BranchPublish extends EasCommand_1.default {
172
173
  }
173
174
  }
174
175
  if (!message && autoFlag) {
175
- message = (_b = (await vcs_1.default.getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim();
176
+ message = (_b = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim();
176
177
  }
177
178
  if (!message) {
178
179
  const validationMessage = 'publish message may not be empty.';
@@ -185,7 +186,7 @@ class BranchPublish extends EasCommand_1.default {
185
186
  message: `Please enter a publication message.`,
186
187
  initial: republish
187
188
  ? `Republish "${oldMessage}" - group: ${group}`
188
- : (_c = (await vcs_1.default.getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
189
+ : (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
189
190
  validate: value => (value ? true : validationMessage),
190
191
  }));
191
192
  }
@@ -52,7 +52,7 @@ async function viewUpdateBranchAsync({ appId, name, }) {
52
52
  appId,
53
53
  name,
54
54
  limit: PAGE_LIMIT,
55
- })
55
+ }, { additionalTypenames: ['UpdateBranch', 'Update'] })
56
56
  .toPromise());
57
57
  return data;
58
58
  }
@@ -7,6 +7,8 @@ const eas_json_1 = require("@expo/eas-json");
7
7
  const command_1 = require("@oclif/command");
8
8
  const errors_1 = require("@oclif/errors");
9
9
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
10
+ const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
11
+ const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
10
12
  const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
11
13
  const build_1 = require("../../build/android/build");
12
14
  const build_2 = require("../../build/build");
@@ -19,7 +21,7 @@ const repository_1 = require("../../build/utils/repository");
19
21
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
20
22
  const generated_1 = require("../../graphql/generated");
21
23
  const AppPlatform_1 = require("../../graphql/types/AppPlatform");
22
- const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
24
+ const log_1 = (0, tslib_1.__importStar)(require("../../log"));
23
25
  const platform_1 = require("../../platform");
24
26
  const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
25
27
  const metroConfig_1 = require("../../project/metroConfig");
@@ -28,9 +30,11 @@ const prompts_1 = require("../../prompts");
28
30
  const context_2 = require("../../submit/context");
29
31
  const submit_1 = require("../../submit/submit");
30
32
  const urls_1 = require("../../submit/utils/urls");
33
+ const easCli_1 = require("../../utils/easCli");
31
34
  const json_1 = require("../../utils/json");
32
35
  const profiles_1 = require("../../utils/profiles");
33
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
36
+ const vcs_1 = require("../../vcs");
37
+ const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
34
38
  class Build extends EasCommand_1.default {
35
39
  constructor() {
36
40
  super(...arguments);
@@ -46,7 +50,7 @@ class Build extends EasCommand_1.default {
46
50
  const { requestedPlatform } = flags;
47
51
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
48
52
  await handleDeprecatedEasJsonAsync(projectDir, flags.nonInteractive);
49
- await vcs_1.default.ensureRepoExistsAsync();
53
+ await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
50
54
  await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
51
55
  await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, requestedPlatform);
52
56
  const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
@@ -272,28 +276,34 @@ Build.flags = {
272
276
  }),
273
277
  };
274
278
  async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
275
- if (await (0, eas_json_1.isUsingDeprecatedFormatAsync)(projectDir)) {
276
- const hasMismatchedExtendsKeys = await (0, eas_json_1.hasMismatchedExtendsAsync)(projectDir);
277
- if (nonInteractive) {
278
- log_1.default.error('We detected that your eas.json is using a deprecated format.');
279
- log_1.default.error('We will convert it automatically if run this command without --non-interactive flag. Alternatively, you can update eas.json manually according to https://docs.expo.dev/build/eas-json');
280
- (0, errors_1.error)('Unsupported eas.json format', { exit: 1 });
281
- }
282
- const confirm = await (0, prompts_1.confirmAsync)({
283
- message: 'We detected that your eas.json is using a deprecated format, do you want to migrate to the new format?',
284
- });
285
- if (confirm) {
286
- await (0, eas_json_1.migrateAsync)(projectDir);
287
- if (hasMismatchedExtendsKeys) {
288
- log_1.default.warn('"extends" keyword can only be migrated automatically to the new format if both Android and iOS profiles extend base profiles with the same names for both platforms');
289
- log_1.default.warn('Migration was successful, but you need to manually adjust the extend rules for your profiles');
290
- (0, errors_1.error)('Fix eas.json manually', { exit: 1 });
291
- }
292
- }
293
- else {
294
- log_1.default.error("Aborting, update your eas.json according to https://docs.expo.dev/build/eas-json and run 'eas build' again");
295
- (0, errors_1.error)('Unsupported eas.json format', { exit: 1 });
296
- }
279
+ if (!(await fs_extra_1.default.pathExists(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir)))) {
280
+ return;
281
+ }
282
+ const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
283
+ const rawEasJson = await easJsonReader.readRawAsync();
284
+ if (rawEasJson === null || rawEasJson === void 0 ? void 0 : rawEasJson.cli) {
285
+ return;
286
+ }
287
+ if (nonInteractive) {
288
+ log_1.default.warn(`${figures_1.default.warning} Action required: the default behavior of EAS CLI has changed and your eas.json must be updated to remove ambiguity around which Git integration workflow to use. Refer to ${(0, log_1.link)('https://expo.fyi/eas-vcs-workflow')} for more information.`);
289
+ log_1.default.warn('This warning will become an error in an upcoming EAS CLI release. For now, we will proceed with the old default behavior to avoid disruption of your builds.');
290
+ (0, vcs_1.setVcsClient)(new git_1.default());
291
+ return;
292
+ }
293
+ log_1.default.log(`${chalk_1.default.bold('eas-cli@>=0.34.0 no longer requires that you commit changes to Git before starting a build.')} ${(0, log_1.learnMore)('https://expo.fyi/eas-vcs-workflow')}`);
294
+ log_1.default.log(`If you want to continue using the Git integration, you can opt in with ${chalk_1.default.bold('cli.requireCommit')} in ${chalk_1.default.bold('eas.json')} or with the following prompt`);
295
+ log_1.default.newLine();
296
+ const mode = await (0, prompts_1.selectAsync)('Select your preferred Git integration', [
297
+ { title: 'Require changes to be committed in Git (old default)', value: 'requireCommit' },
298
+ { title: 'Allow builds with dirty Git working tree (new default)', value: 'noCommit' },
299
+ ]);
300
+ rawEasJson.cli =
301
+ mode === 'requireCommit'
302
+ ? { version: `>= ${easCli_1.easCliVersion}`, requireCommit: true }
303
+ : { version: `>= ${easCli_1.easCliVersion}` };
304
+ await fs_extra_1.default.writeJSON(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir), rawEasJson, { spaces: 2 });
305
+ if (mode === 'requireCommit') {
306
+ (0, vcs_1.setVcsClient)(new git_1.default());
297
307
  }
298
308
  }
299
309
  exports.handleDeprecatedEasJsonAsync = handleDeprecatedEasJsonAsync;
@@ -30,7 +30,7 @@ async function getChannelByNameForAppAsync({ appId, channelName, }) {
30
30
  }
31
31
  }
32
32
  }
33
- `, { appId, channelName })
33
+ `, { appId, channelName }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch'] })
34
34
  .toPromise());
35
35
  const updateChannelByNameResult = (_a = data.app) === null || _a === void 0 ? void 0 : _a.byId.updateChannelByName;
36
36
  if (!updateChannelByNameResult) {
@@ -47,7 +47,7 @@ async function getAllUpdateChannelForAppAsync({ appId, }) {
47
47
  }
48
48
  }
49
49
  }
50
- `, { appId, offset: 0, limit: CHANNEL_LIMIT })
50
+ `, { appId, offset: 0, limit: CHANNEL_LIMIT }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] })
51
51
  .toPromise());
52
52
  }
53
53
  class ChannelList extends EasCommand_1.default {
@@ -101,7 +101,7 @@ async function getUpdateChannelByNameForAppAsync({ appId, channelName, }) {
101
101
  }
102
102
  }
103
103
  }
104
- `, { appId, channelName })
104
+ `, { appId, channelName }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] })
105
105
  .toPromise());
106
106
  }
107
107
  exports.getUpdateChannelByNameForAppAsync = getUpdateChannelByNameForAppAsync;
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const envinfo_1 = (0, tslib_1.__importDefault)(require("envinfo"));
5
5
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCommand"));
6
6
  const log_1 = (0, tslib_1.__importDefault)(require("../log"));
7
- const packageJSON = require('../../package.json');
7
+ const easCli_1 = require("../utils/easCli");
8
8
  class Diagnostics extends EasCommand_1.default {
9
9
  constructor() {
10
10
  super(...arguments);
@@ -28,7 +28,7 @@ class Diagnostics extends EasCommand_1.default {
28
28
  ],
29
29
  npmGlobalPackages: ['eas-cli', 'expo-cli'],
30
30
  }, {
31
- title: `EAS CLI ${packageJSON.version} environment info`,
31
+ title: `EAS CLI ${easCli_1.easCliVersion} environment info`,
32
32
  });
33
33
  log_1.default.log(info);
34
34
  }
@@ -19,7 +19,7 @@ async function projectInfoByIdAsync(appId) {
19
19
  }
20
20
  }
21
21
  }
22
- `, { appId })
22
+ `, { appId }, { additionalTypenames: ['App'] })
23
23
  .toPromise());
24
24
  return data;
25
25
  }
@@ -33,7 +33,7 @@ async function viewUpdateAsync({ groupId, }) {
33
33
  }
34
34
  `, {
35
35
  groupId,
36
- })
36
+ }, { additionalTypenames: ['Update'] })
37
37
  .toPromise());
38
38
  if (data.updatesByGroup.length === 0) {
39
39
  throw new Error(`Could not find any updates with group ID: "${groupId}"`);
@@ -24,6 +24,8 @@ exports.GoogleServiceAccountKeyQuery = {
24
24
  ${(0, graphql_1.print)(GoogleServiceAccountKey_1.GoogleServiceAccountKeyFragmentNode)}
25
25
  `, {
26
26
  accountName,
27
+ }, {
28
+ additionalTypenames: ['GoogleServiceAccountKey'],
27
29
  })
28
30
  .toPromise());
29
31
  return data.account.byName.googleServiceAccountKeys;
@@ -8,8 +8,8 @@ const path_1 = (0, tslib_1.__importDefault)(require("path"));
8
8
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
9
9
  const target_1 = require("../../project/ios/target");
10
10
  const zipObject_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/zipObject"));
11
- const vcs_1 = (0, tslib_1.__importDefault)(require("../../vcs"));
12
- const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/git"));
11
+ const vcs_1 = require("../../vcs");
12
+ const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
13
13
  const read_1 = require("./read");
14
14
  const utils_1 = require("./utils");
15
15
  /**
@@ -197,8 +197,9 @@ async function updateFileAsync(projectDir, filePath, base64Data) {
197
197
  }
198
198
  }
199
199
  async function isFileUntrackedAsync(path) {
200
- if (vcs_1.default instanceof git_1.default) {
201
- return await vcs_1.default.isFileUntrackedAsync(path);
200
+ const vcsClient = (0, vcs_1.getVcsClient)();
201
+ if (vcsClient instanceof git_1.default) {
202
+ return await vcsClient.isFileUntrackedAsync(path);
202
203
  }
203
204
  return false;
204
205
  }
@@ -9,7 +9,7 @@ class CreateDistributionCertificate {
9
9
  this.account = account;
10
10
  }
11
11
  async runAsync(ctx) {
12
- const distCert = await (0, DistributionCertificateUtils_1.provideOrGenerateDistributionCertificateAsync)(ctx, this.account.name);
12
+ const distCert = await (0, DistributionCertificateUtils_1.provideOrGenerateDistributionCertificateAsync)(ctx);
13
13
  const result = await ctx.ios.createDistributionCertificateAsync(this.account, distCert);
14
14
  log_1.default.succeed('Created distribution certificate');
15
15
  return result;
@@ -12,7 +12,7 @@ class CreatePushKey {
12
12
  if (ctx.nonInteractive) {
13
13
  throw new Error(`A new push key cannot be created in non-interactive mode.`);
14
14
  }
15
- const pushKey = await (0, PushKeyUtils_1.provideOrGeneratePushKeyAsync)(ctx, this.account.name);
15
+ const pushKey = await (0, PushKeyUtils_1.provideOrGeneratePushKeyAsync)(ctx);
16
16
  const result = await ctx.ios.createPushKeyAsync(this.account, pushKey);
17
17
  log_1.default.succeed('Created push key');
18
18
  return result;
@@ -12,4 +12,4 @@ export declare function selectDistributionCertificateWithDependenciesAsync(ctx:
12
12
  * select a distribution certificate from a valid set (curated on a best effort basis)
13
13
  * */
14
14
  export declare function selectValidDistributionCertificateAsync(ctx: CredentialsContext, appLookupParams: AppLookupParams): Promise<AppleDistributionCertificateFragment | null>;
15
- export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext, accountName: string): Promise<DistributionCertificate>;
15
+ export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext): Promise<DistributionCertificate>;
@@ -99,7 +99,7 @@ You can have only ${chalk_1.default.underline('three')} Apple Distribution Certi
99
99
  Please revoke the old ones or reuse existing from your other apps.
100
100
  Please remember that Apple Distribution Certificates are not application specific!
101
101
  `;
102
- async function provideOrGenerateDistributionCertificateAsync(ctx, accountName) {
102
+ async function provideOrGenerateDistributionCertificateAsync(ctx) {
103
103
  if (!ctx.nonInteractive) {
104
104
  const userProvided = await promptForDistCertAsync(ctx);
105
105
  if (userProvided) {
@@ -112,13 +112,11 @@ async function provideOrGenerateDistributionCertificateAsync(ctx, accountName) {
112
112
  if (!isValid) {
113
113
  log_1.default.warn("Provided Distribution Certificate is no longer valid on Apple's server");
114
114
  }
115
- return isValid
116
- ? userProvided
117
- : await provideOrGenerateDistributionCertificateAsync(ctx, accountName);
115
+ return isValid ? userProvided : await provideOrGenerateDistributionCertificateAsync(ctx);
118
116
  }
119
117
  }
120
118
  }
121
- return await generateDistributionCertificateAsync(ctx, accountName);
119
+ return await generateDistributionCertificateAsync(ctx);
122
120
  }
123
121
  exports.provideOrGenerateDistributionCertificateAsync = provideOrGenerateDistributionCertificateAsync;
124
122
  async function promptForDistCertAsync(ctx) {
@@ -140,7 +138,7 @@ async function promptForDistCertAsync(ctx) {
140
138
  }
141
139
  return userProvided;
142
140
  }
143
- async function generateDistributionCertificateAsync(ctx, accountName) {
141
+ async function generateDistributionCertificateAsync(ctx) {
144
142
  await ctx.appStore.ensureAuthenticatedAsync();
145
143
  try {
146
144
  return await ctx.appStore.createDistributionCertificateAsync();
@@ -176,7 +174,7 @@ async function generateDistributionCertificateAsync(ctx, accountName) {
176
174
  throw e;
177
175
  }
178
176
  }
179
- return await generateDistributionCertificateAsync(ctx, accountName);
177
+ return await generateDistributionCertificateAsync(ctx);
180
178
  }
181
179
  function formatDistributionCertificateFromApple(appleInfo) {
182
180
  const { name, status, id, expires, created, ownerName, serialNumber } = appleInfo;
@@ -2,7 +2,7 @@ import { ApplePushKeyFragment } from '../../../graphql/generated';
2
2
  import { Account } from '../../../user/Account';
3
3
  import { CredentialsContext } from '../../context';
4
4
  import { PushKey } from '../appstore/Credentials.types';
5
- export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext, accountName: string): Promise<PushKey>;
5
+ export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext): Promise<PushKey>;
6
6
  /**
7
7
  * select a push key from an account (validity status shown on a best effort basis)
8
8
  * */
@@ -12,7 +12,7 @@ const pushKey_1 = require("../appstore/pushKey");
12
12
  const credentials_1 = require("../credentials");
13
13
  const validatePushKey_1 = require("../validators/validatePushKey");
14
14
  const AppleTeamUtils_1 = require("./AppleTeamUtils");
15
- async function provideOrGeneratePushKeyAsync(ctx, accountName) {
15
+ async function provideOrGeneratePushKeyAsync(ctx) {
16
16
  if (!ctx.nonInteractive) {
17
17
  const userProvided = await promptForPushKeyAsync(ctx);
18
18
  if (userProvided) {
@@ -32,11 +32,11 @@ async function provideOrGeneratePushKeyAsync(ctx, accountName) {
32
32
  if (useUserProvided) {
33
33
  return userProvided;
34
34
  }
35
- return await provideOrGeneratePushKeyAsync(ctx, accountName);
35
+ return await provideOrGeneratePushKeyAsync(ctx);
36
36
  }
37
37
  }
38
38
  }
39
- return await generatePushKeyAsync(ctx, accountName);
39
+ return await generatePushKeyAsync(ctx);
40
40
  }
41
41
  exports.provideOrGeneratePushKeyAsync = provideOrGeneratePushKeyAsync;
42
42
  async function promptForPushKeyAsync(ctx) {
@@ -58,7 +58,7 @@ async function promptForPushKeyAsync(ctx) {
58
58
  }
59
59
  return userProvided;
60
60
  }
61
- async function generatePushKeyAsync(ctx, accountName) {
61
+ async function generatePushKeyAsync(ctx) {
62
62
  await ctx.appStore.ensureAuthenticatedAsync();
63
63
  try {
64
64
  return await ctx.appStore.createPushKeyAsync();
@@ -94,7 +94,7 @@ async function generatePushKeyAsync(ctx, accountName) {
94
94
  throw e;
95
95
  }
96
96
  }
97
- return await generatePushKeyAsync(ctx, accountName);
97
+ return await generatePushKeyAsync(ctx);
98
98
  }
99
99
  function formatPushKeyFromApple(pushKey) {
100
100
  const { name, id } = pushKey;
@@ -20,7 +20,9 @@ exports.AppQuery = {
20
20
  }
21
21
  }
22
22
  ${(0, graphql_1.print)(App_1.AppFragmentNode)}
23
- `, { fullName })
23
+ `, { fullName }, {
24
+ additionalTypenames: ['App'],
25
+ })
24
26
  .toPromise());
25
27
  (0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
26
28
  return data.app.byFullName;
@@ -68,7 +68,9 @@ exports.AppleDeviceQuery = {
68
68
  }
69
69
  }
70
70
  }
71
- `, { accountName, appleTeamIdentifier })
71
+ `, { accountName, appleTeamIdentifier }, {
72
+ additionalTypenames: ['AppleDevice', 'AppleTeam'],
73
+ })
72
74
  .toPromise());
73
75
  return data.account.byName.appleTeams[0];
74
76
  },
@@ -95,7 +97,9 @@ exports.AppleDeviceQuery = {
95
97
  }
96
98
  }
97
99
  }
98
- `, { accountName, identifier })
100
+ `, { accountName, identifier }, {
101
+ additionalTypenames: ['AppleDevice', 'AppleTeam'],
102
+ })
99
103
  .toPromise());
100
104
  return (_a = data.account.byName.appleDevices[0]) !== null && _a !== void 0 ? _a : null;
101
105
  },
@@ -47,7 +47,11 @@ exports.AppleDistributionCertificateQuery = {
47
47
  appleAppIdentifierId,
48
48
  iosDistributionType,
49
49
  }, {
50
- additionalTypenames: ['IosAppCredentials', 'IosAppBuildCredentials'],
50
+ additionalTypenames: [
51
+ 'AppleDistributionCertificate',
52
+ 'IosAppCredentials',
53
+ 'IosAppBuildCredentials',
54
+ ],
51
55
  })
52
56
  .toPromise());
53
57
  (0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
@@ -70,6 +74,8 @@ exports.AppleDistributionCertificateQuery = {
70
74
  ${(0, graphql_1.print)(AppleDistributionCertificate_1.AppleDistributionCertificateFragmentNode)}
71
75
  `, {
72
76
  accountName,
77
+ }, {
78
+ additionalTypenames: ['AppleDistributionCertificate'],
73
79
  })
74
80
  .toPromise());
75
81
  return data.account.byName.appleDistributionCertificates;
@@ -59,7 +59,11 @@ exports.AppleProvisioningProfileQuery = {
59
59
  appleAppIdentifierId,
60
60
  iosDistributionType,
61
61
  }, {
62
- additionalTypenames: ['IosAppCredentials', 'IosAppBuildCredentials'],
62
+ additionalTypenames: [
63
+ 'AppleProvisioningProfile',
64
+ 'IosAppCredentials',
65
+ 'IosAppBuildCredentials',
66
+ ],
63
67
  })
64
68
  .toPromise());
65
69
  (0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');