eas-cli 0.50.0 → 0.53.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 (79) hide show
  1. package/README.md +46 -45
  2. package/build/build/android/version.js +1 -1
  3. package/build/build/build.js +36 -27
  4. package/build/build/ios/build.js +3 -1
  5. package/build/build/ios/credentials.js +2 -6
  6. package/build/build/local.js +1 -1
  7. package/build/commands/branch/create.js +2 -2
  8. package/build/commands/branch/delete.js +2 -2
  9. package/build/commands/branch/list.js +2 -2
  10. package/build/commands/branch/rename.js +2 -2
  11. package/build/commands/branch/view.js +2 -2
  12. package/build/commands/build/cancel.js +3 -3
  13. package/build/commands/build/configure.js +2 -2
  14. package/build/commands/build/inspect.js +1 -1
  15. package/build/commands/build/list.js +2 -2
  16. package/build/commands/build/view.js +2 -2
  17. package/build/commands/channel/create.js +2 -2
  18. package/build/commands/channel/delete.js +2 -2
  19. package/build/commands/channel/edit.js +2 -2
  20. package/build/commands/channel/list.js +2 -2
  21. package/build/commands/channel/rollout.js +2 -2
  22. package/build/commands/channel/view.js +3 -3
  23. package/build/commands/device/delete.js +2 -2
  24. package/build/commands/device/list.js +2 -2
  25. package/build/commands/device/view.js +2 -2
  26. package/build/commands/project/info.js +2 -2
  27. package/build/commands/project/init.js +2 -2
  28. package/build/commands/secret/create.js +2 -2
  29. package/build/commands/secret/delete.js +2 -2
  30. package/build/commands/secret/list.js +2 -2
  31. package/build/commands/submit.js +2 -2
  32. package/build/commands/update/configure.js +2 -3
  33. package/build/commands/update/index.d.ts +1 -0
  34. package/build/commands/update/index.js +28 -6
  35. package/build/commands/update/list.js +2 -2
  36. package/build/commands/webhook/create.js +2 -2
  37. package/build/commands/webhook/delete.js +2 -2
  38. package/build/commands/webhook/list.js +2 -2
  39. package/build/credentials/android/actions/CreateGoogleServiceAccountKey.js +24 -9
  40. package/build/credentials/android/utils/googleServiceAccountKey.js +1 -1
  41. package/build/credentials/android/utils/keystore.js +1 -1
  42. package/build/credentials/android/utils/keystoreNew.js +2 -2
  43. package/build/credentials/context.js +2 -3
  44. package/build/credentials/credentialsJson/read.js +1 -1
  45. package/build/credentials/ios/IosCredentialsProvider.d.ts +0 -2
  46. package/build/credentials/ios/IosCredentialsProvider.js +0 -1
  47. package/build/credentials/ios/actions/SetUpBuildCredentials.d.ts +0 -2
  48. package/build/credentials/ios/actions/SetUpBuildCredentials.js +3 -1
  49. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.d.ts +2 -2
  50. package/build/credentials/ios/actions/SetUpTargetBuildCredentials.js +2 -2
  51. package/build/credentials/ios/types.d.ts +2 -0
  52. package/build/credentials/ios/utils/printCredentials.d.ts +1 -1
  53. package/build/credentials/ios/utils/provisioningProfile.js +1 -1
  54. package/build/credentials/ios/validators/validateProvisioningProfile.js +1 -1
  55. package/build/credentials/manager/ManageIos.js +8 -7
  56. package/build/graphql/generated.d.ts +66 -21
  57. package/build/graphql/generated.js +5 -0
  58. package/build/project/android/applicationId.js +1 -1
  59. package/build/project/ios/bundleIdentifier.js +1 -1
  60. package/build/project/ios/entitlements.d.ts +8 -0
  61. package/build/{credentials/ios/appstore → project/ios}/entitlements.js +7 -19
  62. package/build/project/ios/target.d.ts +9 -3
  63. package/build/project/ios/target.js +68 -47
  64. package/build/project/publish.js +2 -1
  65. package/build/submit/ArchiveSource.js +1 -1
  66. package/build/submit/android/ServiceAccountSource.js +1 -1
  67. package/build/submit/utils/errors.js +6 -2
  68. package/build/submit/utils/files.js +1 -1
  69. package/build/submit/utils/logs.js +1 -1
  70. package/build/update/android/UpdatesModule.js +2 -2
  71. package/build/update/ios/UpdatesModule.js +2 -2
  72. package/build/user/actions.js +1 -1
  73. package/build/utils/code-signing.js +11 -14
  74. package/build/vcs/clients/git.js +5 -5
  75. package/build/vcs/git.js +1 -1
  76. package/build/webhooks/input.js +1 -1
  77. package/oclif.manifest.json +1 -1
  78. package/package.json +38 -38
  79. package/build/credentials/ios/appstore/entitlements.d.ts +0 -4
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultPublishPlatforms = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const config_1 = require("@expo/config");
6
5
  const config_plugins_1 = require("@expo/config-plugins");
7
6
  const eas_build_job_1 = require("@expo/eas-build-job");
8
7
  const core_1 = require("@oclif/core");
@@ -19,6 +18,7 @@ const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
19
18
  const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
20
19
  const log_1 = tslib_1.__importDefault(require("../../log"));
21
20
  const ora_1 = require("../../ora");
21
+ const expoConfig_1 = require("../../project/expoConfig");
22
22
  const projectUtils_1 = require("../../project/projectUtils");
23
23
  const publish_1 = require("../../project/publish");
24
24
  const workflow_1 = require("../../project/workflow");
@@ -89,7 +89,7 @@ async function ensureBranchExistsAsync({ appId, name: branchName, }) {
89
89
  class UpdatePublish extends EasCommand_1.default {
90
90
  async runAsync() {
91
91
  var _a, _b, _c;
92
- let { flags: { branch: branchName, json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, platform, 'private-key-path': privateKeyPath, }, } = await this.parse(UpdatePublish);
92
+ let { flags: { branch: branchName, json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, platform, 'private-key-path': privateKeyPath, 'non-interactive': nonInteractive, }, } = await this.parse(UpdatePublish);
93
93
  if (jsonFlag) {
94
94
  (0, json_1.enableJsonOutput)();
95
95
  }
@@ -97,12 +97,18 @@ class UpdatePublish extends EasCommand_1.default {
97
97
  // If a group was specified, that means we are republishing it.
98
98
  republish = group ? true : republish;
99
99
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
100
- const { exp } = (0, config_1.getConfig)(projectDir, {
101
- skipSDKVersionRequirement: true,
100
+ const exp = (0, expoConfig_1.getExpoConfig)(projectDir, {
102
101
  isPublicConfig: true,
103
102
  });
104
- const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(exp, privateKeyPath);
105
- if (!(0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, exp.sdkVersion)) {
103
+ const expPrivate = (0, expoConfig_1.getExpoConfig)(projectDir, {
104
+ isPublicConfig: false,
105
+ });
106
+ const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(expPrivate, privateKeyPath);
107
+ const hasExpoUpdates = (0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, exp.sdkVersion);
108
+ if (!hasExpoUpdates && nonInteractive) {
109
+ core_1.Errors.error(`${chalk_1.default.bold('expo-updates')} must already be installed when executing in non-interactive mode`, { exit: 1 });
110
+ }
111
+ if (!hasExpoUpdates) {
106
112
  const install = await (0, prompts_1.confirmAsync)({
107
113
  message: `You are creating an update which requires ${chalk_1.default.bold('expo-updates')} to be installed in your app.\n Do you want EAS CLI to install it for you?`,
108
114
  instructions: 'The command will abort unless you agree.',
@@ -125,6 +131,9 @@ class UpdatePublish extends EasCommand_1.default {
125
131
  `branch-${Math.random().toString(36).substr(2, 4)}`;
126
132
  }
127
133
  if (!branchName) {
134
+ if (nonInteractive) {
135
+ throw new Error('Must supply --branch or use --auto when in non-interactive mode');
136
+ }
128
137
  const validationMessage = 'Branch name may not be empty.';
129
138
  if (jsonFlag) {
130
139
  throw new Error(validationMessage);
@@ -164,6 +173,9 @@ class UpdatePublish extends EasCommand_1.default {
164
173
  updatesToRepublish = await getUpdateGroupAsync({ group });
165
174
  }
166
175
  else {
176
+ if (nonInteractive) {
177
+ throw new Error('Must supply --group when in non-interactive mode');
178
+ }
167
179
  // Drop into interactive mode if the user has not specified an update group to republish.
168
180
  if (jsonFlag) {
169
181
  throw new Error('You must specify the update group to republish.');
@@ -212,6 +224,9 @@ class UpdatePublish extends EasCommand_1.default {
212
224
  oldMessage = (_a = updatesToRepublishFilteredByPlatform[0].message) !== null && _a !== void 0 ? _a : '';
213
225
  oldRuntimeVersion = updatesToRepublishFilteredByPlatform[0].runtimeVersion;
214
226
  if (!message) {
227
+ if (nonInteractive) {
228
+ throw new Error('Must supply --message when in non-interactive mode');
229
+ }
215
230
  const validationMessage = 'publish message may not be empty.';
216
231
  if (jsonFlag) {
217
232
  throw new Error(validationMessage);
@@ -230,6 +245,9 @@ class UpdatePublish extends EasCommand_1.default {
230
245
  message = (_b = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim();
231
246
  }
232
247
  if (!message) {
248
+ if (nonInteractive) {
249
+ throw new Error('Must supply --message or use --auto when in non-interactive mode');
250
+ }
233
251
  const validationMessage = 'publish message may not be empty.';
234
252
  if (jsonFlag) {
235
253
  throw new Error(validationMessage);
@@ -402,6 +420,10 @@ UpdatePublish.flags = {
402
420
  description: `File containing the PEM-encoded private key corresponding to the certificate in expo-updates' configuration. Defaults to a file named "private-key.pem" in the certificate's directory.`,
403
421
  required: false,
404
422
  }),
423
+ 'non-interactive': core_1.Flags.boolean({
424
+ default: false,
425
+ description: 'Run command in non-interactive mode',
426
+ }),
405
427
  };
406
428
  async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
407
429
  var _a, _b;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const config_1 = require("@expo/config");
5
4
  const core_1 = require("@oclif/core");
6
5
  const assert_1 = tslib_1.__importDefault(require("assert"));
7
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
@@ -9,6 +8,7 @@ const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
9
8
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
10
9
  const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
11
10
  const log_1 = tslib_1.__importDefault(require("../../log"));
11
+ const expoConfig_1 = require("../../project/expoConfig");
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
14
  const utils_1 = require("../../update/utils");
@@ -23,7 +23,7 @@ class BranchView extends EasCommand_1.default {
23
23
  (0, json_1.enableJsonOutput)();
24
24
  }
25
25
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
26
- const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
26
+ const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
27
27
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
28
28
  let updateGroupDescriptions;
29
29
  if (all) {
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const config_1 = require("@expo/config");
5
4
  const core_1 = require("@oclif/core");
6
5
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
7
6
  const generated_1 = require("../../graphql/generated");
8
7
  const WebhookMutation_1 = require("../../graphql/mutations/WebhookMutation");
9
8
  const ora_1 = require("../../ora");
9
+ const expoConfig_1 = require("../../project/expoConfig");
10
10
  const projectUtils_1 = require("../../project/projectUtils");
11
11
  const input_1 = require("../../webhooks/input");
12
12
  class WebhookCreate extends EasCommand_1.default {
@@ -14,7 +14,7 @@ class WebhookCreate extends EasCommand_1.default {
14
14
  const { flags } = await this.parse(WebhookCreate);
15
15
  const webhookInputParams = await (0, input_1.prepareInputParamsAsync)(flags);
16
16
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
17
- const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
17
+ const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
18
18
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
19
19
  const spinner = (0, ora_1.ora)('Creating a webhook').start();
20
20
  try {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const config_1 = require("@expo/config");
5
4
  const assert_1 = tslib_1.__importDefault(require("assert"));
6
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
6
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
@@ -10,6 +9,7 @@ const WebhookMutation_1 = require("../../graphql/mutations/WebhookMutation");
10
9
  const WebhookQuery_1 = require("../../graphql/queries/WebhookQuery");
11
10
  const log_1 = tslib_1.__importDefault(require("../../log"));
12
11
  const ora_1 = require("../../ora");
12
+ const expoConfig_1 = require("../../project/expoConfig");
13
13
  const projectUtils_1 = require("../../project/projectUtils");
14
14
  const prompts_1 = require("../../prompts");
15
15
  const formatWebhook_1 = require("../../webhooks/formatWebhook");
@@ -17,7 +17,7 @@ class WebhookDelete extends EasCommand_1.default {
17
17
  async runAsync() {
18
18
  let { args: { ID: webhookId }, } = await this.parse(WebhookDelete);
19
19
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
20
- const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
20
+ const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
21
21
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
22
22
  let webhook = webhookId && (await WebhookQuery_1.WebhookQuery.byIdAsync(webhookId));
23
23
  if (!webhookId) {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const config_1 = require("@expo/config");
5
4
  const core_1 = require("@oclif/core");
6
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
6
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
@@ -9,13 +8,14 @@ const generated_1 = require("../../graphql/generated");
9
8
  const WebhookQuery_1 = require("../../graphql/queries/WebhookQuery");
10
9
  const log_1 = tslib_1.__importDefault(require("../../log"));
11
10
  const ora_1 = require("../../ora");
11
+ const expoConfig_1 = require("../../project/expoConfig");
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const formatWebhook_1 = require("../../webhooks/formatWebhook");
14
14
  class WebhookList extends EasCommand_1.default {
15
15
  async runAsync() {
16
16
  const { flags: { event }, } = await this.parse(WebhookList);
17
17
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
18
- const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
18
+ const exp = (0, expoConfig_1.getExpoConfig)(projectDir);
19
19
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
20
20
  const projectFullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
21
21
  const spinner = (0, ora_1.ora)(`Fetching the list of webhook on project ${projectFullName}`).start();
@@ -2,7 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateGoogleServiceAccountKey = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const log_1 = tslib_1.__importDefault(require("../../../log"));
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
7
+ const log_1 = tslib_1.__importStar(require("../../../log"));
6
8
  const prompts_1 = require("../../../prompts");
7
9
  const googleServiceAccountKey_1 = require("../utils/googleServiceAccountKey");
8
10
  class CreateGoogleServiceAccountKey {
@@ -33,15 +35,28 @@ class CreateGoogleServiceAccountKey {
33
35
  if (detectedPath) {
34
36
  return detectedPath;
35
37
  }
36
- const { keyJsonPath } = await (0, prompts_1.promptAsync)([
37
- {
38
- type: 'text',
39
- name: 'keyJsonPath',
40
- message: 'Path to Google Service Account Key JSON file:',
41
- validate: (value) => value.length > 0 || "Path can't be empty",
38
+ log_1.default.log(`${chalk_1.default.bold('A Google Service Account JSON key is required to upload your app to Google Play Store')}.\n` +
39
+ `If you're not sure what this is or how to create one, ${(0, log_1.learnMore)('https://expo.fyi/creating-google-service-account', { learnMoreMessage: 'learn more' })}`);
40
+ const { filePath } = await (0, prompts_1.promptAsync)({
41
+ name: 'filePath',
42
+ message: 'Path to Google Service Account file:',
43
+ initial: 'api-0000000000000000000-111111-aaaaaabbbbbb.json',
44
+ type: 'text',
45
+ // eslint-disable-next-line async-protect/async-suffix
46
+ validate: async (filePath) => {
47
+ try {
48
+ const stats = await fs_extra_1.default.stat(filePath);
49
+ if (stats.isFile()) {
50
+ return true;
51
+ }
52
+ return 'Input is not a file.';
53
+ }
54
+ catch {
55
+ return 'File does not exist.';
56
+ }
42
57
  },
43
- ]);
44
- return keyJsonPath;
58
+ });
59
+ return filePath;
45
60
  }
46
61
  }
47
62
  exports.CreateGoogleServiceAccountKey = CreateGoogleServiceAccountKey;
@@ -20,7 +20,7 @@ function fileIsServiceAccountKey(keyJsonPath) {
20
20
  readAndValidateServiceAccountKey(keyJsonPath);
21
21
  return true;
22
22
  }
23
- catch (err) {
23
+ catch {
24
24
  return false;
25
25
  }
26
26
  }
@@ -20,7 +20,7 @@ async function keytoolCommandExistsAsync() {
20
20
  await (0, spawn_async_1.default)('keytool');
21
21
  return true;
22
22
  }
23
- catch (error) {
23
+ catch {
24
24
  return false;
25
25
  }
26
26
  }
@@ -26,7 +26,7 @@ function isPKCSKeystore(keystore) {
26
26
  (0, pkcs12_1.parsePKCS12)(keystore.keystore, keystore.keystorePassword);
27
27
  return true;
28
28
  }
29
- catch (e) {
29
+ catch {
30
30
  return false;
31
31
  }
32
32
  }
@@ -35,7 +35,7 @@ function isJKSKeystore(keystore) {
35
35
  jks_js_1.default.parseJks(Buffer.from(keystore.keystore, 'base64'), keystore.keystorePassword);
36
36
  return true;
37
37
  }
38
- catch (e) {
38
+ catch {
39
39
  return false;
40
40
  }
41
41
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CredentialsContext = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const config_1 = require("@expo/config");
6
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
6
  const log_1 = tslib_1.__importDefault(require("../log"));
8
7
  const expoConfig_1 = require("../project/expoConfig");
@@ -34,7 +33,7 @@ class CredentialsContext {
34
33
  try {
35
34
  return (0, expoConfig_1.getExpoConfig)(projectDir, { env });
36
35
  }
37
- catch (error) {
36
+ catch {
38
37
  // ignore error, context might be created outside of expo project
39
38
  return null;
40
39
  }
@@ -51,7 +50,7 @@ class CredentialsContext {
51
50
  return;
52
51
  }
53
52
  // trigger getConfig error
54
- (0, config_1.getConfig)(this.options.projectDir, { skipSDKVersionRequirement: true });
53
+ (0, expoConfig_1.getExpoConfig)(this.options.projectDir);
55
54
  }
56
55
  logOwnerAndProject() {
57
56
  var _a;
@@ -81,7 +81,7 @@ async function readRawAsync(projectDir, { throwIfMissing = true } = {}) {
81
81
  const credentialsJSONContents = await fs_extra_1.default.readFile(credentialsJsonFilePath, 'utf8');
82
82
  return JSON.parse(credentialsJSONContents);
83
83
  }
84
- catch (err) {
84
+ catch {
85
85
  throw new Error(`credentials.json must exist in the project root directory and contain a valid JSON`);
86
86
  }
87
87
  }
@@ -1,14 +1,12 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { CredentialsSource, DistributionType, IosEnterpriseProvisioning } from '@expo/eas-json';
3
3
  import { CredentialsContext } from '../context';
4
- import { IosCapabilitiesOptions } from './appstore/ensureAppExists';
5
4
  import { App, IosCredentials, Target } from './types';
6
5
  interface Options {
7
6
  app: App;
8
7
  targets: Target[];
9
8
  distribution: DistributionType;
10
9
  enterpriseProvisioning?: IosEnterpriseProvisioning;
11
- iosCapabilitiesOptions?: IosCapabilitiesOptions;
12
10
  }
13
11
  export default class IosCredentialsProvider {
14
12
  private ctx;
@@ -44,7 +44,6 @@ class IosCredentialsProvider {
44
44
  targets: this.options.targets,
45
45
  distribution: this.options.distribution,
46
46
  enterpriseProvisioning: this.options.enterpriseProvisioning,
47
- iosCapabilitiesOptions: this.options.iosCapabilitiesOptions,
48
47
  }).runAsync(this.ctx);
49
48
  }
50
49
  async getPushKeyAsync(ctx, targets) {
@@ -1,13 +1,11 @@
1
1
  import { DistributionType, IosEnterpriseProvisioning } from '@expo/eas-json';
2
2
  import { CredentialsContext } from '../../context';
3
- import { IosCapabilitiesOptions } from '../appstore/ensureAppExists';
4
3
  import { App, IosCredentials, Target } from '../types';
5
4
  interface Options {
6
5
  app: App;
7
6
  targets: Target[];
8
7
  distribution: DistributionType;
9
8
  enterpriseProvisioning?: IosEnterpriseProvisioning;
10
- iosCapabilitiesOptions?: IosCapabilitiesOptions;
11
9
  }
12
10
  export declare class SetUpBuildCredentials {
13
11
  private options;
@@ -36,7 +36,9 @@ class SetUpBuildCredentials {
36
36
  log_1.default.newLine();
37
37
  }
38
38
  const action = new SetUpTargetBuildCredentials_1.SetUpTargetBuildCredentials({
39
- ...this.options,
39
+ enterpriseProvisioning: this.options.enterpriseProvisioning,
40
+ distribution: this.options.distribution,
41
+ entitlements: target.entitlements,
40
42
  app: {
41
43
  ...this.options.app,
42
44
  bundleIdentifier: target.bundleIdentifier,
@@ -1,13 +1,13 @@
1
1
  import { DistributionType, IosEnterpriseProvisioning } from '@expo/eas-json';
2
+ import { JSONObject } from '@expo/json-file';
2
3
  import { IosAppBuildCredentialsFragment } from '../../../graphql/generated';
3
4
  import { CredentialsContext } from '../../context';
4
5
  import { AppLookupParams as GraphQLAppLookupParams } from '../api/GraphqlClient';
5
- import { IosCapabilitiesOptions } from '../appstore/ensureAppExists';
6
6
  interface Options {
7
7
  app: GraphQLAppLookupParams;
8
8
  distribution: DistributionType;
9
9
  enterpriseProvisioning?: IosEnterpriseProvisioning;
10
- iosCapabilitiesOptions?: IosCapabilitiesOptions;
10
+ entitlements: JSONObject;
11
11
  }
12
12
  export declare class SetUpTargetBuildCredentials {
13
13
  private options;
@@ -12,14 +12,14 @@ class SetUpTargetBuildCredentials {
12
12
  this.options = options;
13
13
  }
14
14
  async runAsync(ctx) {
15
- const { app, iosCapabilitiesOptions } = this.options;
15
+ const { app, entitlements } = this.options;
16
16
  await ctx.bestEffortAppStoreAuthenticateAsync();
17
17
  if (ctx.appStore.authCtx) {
18
18
  await ctx.appStore.ensureBundleIdExistsAsync({
19
19
  accountName: app.account.name,
20
20
  bundleIdentifier: app.bundleIdentifier,
21
21
  projectName: app.projectName,
22
- }, iosCapabilitiesOptions);
22
+ }, { entitlements });
23
23
  }
24
24
  try {
25
25
  return await this.setupBuildCredentialsAsync(ctx);
@@ -1,3 +1,4 @@
1
+ import { JSONObject } from '@expo/json-file';
1
2
  import { CommonIosAppCredentialsFragment, IosAppBuildCredentialsFragment } from '../../graphql/generated';
2
3
  import { Account } from '../../user/Account';
3
4
  export interface App {
@@ -9,6 +10,7 @@ export interface Target {
9
10
  buildConfiguration?: string;
10
11
  bundleIdentifier: string;
11
12
  parentBundleIdentifier?: string;
13
+ entitlements: JSONObject;
12
14
  }
13
15
  export interface TargetCredentials {
14
16
  distributionCertificate: {
@@ -2,4 +2,4 @@ import { AppLookupParams } from '../api/GraphqlClient';
2
2
  import { App, IosAppBuildCredentialsMap, IosAppCredentialsMap, Target } from '../types';
3
3
  export declare function displayEmptyIosCredentials(appLookupParams: AppLookupParams): void;
4
4
  export declare function displayIosCredentials(app: App, appCredentialsMap: IosAppCredentialsMap, targets: Target[]): void;
5
- export declare function displayProjectCredentials(app: App, appBuildCredentials: IosAppBuildCredentialsMap, targets: Target[]): void;
5
+ export declare function displayProjectCredentials(app: App, appBuildCredentials: IosAppBuildCredentialsMap, targets: Omit<Target, 'entitlements'>[]): void;
@@ -31,7 +31,7 @@ function parse(dataBase64) {
31
31
  const profile = buffer.toString('utf8');
32
32
  return plist_1.default.parse(profile);
33
33
  }
34
- catch (error) {
34
+ catch {
35
35
  throw new Error('Provisioning profile is malformed');
36
36
  }
37
37
  }
@@ -53,7 +53,7 @@ function validateProvisioningProfileWithoutApple(app, { provisioningProfile, dis
53
53
  return false;
54
54
  }
55
55
  }
56
- catch (error) {
56
+ catch {
57
57
  log_1.default.warn('Provisioning Profile is malformed.');
58
58
  return false;
59
59
  }
@@ -34,7 +34,6 @@ const SetUpBuildCredentialsFromCredentialsJson_1 = require("../ios/actions/SetUp
34
34
  const SetUpProvisioningProfile_1 = require("../ios/actions/SetUpProvisioningProfile");
35
35
  const SetUpPushKey_1 = require("../ios/actions/SetUpPushKey");
36
36
  const UpdateCredentialsJson_1 = require("../ios/actions/UpdateCredentialsJson");
37
- const entitlements_1 = require("../ios/appstore/entitlements");
38
37
  const printCredentials_1 = require("../ios/utils/printCredentials");
39
38
  const Actions_1 = require("./Actions");
40
39
  const HelperActions_1 = require("./HelperActions");
@@ -158,7 +157,12 @@ class ManageIos {
158
157
  nonInteractive: ctx.nonInteractive,
159
158
  exp: ctx.exp,
160
159
  }, buildProfile);
161
- const targets = await (0, target_1.resolveTargetsAsync)({ exp: ctx.exp, projectDir: ctx.projectDir }, xcodeBuildContext);
160
+ const targets = await (0, target_1.resolveTargetsAsync)({
161
+ exp: ctx.exp,
162
+ projectDir: ctx.projectDir,
163
+ xcodeBuildContext,
164
+ env: buildProfile.env,
165
+ });
162
166
  return {
163
167
  app,
164
168
  targets,
@@ -185,16 +189,13 @@ class ManageIos {
185
189
  }
186
190
  }
187
191
  async runProjectSpecificActionAsync(ctx, app, targets, buildProfile, action) {
188
- var _a, _b;
192
+ var _a;
189
193
  if (action === Actions_1.IosActionType.SetUpBuildCredentials) {
190
194
  await new SetUpBuildCredentials_1.SetUpBuildCredentials({
191
195
  app,
192
196
  targets,
193
197
  distribution: buildProfile.distribution,
194
198
  enterpriseProvisioning: buildProfile.enterpriseProvisioning,
195
- iosCapabilitiesOptions: {
196
- entitlements: await (0, entitlements_1.getManagedEntitlementsJsonAsync)(ctx.projectDir, (_a = buildProfile.env) !== null && _a !== void 0 ? _a : {}),
197
- },
198
199
  }).runAsync(ctx);
199
200
  return;
200
201
  }
@@ -230,7 +231,7 @@ class ManageIos {
230
231
  }
231
232
  case Actions_1.IosActionType.RemoveProvisioningProfile: {
232
233
  const iosAppCredentials = await ctx.ios.getIosAppCredentialsWithCommonFieldsAsync(appLookupParams);
233
- const provisioningProfile = (_b = iosAppCredentials === null || iosAppCredentials === void 0 ? void 0 : iosAppCredentials.iosAppBuildCredentialsList.find(buildCredentials => buildCredentials.iosDistributionType === distributionType)) === null || _b === void 0 ? void 0 : _b.provisioningProfile;
234
+ const provisioningProfile = (_a = iosAppCredentials === null || iosAppCredentials === void 0 ? void 0 : iosAppCredentials.iosAppBuildCredentialsList.find(buildCredentials => buildCredentials.iosDistributionType === distributionType)) === null || _a === void 0 ? void 0 : _a.provisioningProfile;
234
235
  if (!provisioningProfile) {
235
236
  log_1.default.log(`No provisioning profile associated with the ${distributionType} configuration of ${appLookupParams.projectName}`);
236
237
  return;