eas-cli 0.36.1 → 0.38.2

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 +37 -37
  2. package/build/build/android/build.d.ts +2 -1
  3. package/build/build/android/build.js +11 -9
  4. package/build/build/android/configure.d.ts +3 -2
  5. package/build/build/build.d.ts +0 -2
  6. package/build/build/build.js +1 -2
  7. package/build/build/configure.js +1 -2
  8. package/build/build/context.d.ts +18 -10
  9. package/build/build/context.js +0 -96
  10. package/build/build/createContext.d.ts +13 -0
  11. package/build/build/createContext.js +114 -0
  12. package/build/build/ios/UpdatesModule.js +3 -2
  13. package/build/build/ios/build.d.ts +2 -1
  14. package/build/build/ios/build.js +24 -19
  15. package/build/build/ios/configure.d.ts +3 -2
  16. package/build/build/ios/version.d.ts +1 -1
  17. package/build/build/ios/version.js +11 -4
  18. package/build/build/local.js +15 -4
  19. package/build/build/metadata.d.ts +1 -12
  20. package/build/build/metadata.js +24 -19
  21. package/build/build/utils/devClient.d.ts +1 -2
  22. package/build/build/utils/repository.js +1 -0
  23. package/build/build/validate.d.ts +3 -3
  24. package/build/commandUtils/EasCommand.js +0 -2
  25. package/build/commands/branch/publish.js +38 -2
  26. package/build/commands/build/configure.js +2 -0
  27. package/build/commands/build/index.js +26 -24
  28. package/build/commands/channel/create.d.ts +6 -0
  29. package/build/commands/channel/create.js +2 -0
  30. package/build/commands/config.js +1 -1
  31. package/build/commands/secret/create.js +0 -6
  32. package/build/commands/secret/delete.js +0 -6
  33. package/build/commands/secret/list.js +0 -6
  34. package/build/commands/submit.js +2 -11
  35. package/build/commands/webhook/create.js +1 -2
  36. package/build/commands/webhook/list.js +1 -1
  37. package/build/commands/webhook/update.js +1 -2
  38. package/build/credentials/ios/appstore/bundleIdCapabilities.js +11 -1
  39. package/build/credentials/ios/appstore/entitlements.js +9 -12
  40. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +1 -1
  41. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +3 -2
  42. package/build/graphql/generated.d.ts +2 -1
  43. package/build/graphql/generated.js +1 -0
  44. package/build/project/android/applicationId.d.ts +6 -0
  45. package/build/project/android/applicationId.js +39 -29
  46. package/build/project/android/gradle.js +3 -2
  47. package/build/project/android/gradleUtils.d.ts +1 -0
  48. package/build/project/ios/bundleIdentifier.d.ts +6 -1
  49. package/build/project/ios/bundleIdentifier.js +29 -18
  50. package/build/project/ios/scheme.d.ts +3 -2
  51. package/build/submit/android/AndroidSubmitCommand.d.ts +1 -2
  52. package/build/submit/android/AndroidSubmitCommand.js +23 -35
  53. package/build/submit/android/AndroidSubmitter.d.ts +0 -2
  54. package/build/submit/android/AndroidSubmitter.js +1 -3
  55. package/build/submit/android/ServiceAccountSource.d.ts +3 -2
  56. package/build/submit/android/ServiceAccountSource.js +16 -4
  57. package/build/submit/context.d.ts +2 -0
  58. package/build/submit/context.js +2 -1
  59. package/build/submit/ios/CredentialsServiceSource.d.ts +6 -3
  60. package/build/submit/ios/CredentialsServiceSource.js +13 -2
  61. package/build/submit/ios/IosSubmitCommand.d.ts +2 -1
  62. package/build/submit/ios/IosSubmitCommand.js +47 -17
  63. package/build/submit/ios/IosSubmitter.js +1 -1
  64. package/build/{build/ios → utils}/plist.d.ts +1 -1
  65. package/build/{build/ios → utils}/plist.js +8 -2
  66. package/build/utils/profiles.d.ts +9 -5
  67. package/build/utils/profiles.js +29 -9
  68. package/build/vcs/clients/git.d.ts +2 -1
  69. package/build/vcs/clients/git.js +87 -6
  70. package/build/vcs/vcs.d.ts +4 -3
  71. package/build/vcs/vcs.js +3 -3
  72. package/build/webhooks/input.d.ts +2 -2
  73. package/build/webhooks/input.js +19 -2
  74. package/oclif.manifest.json +1 -1
  75. package/package.json +13 -14
  76. package/build/project/isEasEnabledForProject.d.ts +0 -8
  77. package/build/project/isEasEnabledForProject.js +0 -33
  78. package/build/submit/android/AndroidPackageSource.d.ts +0 -17
  79. package/build/submit/android/AndroidPackageSource.js +0 -27
@@ -13,7 +13,7 @@ const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
13
13
  const build_1 = require("../../build/android/build");
14
14
  const build_2 = require("../../build/build");
15
15
  const configure_1 = require("../../build/configure");
16
- const context_1 = require("../../build/context");
16
+ const createContext_1 = require("../../build/createContext");
17
17
  const build_3 = require("../../build/ios/build");
18
18
  const devClient_1 = require("../../build/utils/devClient");
19
19
  const printBuildInfo_1 = require("../../build/utils/printBuildInfo");
@@ -23,11 +23,10 @@ const generated_1 = require("../../graphql/generated");
23
23
  const AppPlatform_1 = require("../../graphql/types/AppPlatform");
24
24
  const log_1 = (0, tslib_1.__importStar)(require("../../log"));
25
25
  const platform_1 = require("../../platform");
26
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
27
26
  const metroConfig_1 = require("../../project/metroConfig");
28
27
  const projectUtils_1 = require("../../project/projectUtils");
29
28
  const prompts_1 = require("../../prompts");
30
- const context_2 = require("../../submit/context");
29
+ const context_1 = require("../../submit/context");
31
30
  const submit_1 = require("../../submit/submit");
32
31
  const urls_1 = require("../../submit/utils/urls");
33
32
  const easCli_1 = require("../../utils/easCli");
@@ -54,13 +53,11 @@ class Build extends EasCommand_1.default {
54
53
  await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
55
54
  await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, requestedPlatform);
56
55
  const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
57
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
58
56
  const buildProfiles = await (0, profiles_1.getProfilesAsync)({
57
+ type: 'build',
58
+ projectDir,
59
59
  platforms,
60
- profileName: flags.profile,
61
- async readProfileAsync(platform, profileName) {
62
- return await easJsonReader.readBuildProfileAsync(platform, profileName);
63
- },
60
+ profileName: (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined,
64
61
  });
65
62
  await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
66
63
  projectDir,
@@ -89,14 +86,22 @@ class Build extends EasCommand_1.default {
89
86
  log_1.default.newLine();
90
87
  const submissions = [];
91
88
  if (flags.autoSubmit) {
89
+ const submitProfiles = await (0, profiles_1.getProfilesAsync)({
90
+ projectDir,
91
+ platforms,
92
+ profileName: flags.submitProfile,
93
+ type: 'submit',
94
+ });
92
95
  for (const startedBuild of startedBuilds) {
96
+ const submitProfile = (0, nullthrows_1.default)(submitProfiles.find(({ platform }) => (0, AppPlatform_1.toAppPlatform)(platform) === startedBuild.build.platform)).profile;
93
97
  const submission = await this.prepareAndStartSubmissionAsync({
94
98
  build: startedBuild.build,
95
- credentialsCtx: (0, nullthrows_1.default)((_a = buildCtxByPlatform[startedBuild.build.platform]) === null || _a === void 0 ? void 0 : _a.credentialsCtx),
96
- flags,
99
+ buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
97
100
  moreBuilds: startedBuilds.length > 1,
98
101
  projectDir,
99
- buildProfile: startedBuild.buildProfile,
102
+ buildProfile: startedBuild.buildProfile.profile,
103
+ submitProfile,
104
+ nonInteractive: flags.nonInteractive,
100
105
  });
101
106
  submissions.push(submission);
102
107
  }
@@ -148,7 +153,7 @@ class Build extends EasCommand_1.default {
148
153
  return {
149
154
  requestedPlatform,
150
155
  skipProjectConfiguration: flags['skip-project-configuration'],
151
- profile: profile !== null && profile !== void 0 ? profile : null,
156
+ profile,
152
157
  nonInteractive,
153
158
  local: flags['local'],
154
159
  wait: flags['wait'],
@@ -159,7 +164,7 @@ class Build extends EasCommand_1.default {
159
164
  };
160
165
  }
161
166
  async prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, }) {
162
- const buildCtx = await (0, context_1.createBuildContextAsync)({
167
+ const buildCtx = await (0, createContext_1.createBuildContextAsync)({
163
168
  buildProfileName: buildProfile.profileName,
164
169
  clearCache: flags.clearCache,
165
170
  buildProfile: buildProfile.profile,
@@ -178,9 +183,6 @@ class Build extends EasCommand_1.default {
178
183
  await (0, metroConfig_1.validateMetroConfigForManagedWorkflowAsync)(buildCtx);
179
184
  this.metroConfigValidated = true;
180
185
  }
181
- if (!buildCtx.local && !(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(buildCtx.projectId))) {
182
- (0, errors_1.error)(isEasEnabledForProject_1.EAS_UNAVAILABLE_MESSAGE, { exit: 1 });
183
- }
184
186
  const build = await this.startBuildAsync(buildCtx);
185
187
  return {
186
188
  build,
@@ -197,19 +199,19 @@ class Build extends EasCommand_1.default {
197
199
  }
198
200
  return await sendBuildRequestAsync();
199
201
  }
200
- async prepareAndStartSubmissionAsync({ build, credentialsCtx, flags, moreBuilds, projectDir, buildProfile, }) {
201
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
202
+ async prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, nonInteractive, }) {
203
+ var _a, _b, _c;
202
204
  const platform = (0, AppPlatform_1.toPlatform)(build.platform);
203
- const submitProfile = await easJsonReader.readSubmitProfileAsync(platform, flags.submitProfile);
204
- const submissionCtx = await (0, context_2.createSubmissionContextAsync)({
205
+ const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
205
206
  platform,
206
207
  projectDir,
207
208
  projectId: build.project.id,
208
209
  profile: submitProfile,
209
210
  archiveFlags: { id: build.id },
210
- nonInteractive: flags.nonInteractive,
211
- env: buildProfile.profile.env,
212
- credentialsCtx,
211
+ nonInteractive,
212
+ env: buildProfile.env,
213
+ credentialsCtx: buildCtx.credentialsCtx,
214
+ applicationIdentifier: (_b = (_a = buildCtx.android) === null || _a === void 0 ? void 0 : _a.applicationId) !== null && _b !== void 0 ? _b : (_c = buildCtx.ios) === null || _c === void 0 ? void 0 : _c.bundleIdentifier,
213
215
  });
214
216
  if (moreBuilds) {
215
217
  log_1.default.newLine();
@@ -281,7 +283,7 @@ async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
281
283
  return;
282
284
  }
283
285
  const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
284
- const rawEasJson = await easJsonReader.readRawAsync();
286
+ const rawEasJson = await easJsonReader.readAsync();
285
287
  if (rawEasJson === null || rawEasJson === void 0 ? void 0 : rawEasJson.cli) {
286
288
  return;
287
289
  }
@@ -1,4 +1,10 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
+ import { CreateUpdateChannelOnAppMutation } from '../../graphql/generated';
3
+ export declare function createUpdateChannelOnAppAsync({ appId, channelName, branchId, }: {
4
+ appId: string;
5
+ channelName: string;
6
+ branchId: string;
7
+ }): Promise<CreateUpdateChannelOnAppMutation>;
2
8
  export default class ChannelCreate extends EasCommand {
3
9
  static hidden: boolean;
4
10
  static description: string;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createUpdateChannelOnAppAsync = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const config_1 = require("@expo/config");
5
6
  const command_1 = require("@oclif/command");
@@ -36,6 +37,7 @@ async function createUpdateChannelOnAppAsync({ appId, channelName, branchId, })
36
37
  })
37
38
  .toPromise());
38
39
  }
40
+ exports.createUpdateChannelOnAppAsync = createUpdateChannelOnAppAsync;
39
41
  class ChannelCreate extends EasCommand_1.default {
40
42
  async runAsync() {
41
43
  let { args: { name: channelName }, flags: { json: jsonFlag }, } = this.parse(ChannelCreate);
@@ -36,7 +36,7 @@ class Config extends EasCommand_1.default {
36
36
  value: eas_build_job_1.Platform.IOS,
37
37
  },
38
38
  ]));
39
- const profile = await reader.readBuildProfileAsync(platform, profileName);
39
+ const profile = await reader.getBuildProfileAsync(platform, profileName);
40
40
  const config = (0, expoConfig_1.getExpoConfig)(projectDir, { env: profile.env, isPublicConfig: true });
41
41
  log_1.default.log((0, config_1.getProjectConfigDescription)(projectDir));
42
42
  log_1.default.newLine();
@@ -8,7 +8,6 @@ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/Ea
8
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
9
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
12
11
  const projectUtils_1 = require("../../project/projectUtils");
13
12
  const prompts_1 = require("../../prompts");
14
13
  const Account_1 = require("../../user/Account");
@@ -23,11 +22,6 @@ class EnvironmentSecretCreate extends EasCommand_1.default {
23
22
  const accountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
24
23
  const { slug } = exp;
25
24
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
26
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
27
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
28
- process.exitCode = 1;
29
- return;
30
- }
31
25
  if (!scope) {
32
26
  const validationMessage = 'Secret scope may not be empty.';
33
27
  ({ scope } = await (0, prompts_1.promptAsync)({
@@ -8,7 +8,6 @@ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/Ea
8
8
  const EnvironmentSecretMutation_1 = require("../../graphql/mutations/EnvironmentSecretMutation");
9
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
12
11
  const projectUtils_1 = require("../../project/projectUtils");
13
12
  const prompts_1 = require("../../prompts");
14
13
  class EnvironmentSecretDelete extends EasCommand_1.default {
@@ -17,11 +16,6 @@ class EnvironmentSecretDelete extends EasCommand_1.default {
17
16
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
18
17
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
19
18
  const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
20
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
21
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
22
- process.exitCode = 1;
23
- return;
24
- }
25
19
  let { flags: { id }, } = this.parse(EnvironmentSecretDelete);
26
20
  let secret;
27
21
  if (!id) {
@@ -8,7 +8,6 @@ const dateformat_1 = (0, tslib_1.__importDefault)(require("dateformat"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
9
9
  const EnvironmentSecretsQuery_1 = require("../../graphql/queries/EnvironmentSecretsQuery");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
- const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
12
11
  const projectUtils_1 = require("../../project/projectUtils");
13
12
  class EnvironmentSecretList extends EasCommand_1.default {
14
13
  async runAsync() {
@@ -16,11 +15,6 @@ class EnvironmentSecretList extends EasCommand_1.default {
16
15
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
17
16
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
18
17
  const projectAccountName = await (0, projectUtils_1.getProjectAccountNameAsync)(exp);
19
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
20
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
21
- process.exitCode = 1;
22
- return;
23
- }
24
18
  if (!projectDir) {
25
19
  throw new Error("Please run this command inside your project's directory");
26
20
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const eas_json_1 = require("@expo/eas-json");
6
5
  const command_1 = require("@oclif/command");
7
6
  const errors_1 = require("@oclif/errors");
8
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
@@ -10,7 +9,6 @@ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCo
10
9
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
11
10
  const log_1 = (0, tslib_1.__importStar)(require("../log"));
12
11
  const platform_1 = require("../platform");
13
- const isEasEnabledForProject_1 = require("../project/isEasEnabledForProject");
14
12
  const projectUtils_1 = require("../project/projectUtils");
15
13
  const context_1 = require("../submit/context");
16
14
  const submit_1 = require("../submit/submit");
@@ -23,19 +21,12 @@ class Submit extends EasCommand_1.default {
23
21
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
24
22
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
25
23
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
26
- if (!(await (0, isEasEnabledForProject_1.isEasEnabledForProjectAsync)(projectId))) {
27
- (0, isEasEnabledForProject_1.warnEasUnavailable)();
28
- process.exitCode = 1;
29
- return;
30
- }
31
24
  const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
32
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
33
25
  const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
26
+ type: 'submit',
27
+ projectDir,
34
28
  platforms,
35
29
  profileName: flags.profile,
36
- async readProfileAsync(platform, profileName) {
37
- return await easJsonReader.readSubmitProfileAsync(platform, profileName);
38
- },
39
30
  });
40
31
  const submissions = [];
41
32
  for (const submissionProfile of submissionProfiles) {
@@ -32,8 +32,7 @@ WebhookCreate.description = 'Create a webhook on the current project.';
32
32
  WebhookCreate.flags = {
33
33
  event: command_1.flags.enum({
34
34
  description: 'Event type that triggers the webhook',
35
- options: [generated_1.WebhookType.Build],
36
- default: generated_1.WebhookType.Build,
35
+ options: [generated_1.WebhookType.Build, generated_1.WebhookType.Submit],
37
36
  }),
38
37
  url: command_1.flags.string({
39
38
  description: 'Webhook URL',
@@ -43,6 +43,6 @@ WebhookList.description = 'List webhooks on the current project.';
43
43
  WebhookList.flags = {
44
44
  event: command_1.flags.enum({
45
45
  description: 'Event type that triggers the webhook',
46
- options: [generated_1.WebhookType.Build],
46
+ options: [generated_1.WebhookType.Build, generated_1.WebhookType.Submit],
47
47
  }),
48
48
  };
@@ -35,8 +35,7 @@ WebhookUpdate.flags = {
35
35
  }),
36
36
  event: command_1.flags.enum({
37
37
  description: 'Event type that triggers the webhook',
38
- options: [generated_1.WebhookType.Build],
39
- default: generated_1.WebhookType.Build,
38
+ options: [generated_1.WebhookType.Build, generated_1.WebhookType.Submit],
40
39
  }),
41
40
  url: command_1.flags.string({
42
41
  description: 'Webhook URL',
@@ -4,6 +4,7 @@ exports.CapabilityMapping = exports.assertValidOptions = exports.syncCapabilitie
4
4
  const tslib_1 = require("tslib");
5
5
  const apple_utils_1 = require("@expo/apple-utils");
6
6
  const getenv_1 = (0, tslib_1.__importDefault)(require("getenv"));
7
+ const util_1 = require("util");
7
8
  const log_1 = (0, tslib_1.__importDefault)(require("../../../log"));
8
9
  exports.EXPO_NO_CAPABILITY_SYNC = getenv_1.default.boolish('EXPO_NO_CAPABILITY_SYNC', false);
9
10
  const validateBooleanOptions = (options) => {
@@ -56,7 +57,16 @@ async function syncCapabilitiesForEntitlementsAsync(bundleId, entitlements = {})
56
57
  const { enabledCapabilityNames, request, remainingCapabilities } = getCapabilitiesToEnable(currentCapabilities, entitlements);
57
58
  const { disabledCapabilityNames, request: modifiedRequest } = getCapabilitiesToDisable(bundleId, remainingCapabilities, request);
58
59
  if (modifiedRequest.length) {
59
- await bundleId.updateBundleIdCapabilityAsync(modifiedRequest);
60
+ log_1.default.debug(`Patch Request:`, (0, util_1.inspect)(modifiedRequest, { depth: null, colors: true }));
61
+ try {
62
+ await bundleId.updateBundleIdCapabilityAsync(modifiedRequest);
63
+ }
64
+ catch (error) {
65
+ if (error.message.match(/bundle '[\w\d]+' cannot be deleted. Delete all the Apps/)) {
66
+ log_1.default.error('Failed to patch capabilities:', (0, util_1.inspect)(modifiedRequest, { depth: null, colors: true }));
67
+ throw new Error(`Unexpected error occurred while attempting to update capabilities for app "${bundleId.attributes.identifier}".\nCapabilities can be modified manually in the Apple developer console at https://developer.apple.com/account/resources/identifiers/bundleId/edit/${bundleId.id}.\nAuto capability syncing can be disabled with the environment variable \`EXPO_NO_CAPABILITY_SYNC=1\`.\n${error.message}`);
68
+ }
69
+ }
60
70
  }
61
71
  return { enabled: enabledCapabilityNames, disabled: disabledCapabilityNames };
62
72
  }
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveEntitlementsJsonAsync = exports.getManagedEntitlementsJsonAsync = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const config_plugins_1 = require("@expo/config-plugins");
6
5
  const eas_build_job_1 = require("@expo/eas-build-job");
7
- const plist_1 = (0, tslib_1.__importDefault)(require("@expo/plist"));
8
6
  const prebuild_config_1 = require("@expo/prebuild-config");
9
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
+ const plist_1 = require("../../../utils/plist");
10
8
  async function getManagedEntitlementsJsonAsync(projectDir, env) {
11
9
  var _a;
12
10
  const originalProcessEnv = process.env;
@@ -15,7 +13,7 @@ async function getManagedEntitlementsJsonAsync(projectDir, env) {
15
13
  ...process.env,
16
14
  ...env,
17
15
  };
18
- const { exp } = (0, prebuild_config_1.getPrebuildConfig)(projectDir, { platforms: ['ios'] });
16
+ const { exp } = await (0, prebuild_config_1.getPrebuildConfigAsync)(projectDir, { platforms: ['ios'] });
19
17
  const expWithMods = await (0, config_plugins_1.compileModsAsync)(exp, {
20
18
  projectRoot: projectDir,
21
19
  platforms: ['ios'],
@@ -41,13 +39,12 @@ async function resolveEntitlementsJsonAsync(projectDir, workflow, env) {
41
39
  }
42
40
  exports.resolveEntitlementsJsonAsync = resolveEntitlementsJsonAsync;
43
41
  async function getEntitlementsJsonAsync(projectDir) {
44
- try {
45
- const entitlementsPath = config_plugins_1.IOSConfig.Paths.getEntitlementsPath(projectDir);
46
- if (entitlementsPath) {
47
- const entitlementsContents = await fs_extra_1.default.readFile(entitlementsPath, 'utf8');
48
- return plist_1.default.parse(entitlementsContents);
49
- }
42
+ const entitlementsPath = config_plugins_1.IOSConfig.Paths.getEntitlementsPath(projectDir);
43
+ if (entitlementsPath) {
44
+ const plist = await (0, plist_1.readPlistAsync)(entitlementsPath);
45
+ return plist ? plist : null;
46
+ }
47
+ else {
48
+ return null;
50
49
  }
51
- catch { }
52
- return null;
53
50
  }
@@ -12,7 +12,7 @@ class SelectBuildProfileFromEasJson {
12
12
  }
13
13
  async runAsync(ctx) {
14
14
  const profileName = await this.getProfileNameFromEasConfigAsync(ctx);
15
- const easConfig = await this.easJsonReader.readBuildProfileAsync(this.platform, profileName);
15
+ const easConfig = await this.easJsonReader.getBuildProfileAsync(this.platform, profileName);
16
16
  log_1.default.succeed(`Using build profile: ${profileName}`);
17
17
  return easConfig;
18
18
  }
@@ -1,9 +1,10 @@
1
- import { IosBuildProfile } from '@expo/eas-json';
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import { BuildProfile } from '@expo/eas-json';
2
3
  import { IosDistributionType as IosDistributionTypeGraphql } from '../../graphql/generated';
3
4
  import { CredentialsContext } from '../context';
4
5
  export declare class SelectIosDistributionTypeGraphqlFromBuildProfile {
5
6
  private buildProfile;
6
- constructor(buildProfile: IosBuildProfile);
7
+ constructor(buildProfile: BuildProfile<Platform.IOS>);
7
8
  runAsync(ctx: CredentialsContext): Promise<IosDistributionTypeGraphql>;
8
9
  resolveInternalDistributionAsync(ctx: CredentialsContext): Promise<IosDistributionTypeGraphql>;
9
10
  }
@@ -1239,7 +1239,8 @@ export declare type WebhookFilter = {
1239
1239
  event?: Maybe<WebhookType>;
1240
1240
  };
1241
1241
  export declare enum WebhookType {
1242
- Build = "BUILD"
1242
+ Build = "BUILD",
1243
+ Submit = "SUBMIT"
1243
1244
  }
1244
1245
  export declare type Webhook = {
1245
1246
  __typename?: 'Webhook';
@@ -176,6 +176,7 @@ var AndroidKeystoreType;
176
176
  var WebhookType;
177
177
  (function (WebhookType) {
178
178
  WebhookType["Build"] = "BUILD";
179
+ WebhookType["Submit"] = "SUBMIT";
179
180
  })(WebhookType = exports.WebhookType || (exports.WebhookType = {}));
180
181
  var AppsFilter;
181
182
  (function (AppsFilter) {
@@ -1,5 +1,11 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { GradleBuildContext } from './gradle';
3
+ export declare const INVALID_APPLICATION_ID_MESSAGE = "Invalid format of Android applicationId. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.";
3
4
  export declare function ensureApplicationIdIsDefinedForManagedProjectAsync(projectDir: string, exp: ExpoConfig): Promise<string>;
5
+ export declare class AmbiguousApplicationIdError extends Error {
6
+ constructor(message?: string);
7
+ }
8
+ export declare function getApplicationIdFromBareAsync(projectDir: string, gradleContext?: GradleBuildContext): Promise<string>;
4
9
  export declare function getApplicationIdAsync(projectDir: string, exp: ExpoConfig, gradleContext?: GradleBuildContext): Promise<string>;
10
+ export declare function isApplicationIdValid(applicationId: string): boolean;
5
11
  export declare function warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir: string, exp: ExpoConfig): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject = exports.getApplicationIdAsync = exports.ensureApplicationIdIsDefinedForManagedProjectAsync = void 0;
3
+ exports.warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject = exports.isApplicationIdValid = exports.getApplicationIdAsync = exports.getApplicationIdFromBareAsync = exports.AmbiguousApplicationIdError = exports.ensureApplicationIdIsDefinedForManagedProjectAsync = exports.INVALID_APPLICATION_ID_MESSAGE = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
6
  const config_plugins_1 = require("@expo/config-plugins");
@@ -16,7 +16,7 @@ const prompts_1 = require("../../prompts");
16
16
  const actions_1 = require("../../user/actions");
17
17
  const workflow_1 = require("../workflow");
18
18
  const gradleUtils = (0, tslib_1.__importStar)(require("./gradleUtils"));
19
- const INVALID_APPLICATION_ID_MESSAGE = `Invalid format of Android applicationId. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.`;
19
+ exports.INVALID_APPLICATION_ID_MESSAGE = `Invalid format of Android applicationId. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.`;
20
20
  async function ensureApplicationIdIsDefinedForManagedProjectAsync(projectDir, exp) {
21
21
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
22
22
  (0, assert_1.default)(workflow === eas_build_job_1.Workflow.MANAGED, 'This function should be called only for managed projects');
@@ -30,40 +30,49 @@ async function ensureApplicationIdIsDefinedForManagedProjectAsync(projectDir, ex
30
30
  }
31
31
  }
32
32
  exports.ensureApplicationIdIsDefinedForManagedProjectAsync = ensureApplicationIdIsDefinedForManagedProjectAsync;
33
+ class AmbiguousApplicationIdError extends Error {
34
+ constructor(message) {
35
+ super(message !== null && message !== void 0 ? message : 'Could not resolve applicationId.');
36
+ }
37
+ }
38
+ exports.AmbiguousApplicationIdError = AmbiguousApplicationIdError;
39
+ async function getApplicationIdFromBareAsync(projectDir, gradleContext) {
40
+ const errorMessage = 'Could not read applicationId from Android project.';
41
+ if (gradleContext) {
42
+ const buildGradle = await gradleUtils.getAppBuildGradleAsync(projectDir);
43
+ const applicationIdSuffix = gradleUtils.resolveConfigValue(buildGradle, 'applicationIdSuffix', gradleContext.flavor);
44
+ if (applicationIdSuffix) {
45
+ throw new Error('"applicationIdSuffix" in app/build.gradle is not supported.');
46
+ }
47
+ const applicationId = gradleUtils.resolveConfigValue(buildGradle, 'applicationId', gradleContext.flavor);
48
+ return (0, nullthrows_1.default)(applicationId, errorMessage);
49
+ }
50
+ else {
51
+ // should return value only if productFlavors are not used
52
+ const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
53
+ const buildGradle = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
54
+ const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/);
55
+ if (buildGradle.match(/applicationIdSuffix/)) {
56
+ throw new Error('"applicationIdSuffix" in app/build.gradle is not supported.');
57
+ }
58
+ if (buildGradle.match(/productFlavors/)) {
59
+ throw new AmbiguousApplicationIdError('Failed to autodetect applicationId in multi-flavor project.');
60
+ }
61
+ return (0, nullthrows_1.default)(matchResult === null || matchResult === void 0 ? void 0 : matchResult[1], errorMessage);
62
+ }
63
+ }
64
+ exports.getApplicationIdFromBareAsync = getApplicationIdFromBareAsync;
33
65
  async function getApplicationIdAsync(projectDir, exp, gradleContext) {
34
66
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
35
67
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
36
68
  warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir, exp);
37
- const errorMessage = 'Could not read application id from Android project.';
38
- if (gradleContext) {
39
- const buildGradle = await gradleUtils.getAppBuildGradleAsync(projectDir);
40
- const applicationId = gradleUtils.resolveConfigValue(buildGradle, 'applicationId', gradleContext.flavor);
41
- return (0, nullthrows_1.default)(applicationId, errorMessage);
42
- }
43
- else {
44
- // fallback to best effort approach, this logic can be dropped when we start supporting
45
- // modules different than 'app' and 'flavorDimensions'
46
- let buildGradlePath = null;
47
- try {
48
- buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
49
- }
50
- catch { }
51
- if (!buildGradlePath || !(await fs_extra_1.default.pathExists(buildGradlePath))) {
52
- throw new Error(errorMessage);
53
- }
54
- const buildGradle = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
55
- const matchResult = buildGradle.match(/applicationId ['"](.*)['"]/);
56
- const applicationId = (0, nullthrows_1.default)(matchResult === null || matchResult === void 0 ? void 0 : matchResult[1], errorMessage);
57
- log_1.default.warn(`Unable to detect applicationId`);
58
- log_1.default.warn(`Falling back to best effort approach, using applicationId ${applicationId}`);
59
- return applicationId;
60
- }
69
+ return getApplicationIdFromBareAsync(projectDir, gradleContext);
61
70
  }
62
71
  else {
63
72
  const applicationId = config_plugins_1.AndroidConfig.Package.getPackage(exp);
64
73
  if (!applicationId || !isApplicationIdValid(applicationId)) {
65
74
  if (applicationId) {
66
- log_1.default.warn(INVALID_APPLICATION_ID_MESSAGE);
75
+ log_1.default.warn(exports.INVALID_APPLICATION_ID_MESSAGE);
67
76
  }
68
77
  throw new Error(`Specify "android.package" in ${(0, projectUtils_1.getProjectConfigDescription)(projectDir)} and run this command again.`);
69
78
  }
@@ -78,7 +87,7 @@ async function configureApplicationIdAsync(projectDir, exp) {
78
87
  const paths = (0, config_1.getConfigFilePaths)(projectDir);
79
88
  // we can't automatically update app.config.js
80
89
  if (paths.dynamicConfigPath) {
81
- throw new Error(`"android.package" is not defined in your app.config.js and we can't update this file programatically. Add the value on your own and run this command again.`);
90
+ throw new Error(`"android.package" is not defined in your app.config.js and we can't update this file programmatically. Add the value on your own and run this command again.`);
82
91
  }
83
92
  (0, assert_1.default)(paths.staticConfigPath, 'app.json must exist');
84
93
  log_1.default.addNewLineIfNone();
@@ -89,7 +98,7 @@ async function configureApplicationIdAsync(projectDir, exp) {
89
98
  type: 'text',
90
99
  message: `What would you like your Android application id to be?`,
91
100
  initial: suggestedAndroidApplicationId,
92
- validate: value => (isApplicationIdValid(value) ? true : INVALID_APPLICATION_ID_MESSAGE),
101
+ validate: value => (isApplicationIdValid(value) ? true : exports.INVALID_APPLICATION_ID_MESSAGE),
93
102
  });
94
103
  const rawStaticConfig = (0, appJson_1.readAppJson)(paths.staticConfigPath);
95
104
  rawStaticConfig.expo = {
@@ -103,6 +112,7 @@ async function configureApplicationIdAsync(projectDir, exp) {
103
112
  function isApplicationIdValid(applicationId) {
104
113
  return /^[a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*)+$/.test(applicationId);
105
114
  }
115
+ exports.isApplicationIdValid = isApplicationIdValid;
106
116
  let warnPrinted = false;
107
117
  function warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject(projectDir, exp) {
108
118
  if (config_plugins_1.AndroidConfig.Package.getPackage(exp) && !warnPrinted) {
@@ -18,7 +18,7 @@ async function resolveGradleBuildContextAsync(projectDir, buildProfile) {
18
18
  : undefined;
19
19
  if ((parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.moduleName) &&
20
20
  parsedGradleCommand.moduleName !== gradleUtils.DEFAULT_MODULE_NAME) {
21
- log_1.default.warn(`Building modules different than "${gradleUtils.DEFAULT_MODULE_NAME}" might result in unexpected behavior`);
21
+ log_1.default.warn(`Building modules different than "${gradleUtils.DEFAULT_MODULE_NAME}" might result in unexpected behavior.`);
22
22
  }
23
23
  return {
24
24
  moduleName: (_a = parsedGradleCommand === null || parsedGradleCommand === void 0 ? void 0 : parsedGradleCommand.moduleName) !== null && _a !== void 0 ? _a : gradleUtils.DEFAULT_MODULE_NAME,
@@ -30,7 +30,8 @@ async function resolveGradleBuildContextAsync(projectDir, buildProfile) {
30
30
  }
31
31
  }
32
32
  catch (err) {
33
- log_1.default.warn(`Unable to read project config from app/build.gradle: ${err.message}`);
33
+ log_1.default.warn(`Unable to read gradle project config: ${err.message}.`);
34
+ log_1.default.warn('Values from app/build.gradle might be resolved incorrectly.');
34
35
  return undefined;
35
36
  }
36
37
  }
@@ -5,6 +5,7 @@ interface GradleCommand {
5
5
  }
6
6
  interface Config {
7
7
  applicationId?: string;
8
+ applicationIdSuffix?: string;
8
9
  versionCode?: string;
9
10
  versionName?: string;
10
11
  }
@@ -1,8 +1,13 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
+ export declare const INVALID_BUNDLE_IDENTIFIER_MESSAGE = "Invalid format of iOS bundle identifier. Only alphanumeric characters, '.' and '-' are allowed, and each '.' must be followed by a letter.";
2
3
  export declare function ensureBundleIdentifierIsDefinedForManagedProjectAsync(projectDir: string, exp: ExpoConfig): Promise<string>;
3
- export declare function getBundleIdentifierAsync(projectDir: string, exp: ExpoConfig, { targetName, buildConfiguration }?: {
4
+ export declare class AmbiguousBundleIdentifierError extends Error {
5
+ constructor(message?: string);
6
+ }
7
+ export declare function getBundleIdentifierAsync(projectDir: string, exp: ExpoConfig, xcodeContext?: {
4
8
  targetName?: string;
5
9
  buildConfiguration?: string;
6
10
  }): Promise<string>;
11
+ export declare function isBundleIdentifierValid(bundleIdentifier: string): boolean;
7
12
  export declare function warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject(projectDir: string, exp: ExpoConfig): void;
8
13
  export declare function isWildcardBundleIdentifier(bundleIdentifier: string): boolean;