eas-cli 5.4.0 → 5.6.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 (138) hide show
  1. package/README.md +103 -55
  2. package/build/branch/utils.d.ts +2 -1
  3. package/build/branch/utils.js +2 -4
  4. package/build/build/android/build.js +5 -3
  5. package/build/build/android/prepareJob.js +1 -2
  6. package/build/build/android/syncProjectConfiguration.d.ts +3 -1
  7. package/build/build/android/syncProjectConfiguration.js +2 -2
  8. package/build/build/android/version.d.ts +4 -2
  9. package/build/build/android/version.js +4 -4
  10. package/build/build/build.d.ts +1 -3
  11. package/build/build/build.js +7 -58
  12. package/build/build/configure.d.ts +2 -0
  13. package/build/build/configure.js +9 -10
  14. package/build/build/context.d.ts +4 -0
  15. package/build/build/createContext.d.ts +3 -1
  16. package/build/build/createContext.js +7 -2
  17. package/build/build/ios/build.js +4 -0
  18. package/build/build/ios/prepareJob.js +1 -2
  19. package/build/build/ios/syncProjectConfiguration.d.ts +3 -1
  20. package/build/build/ios/syncProjectConfiguration.js +3 -3
  21. package/build/build/ios/version.d.ts +6 -4
  22. package/build/build/ios/version.js +10 -10
  23. package/build/build/metadata.js +7 -8
  24. package/build/build/runBuildAndSubmit.d.ts +2 -1
  25. package/build/build/runBuildAndSubmit.js +12 -8
  26. package/build/build/utils/devClient.d.ts +3 -1
  27. package/build/build/utils/devClient.js +6 -7
  28. package/build/build/utils/repository.d.ts +6 -5
  29. package/build/build/utils/repository.js +14 -15
  30. package/build/build/utils/resourceClass.js +3 -12
  31. package/build/build/validate.js +2 -3
  32. package/build/commandUtils/EasCommand.d.ts +4 -0
  33. package/build/commandUtils/EasCommand.js +4 -0
  34. package/build/commandUtils/context/VcsClientContextField.d.ts +5 -0
  35. package/build/commandUtils/context/VcsClientContextField.js +11 -0
  36. package/build/commands/branch/create.d.ts +1 -0
  37. package/build/commands/branch/create.js +3 -2
  38. package/build/commands/build/cancel.d.ts +1 -0
  39. package/build/commands/build/cancel.js +1 -0
  40. package/build/commands/build/configure.d.ts +1 -0
  41. package/build/commands/build/configure.js +8 -6
  42. package/build/commands/build/index.d.ts +1 -0
  43. package/build/commands/build/index.js +3 -2
  44. package/build/commands/build/inspect.d.ts +1 -0
  45. package/build/commands/build/inspect.js +5 -6
  46. package/build/commands/build/internal.d.ts +1 -0
  47. package/build/commands/build/internal.js +3 -2
  48. package/build/commands/build/list.d.ts +1 -0
  49. package/build/commands/build/list.js +1 -0
  50. package/build/commands/build/resign.d.ts +1 -0
  51. package/build/commands/build/resign.js +5 -3
  52. package/build/commands/build/run.d.ts +1 -0
  53. package/build/commands/build/run.js +1 -0
  54. package/build/commands/build/version/get.d.ts +1 -0
  55. package/build/commands/build/version/get.js +3 -1
  56. package/build/commands/build/version/set.d.ts +1 -0
  57. package/build/commands/build/version/set.js +3 -1
  58. package/build/commands/build/version/sync.d.ts +1 -0
  59. package/build/commands/build/version/sync.js +9 -4
  60. package/build/commands/build/view.d.ts +1 -0
  61. package/build/commands/build/view.js +1 -0
  62. package/build/commands/credentials.d.ts +1 -0
  63. package/build/commands/credentials.js +3 -2
  64. package/build/commands/diagnostics.d.ts +1 -0
  65. package/build/commands/diagnostics.js +6 -5
  66. package/build/commands/metadata/pull.d.ts +1 -0
  67. package/build/commands/metadata/pull.js +4 -2
  68. package/build/commands/metadata/push.d.ts +1 -0
  69. package/build/commands/metadata/push.js +4 -2
  70. package/build/commands/project/init.d.ts +1 -0
  71. package/build/commands/project/init.js +43 -11
  72. package/build/commands/submit.d.ts +1 -0
  73. package/build/commands/submit.js +4 -1
  74. package/build/commands/update/configure.d.ts +1 -0
  75. package/build/commands/update/configure.js +4 -3
  76. package/build/commands/update/index.d.ts +1 -0
  77. package/build/commands/update/index.js +17 -11
  78. package/build/commands/update/roll-back-to-embedded.d.ts +1 -1
  79. package/build/commands/update/roll-back-to-embedded.js +8 -6
  80. package/build/commands/update/rollback.d.ts +0 -1
  81. package/build/commands/update/rollback.js +0 -1
  82. package/build/credentials/android/actions/BuildCredentialsUtils.js +1 -1
  83. package/build/credentials/android/api/GraphqlClient.js +0 -1
  84. package/build/credentials/context.d.ts +3 -0
  85. package/build/credentials/context.js +1 -0
  86. package/build/credentials/credentialsJson/update.js +6 -8
  87. package/build/credentials/ios/actions/DeviceUtils.js +1 -1
  88. package/build/credentials/manager/HelperActions.d.ts +2 -0
  89. package/build/credentials/manager/ManageAndroid.js +2 -1
  90. package/build/credentials/manager/ManageIos.js +3 -0
  91. package/build/credentials/manager/SelectPlatform.d.ts +3 -1
  92. package/build/credentials/manager/SelectPlatform.js +2 -1
  93. package/build/graphql/generated.d.ts +474 -5
  94. package/build/graphql/generated.js +10 -3
  95. package/build/graphql/types/Account.js +4 -0
  96. package/build/graphql/types/Build.js +1 -0
  97. package/build/graphql/types/credentials/AppleDevice.js +1 -0
  98. package/build/metadata/auth.js +4 -4
  99. package/build/project/android/applicationId.d.ts +4 -2
  100. package/build/project/android/applicationId.js +5 -5
  101. package/build/project/android/gradle.d.ts +2 -1
  102. package/build/project/android/gradle.js +2 -2
  103. package/build/project/applicationIdentifier.d.ts +3 -1
  104. package/build/project/applicationIdentifier.js +10 -7
  105. package/build/project/ios/bundleIdentifier.d.ts +4 -2
  106. package/build/project/ios/bundleIdentifier.js +5 -5
  107. package/build/project/ios/entitlements.d.ts +2 -1
  108. package/build/project/ios/entitlements.js +2 -2
  109. package/build/project/ios/scheme.d.ts +3 -1
  110. package/build/project/ios/scheme.js +2 -2
  111. package/build/project/ios/target.d.ts +4 -2
  112. package/build/project/ios/target.js +10 -8
  113. package/build/project/projectUtils.d.ts +1 -0
  114. package/build/project/projectUtils.js +12 -1
  115. package/build/project/publish.d.ts +6 -4
  116. package/build/project/publish.js +10 -11
  117. package/build/project/workflow.d.ts +4 -3
  118. package/build/project/workflow.js +5 -8
  119. package/build/submit/android/AndroidSubmitCommand.js +25 -7
  120. package/build/submit/android/AndroidSubmitter.d.ts +1 -1
  121. package/build/submit/android/AndroidSubmitter.js +2 -9
  122. package/build/submit/commons.d.ts +1 -0
  123. package/build/submit/commons.js +20 -1
  124. package/build/submit/context.d.ts +5 -0
  125. package/build/submit/context.js +2 -1
  126. package/build/submit/ios/AppProduce.js +1 -1
  127. package/build/submit/ios/AscApiKeySource.js +1 -1
  128. package/build/submit/ios/IosSubmitCommand.js +23 -6
  129. package/build/submit/ios/IosSubmitter.d.ts +1 -1
  130. package/build/submit/ios/IosSubmitter.js +2 -9
  131. package/build/update/configure.d.ts +3 -1
  132. package/build/update/configure.js +5 -5
  133. package/build/update/ios/UpdatesModule.d.ts +2 -1
  134. package/build/update/ios/UpdatesModule.js +4 -5
  135. package/build/uploads.d.ts +1 -1
  136. package/build/uploads.js +2 -1
  137. package/oclif.manifest.json +1 -1
  138. package/package.json +6 -6
@@ -1,4 +1,5 @@
1
1
  import { Platform, Workflow } from '@expo/eas-build-job';
2
- export declare function resolveWorkflowAsync(projectDir: string, platform: Platform): Promise<Workflow>;
3
- export declare function resolveWorkflowPerPlatformAsync(projectDir: string): Promise<Record<Platform, Workflow>>;
4
- export declare function hasIgnoredIosProjectAsync(projectDir: string): Promise<boolean>;
2
+ import { Client } from '../vcs/vcs';
3
+ export declare function resolveWorkflowAsync(projectDir: string, platform: Platform, vcsClient: Client): Promise<Workflow>;
4
+ export declare function resolveWorkflowPerPlatformAsync(projectDir: string, vcsClient: Client): Promise<Record<Platform, Workflow>>;
5
+ export declare function hasIgnoredIosProjectAsync(projectDir: string, vcsClient: Client): Promise<boolean>;
@@ -6,8 +6,7 @@ const config_plugins_1 = require("@expo/config-plugins");
6
6
  const eas_build_job_1 = require("@expo/eas-build-job");
7
7
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
- const vcs_1 = require("../vcs");
10
- async function resolveWorkflowAsync(projectDir, platform) {
9
+ async function resolveWorkflowAsync(projectDir, platform, vcsClient) {
11
10
  let platformWorkflowMarkers;
12
11
  try {
13
12
  platformWorkflowMarkers =
@@ -21,7 +20,6 @@ async function resolveWorkflowAsync(projectDir, platform) {
21
20
  catch {
22
21
  return eas_build_job_1.Workflow.MANAGED;
23
22
  }
24
- const vcsClient = (0, vcs_1.getVcsClient)();
25
23
  const vcsRootPath = path_1.default.normalize(await vcsClient.getRootPathAsync());
26
24
  for (const marker of platformWorkflowMarkers) {
27
25
  if ((await fs_extra_1.default.pathExists(marker)) &&
@@ -32,16 +30,15 @@ async function resolveWorkflowAsync(projectDir, platform) {
32
30
  return eas_build_job_1.Workflow.MANAGED;
33
31
  }
34
32
  exports.resolveWorkflowAsync = resolveWorkflowAsync;
35
- async function resolveWorkflowPerPlatformAsync(projectDir) {
33
+ async function resolveWorkflowPerPlatformAsync(projectDir, vcsClient) {
36
34
  const [android, ios] = await Promise.all([
37
- resolveWorkflowAsync(projectDir, eas_build_job_1.Platform.ANDROID),
38
- resolveWorkflowAsync(projectDir, eas_build_job_1.Platform.IOS),
35
+ resolveWorkflowAsync(projectDir, eas_build_job_1.Platform.ANDROID, vcsClient),
36
+ resolveWorkflowAsync(projectDir, eas_build_job_1.Platform.IOS, vcsClient),
39
37
  ]);
40
38
  return { android, ios };
41
39
  }
42
40
  exports.resolveWorkflowPerPlatformAsync = resolveWorkflowPerPlatformAsync;
43
- async function hasIgnoredIosProjectAsync(projectDir) {
44
- const vcsClient = (0, vcs_1.getVcsClient)();
41
+ async function hasIgnoredIosProjectAsync(projectDir, vcsClient) {
45
42
  const vcsRootPath = path_1.default.normalize(await vcsClient.getRootPathAsync());
46
43
  try {
47
44
  const pbxProjectPath = config_plugins_1.IOSConfig.Paths.getPBXProjectPath(projectDir);
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const eas_json_1 = require("@expo/eas-json");
5
6
  const results_1 = require("@expo/results");
6
7
  const generated_1 = require("../../graphql/generated");
7
8
  const log_1 = tslib_1.__importDefault(require("../../log"));
8
9
  const applicationId_1 = require("../../project/android/applicationId");
9
10
  const capitalize_1 = tslib_1.__importDefault(require("../../utils/expodash/capitalize"));
11
+ const ArchiveSource_1 = require("../ArchiveSource");
10
12
  const commons_1 = require("../commons");
11
13
  const AndroidSubmitter_1 = tslib_1.__importDefault(require("./AndroidSubmitter"));
12
14
  const ServiceAccountSource_1 = require("./ServiceAccountSource");
@@ -15,18 +17,34 @@ class AndroidSubmitCommand {
15
17
  this.ctx = ctx;
16
18
  }
17
19
  async runAsync() {
20
+ var _a;
18
21
  log_1.default.addNewLineIfNone();
19
- const submissionOptions = await this.getAndroidSubmissionOptionsAsync();
20
- const submitter = new AndroidSubmitter_1.default(this.ctx, submissionOptions);
22
+ const archiveSource = this.resolveArchiveSource();
23
+ if (!archiveSource.ok) {
24
+ log_1.default.error((_a = archiveSource.reason) === null || _a === void 0 ? void 0 : _a.message);
25
+ throw new Error('Submission failed');
26
+ }
27
+ const archiveSourceValue = archiveSource.enforceValue();
28
+ const archive = await (0, ArchiveSource_1.getArchiveAsync)({
29
+ graphqlClient: this.ctx.graphqlClient,
30
+ platform: eas_build_job_1.Platform.ANDROID,
31
+ projectId: this.ctx.projectId,
32
+ nonInteractive: this.ctx.nonInteractive,
33
+ }, archiveSourceValue);
34
+ const archiveProfile = archive.sourceType === ArchiveSource_1.ArchiveSourceType.build ? archive.build.buildProfile : undefined;
35
+ if (archiveProfile && !this.ctx.specifiedProfile) {
36
+ this.ctx = await (0, commons_1.refreshContextSubmitProfileAsync)(this.ctx, archiveProfile);
37
+ }
38
+ const submissionOptions = await this.getAndroidSubmissionOptionsAsync(archiveSourceValue);
39
+ const submitter = new AndroidSubmitter_1.default(this.ctx, submissionOptions, archive);
21
40
  return await submitter.submitAsync();
22
41
  }
23
- async getAndroidSubmissionOptionsAsync() {
42
+ async getAndroidSubmissionOptionsAsync(archiveSource) {
24
43
  const track = this.resolveTrack();
25
44
  const releaseStatus = this.resolveReleaseStatus();
26
- const archiveSource = this.resolveArchiveSource();
27
45
  const rollout = this.resolveRollout();
28
46
  const serviceAccountSource = await this.resolveServiceAccountSourceAsync();
29
- const errored = [track, releaseStatus, archiveSource, serviceAccountSource, rollout].filter(r => !r.ok);
47
+ const errored = [track, releaseStatus, serviceAccountSource, rollout].filter(r => !r.ok);
30
48
  if (errored.length > 0) {
31
49
  const message = errored.map(err => { var _a; return (_a = err.reason) === null || _a === void 0 ? void 0 : _a.message; }).join('\n');
32
50
  log_1.default.error(message);
@@ -37,14 +55,14 @@ class AndroidSubmitCommand {
37
55
  track: track.enforceValue(),
38
56
  releaseStatus: releaseStatus.enforceValue(),
39
57
  rollout: rollout.enforceValue(),
40
- archiveSource: archiveSource.enforceValue(),
58
+ archiveSource,
41
59
  serviceAccountSource: serviceAccountSource.enforceValue(),
42
60
  changesNotSentForReview: this.ctx.profile.changesNotSentForReview,
43
61
  };
44
62
  }
45
63
  async maybeGetAndroidPackageFromCurrentProjectAsync() {
46
64
  try {
47
- return (0, results_1.result)(await (0, applicationId_1.getApplicationIdAsync)(this.ctx.projectDir, this.ctx.exp));
65
+ return (0, results_1.result)(await (0, applicationId_1.getApplicationIdAsync)(this.ctx.projectDir, this.ctx.exp, this.ctx.vcsClient));
48
66
  }
49
67
  catch (error) {
50
68
  if (error instanceof applicationId_1.AmbiguousApplicationIdError) {
@@ -14,7 +14,7 @@ interface ResolvedSourceOptions {
14
14
  serviceAccountKeyResult: ServiceAccountKeyResult;
15
15
  }
16
16
  export default class AndroidSubmitter extends BaseSubmitter<Platform.ANDROID, ResolvedSourceOptions, AndroidSubmissionOptions> {
17
- constructor(ctx: SubmissionContext<Platform.ANDROID>, options: AndroidSubmissionOptions);
17
+ constructor(ctx: SubmissionContext<Platform.ANDROID>, options: AndroidSubmissionOptions, archive: ResolvedArchiveSource);
18
18
  createSubmissionInputAsync(resolvedSourceOptions: ResolvedSourceOptions): Promise<SubmissionInput<Platform.ANDROID>>;
19
19
  protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }: SubmissionInput<Platform.ANDROID>): Promise<SubmissionFragment>;
20
20
  private formatSubmissionConfig;
@@ -1,25 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const eas_build_job_1 = require("@expo/eas-build-job");
5
4
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
5
  const AnalyticsManager_1 = require("../../analytics/AnalyticsManager");
7
6
  const SubmissionMutation_1 = require("../../graphql/mutations/SubmissionMutation");
8
7
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
9
- const ArchiveSource_1 = require("../ArchiveSource");
10
8
  const BaseSubmitter_1 = tslib_1.__importDefault(require("../BaseSubmitter"));
11
9
  const summary_1 = require("../utils/summary");
12
10
  const ServiceAccountSource_1 = require("./ServiceAccountSource");
13
11
  class AndroidSubmitter extends BaseSubmitter_1.default {
14
- constructor(ctx, options) {
12
+ constructor(ctx, options, archive) {
15
13
  const sourceOptionsResolver = {
16
14
  // eslint-disable-next-line async-protect/async-suffix
17
- archive: async () => await (0, ArchiveSource_1.getArchiveAsync)({
18
- graphqlClient: ctx.graphqlClient,
19
- platform: eas_build_job_1.Platform.ANDROID,
20
- projectId: ctx.projectId,
21
- nonInteractive: ctx.nonInteractive,
22
- }, this.options.archiveSource),
15
+ archive: async () => archive,
23
16
  // eslint-disable-next-line async-protect/async-suffix
24
17
  serviceAccountKeyResult: async () => {
25
18
  return await (0, ServiceAccountSource_1.getServiceAccountKeyResultAsync)(this.ctx, this.options.serviceAccountSource);
@@ -2,3 +2,4 @@ import { Platform } from '@expo/eas-build-job';
2
2
  import { ArchiveSource } from './ArchiveSource';
3
3
  import { SubmissionContext } from './context';
4
4
  export declare function resolveArchiveSource<T extends Platform>(ctx: SubmissionContext<T>): ArchiveSource;
5
+ export declare function refreshContextSubmitProfileAsync<T extends Platform>(ctx: SubmissionContext<T>, archiveProfile: string): Promise<SubmissionContext<T>>;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveArchiveSource = void 0;
3
+ exports.refreshContextSubmitProfileAsync = exports.resolveArchiveSource = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_json_1 = require("@expo/eas-json");
6
+ const errors_1 = require("@expo/eas-json/build/errors");
7
+ const log_1 = tslib_1.__importDefault(require("../log"));
4
8
  const ArchiveSource_1 = require("./ArchiveSource");
5
9
  function resolveArchiveSource(ctx) {
6
10
  const { url, path, id, latest } = ctx.archiveFlags;
@@ -44,3 +48,18 @@ function resolveArchiveSource(ctx) {
44
48
  }
45
49
  }
46
50
  exports.resolveArchiveSource = resolveArchiveSource;
51
+ async function refreshContextSubmitProfileAsync(ctx, archiveProfile) {
52
+ try {
53
+ ctx.profile = (await eas_json_1.EasJsonUtils.getSubmitProfileAsync(eas_json_1.EasJsonAccessor.fromProjectPath(ctx.projectDir), ctx.platform, archiveProfile ? archiveProfile : 'production'));
54
+ }
55
+ catch (err) {
56
+ if (err instanceof errors_1.MissingProfileError) {
57
+ log_1.default.log(`Selected build uses "${archiveProfile}" build profile but a submit profile with the same name is missing in eas.json. Using default ("production") profile`);
58
+ }
59
+ else {
60
+ throw err;
61
+ }
62
+ }
63
+ return ctx;
64
+ }
65
+ exports.refreshContextSubmitProfileAsync = refreshContextSubmitProfileAsync;
@@ -5,6 +5,7 @@ import { Analytics, AnalyticsEventProperties } from '../analytics/AnalyticsManag
5
5
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
6
6
  import { CredentialsContext } from '../credentials/context';
7
7
  import { Actor } from '../user/User';
8
+ import { Client } from '../vcs/vcs';
8
9
  export interface SubmissionContext<T extends Platform> {
9
10
  accountName: string;
10
11
  archiveFlags: SubmitArchiveFlags;
@@ -20,7 +21,9 @@ export interface SubmissionContext<T extends Platform> {
20
21
  user: Actor;
21
22
  graphqlClient: ExpoGraphqlClient;
22
23
  analytics: Analytics;
24
+ vcsClient: Client;
23
25
  applicationIdentifierOverride?: string;
26
+ specifiedProfile?: string;
24
27
  }
25
28
  export interface SubmitArchiveFlags {
26
29
  latest?: boolean;
@@ -42,4 +45,6 @@ export declare function createSubmissionContextAsync<T extends Platform>(params:
42
45
  analytics: Analytics;
43
46
  exp: ExpoConfig;
44
47
  projectId: string;
48
+ vcsClient: Client;
49
+ specifiedProfile?: string;
45
50
  }): Promise<SubmissionContext<T>>;
@@ -6,7 +6,7 @@ const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
6
6
  const context_1 = require("../credentials/context");
7
7
  const projectUtils_1 = require("../project/projectUtils");
8
8
  async function createSubmissionContextAsync(params) {
9
- const { applicationIdentifier, projectDir, nonInteractive, actor, exp, projectId, graphqlClient, analytics, } = params;
9
+ const { applicationIdentifier, projectDir, nonInteractive, actor, exp, projectId, graphqlClient, analytics, vcsClient, } = params;
10
10
  const { env, ...rest } = params;
11
11
  const projectName = exp.slug;
12
12
  const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
@@ -20,6 +20,7 @@ async function createSubmissionContextAsync(params) {
20
20
  analytics,
21
21
  projectInfo: { exp, projectId },
22
22
  nonInteractive,
23
+ vcsClient,
23
24
  });
24
25
  }
25
26
  const analyticsEventProperties = {
@@ -16,7 +16,7 @@ async function ensureAppStoreConnectAppExistsAsync(ctx) {
16
16
  const { appName, language } = ctx.profile;
17
17
  const options = {
18
18
  ...ctx.profile,
19
- bundleIdentifier: (_b = (_a = ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : ctx.profile.bundleIdentifier) !== null && _b !== void 0 ? _b : (await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, exp)),
19
+ bundleIdentifier: (_b = (_a = ctx.applicationIdentifierOverride) !== null && _a !== void 0 ? _a : ctx.profile.bundleIdentifier) !== null && _b !== void 0 ? _b : (await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, exp, ctx.vcsClient)),
20
20
  appName: (_c = appName !== null && appName !== void 0 ? appName : exp.name) !== null && _c !== void 0 ? _c : (await promptForAppNameAsync()),
21
21
  language: (0, language_1.sanitizeLanguage)(language),
22
22
  };
@@ -27,7 +27,7 @@ async function getAscApiKeyResultAsync(ctx, source) {
27
27
  exports.getAscApiKeyResultAsync = getAscApiKeyResultAsync;
28
28
  async function maybeGetIosBundleIdentifierAsync(ctx) {
29
29
  try {
30
- return await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, ctx.exp);
30
+ return await (0, bundleIdentifier_1.getBundleIdentifierAsync)(ctx.projectDir, ctx.exp, ctx.vcsClient);
31
31
  }
32
32
  catch (error) {
33
33
  if (error instanceof bundleIdentifier_1.AmbiguousBundleIdentifierError) {
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const results_1 = require("@expo/results");
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const getenv_1 = tslib_1.__importDefault(require("getenv"));
7
8
  const wrap_ansi_1 = tslib_1.__importDefault(require("wrap-ansi"));
8
9
  const errors_1 = require("../../credentials/errors");
9
10
  const log_1 = tslib_1.__importStar(require("../../log"));
11
+ const ArchiveSource_1 = require("../ArchiveSource");
10
12
  const commons_1 = require("../commons");
11
13
  const AppProduce_1 = require("./AppProduce");
12
14
  const AppSpecificPasswordSource_1 = require("./AppSpecificPasswordSource");
@@ -17,13 +19,29 @@ class IosSubmitCommand {
17
19
  this.ctx = ctx;
18
20
  }
19
21
  async runAsync() {
22
+ var _a;
20
23
  log_1.default.addNewLineIfNone();
21
- const options = await this.resolveSubmissionOptionsAsync();
22
- const submitter = new IosSubmitter_1.default(this.ctx, options);
24
+ const archiveSource = this.resolveArchiveSource();
25
+ if (!archiveSource.ok) {
26
+ log_1.default.error((_a = archiveSource.reason) === null || _a === void 0 ? void 0 : _a.message);
27
+ throw new Error('Submission failed');
28
+ }
29
+ const archiveSourceValue = archiveSource.enforceValue();
30
+ const archive = await (0, ArchiveSource_1.getArchiveAsync)({
31
+ graphqlClient: this.ctx.graphqlClient,
32
+ platform: eas_build_job_1.Platform.IOS,
33
+ projectId: this.ctx.projectId,
34
+ nonInteractive: this.ctx.nonInteractive,
35
+ }, archiveSourceValue);
36
+ const archiveProfile = archive.sourceType === ArchiveSource_1.ArchiveSourceType.build ? archive.build.buildProfile : undefined;
37
+ if (archiveProfile && !this.ctx.specifiedProfile) {
38
+ this.ctx = await (0, commons_1.refreshContextSubmitProfileAsync)(this.ctx, archiveProfile);
39
+ }
40
+ const options = await this.resolveSubmissionOptionsAsync(archiveSourceValue);
41
+ const submitter = new IosSubmitter_1.default(this.ctx, options, archive);
23
42
  return await submitter.submitAsync();
24
43
  }
25
- async resolveSubmissionOptionsAsync() {
26
- const archiveSource = this.resolveArchiveSource();
44
+ async resolveSubmissionOptionsAsync(archiveSource) {
27
45
  const credentialsSource = await this.resolveCredentialSubmissionOptionsAsync();
28
46
  const maybeAppSpecificPasswordSource = 'appSpecificPasswordSource' in credentialsSource
29
47
  ? credentialsSource.appSpecificPasswordSource
@@ -31,7 +49,6 @@ class IosSubmitCommand {
31
49
  const maybeAscApiKeySource = 'ascApiKeySource' in credentialsSource ? credentialsSource.ascApiKeySource : null;
32
50
  const ascAppIdentifier = await this.resolveAscAppIdentifierAsync();
33
51
  const errored = [
34
- archiveSource,
35
52
  ...(maybeAppSpecificPasswordSource ? [maybeAppSpecificPasswordSource] : []),
36
53
  ...(maybeAscApiKeySource ? [maybeAscApiKeySource] : []),
37
54
  ascAppIdentifier,
@@ -44,7 +61,7 @@ class IosSubmitCommand {
44
61
  return {
45
62
  projectId: this.ctx.projectId,
46
63
  ascAppIdentifier: ascAppIdentifier.enforceValue(),
47
- archiveSource: archiveSource.enforceValue(),
64
+ archiveSource,
48
65
  ...(maybeAppSpecificPasswordSource
49
66
  ? {
50
67
  appSpecificPasswordSource: maybeAppSpecificPasswordSource.enforceValue(),
@@ -19,7 +19,7 @@ interface ResolvedSourceOptions {
19
19
  };
20
20
  }
21
21
  export default class IosSubmitter extends BaseSubmitter<Platform.IOS, ResolvedSourceOptions, IosSubmissionOptions> {
22
- constructor(ctx: SubmissionContext<Platform.IOS>, options: IosSubmissionOptions);
22
+ constructor(ctx: SubmissionContext<Platform.IOS>, options: IosSubmissionOptions, archive: ResolvedArchiveSource);
23
23
  createSubmissionInputAsync(resolvedSourceOptions: ResolvedSourceOptions): Promise<SubmissionInput<Platform.IOS>>;
24
24
  protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }: SubmissionInput<Platform.IOS>): Promise<SubmissionFragment>;
25
25
  private formatSubmissionConfig;
@@ -1,26 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const eas_build_job_1 = require("@expo/eas-build-job");
5
4
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
5
  const AnalyticsManager_1 = require("../../analytics/AnalyticsManager");
7
6
  const SubmissionMutation_1 = require("../../graphql/mutations/SubmissionMutation");
8
7
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
9
- const ArchiveSource_1 = require("../ArchiveSource");
10
8
  const BaseSubmitter_1 = tslib_1.__importDefault(require("../BaseSubmitter"));
11
9
  const summary_1 = require("../utils/summary");
12
10
  const AppSpecificPasswordSource_1 = require("./AppSpecificPasswordSource");
13
11
  const AscApiKeySource_1 = require("./AscApiKeySource");
14
12
  class IosSubmitter extends BaseSubmitter_1.default {
15
- constructor(ctx, options) {
13
+ constructor(ctx, options, archive) {
16
14
  const sourceOptionsResolver = {
17
15
  // eslint-disable-next-line async-protect/async-suffix
18
- archive: async () => await (0, ArchiveSource_1.getArchiveAsync)({
19
- graphqlClient: ctx.graphqlClient,
20
- platform: eas_build_job_1.Platform.IOS,
21
- projectId: ctx.projectId,
22
- nonInteractive: ctx.nonInteractive,
23
- }, this.options.archiveSource),
16
+ archive: async () => archive,
24
17
  // eslint-disable-next-line async-protect/async-suffix
25
18
  credentials: async () => {
26
19
  const maybeAppSpecificPassword = this.options.appSpecificPasswordSource
@@ -2,6 +2,7 @@ import { ExpoConfig } from '@expo/config-types';
2
2
  import { Workflow } from '@expo/eas-build-job';
3
3
  import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
4
4
  import { RequestedPlatform } from '../platform';
5
+ import { Client } from '../vcs/vcs';
5
6
  export declare const DEFAULT_MANAGED_RUNTIME_VERSION_GTE_SDK_49: {
6
7
  readonly policy: "appVersion";
7
8
  };
@@ -24,10 +25,11 @@ export declare function ensureEASUpdateIsConfiguredInEasJsonAsync(projectDir: st
24
25
  * - Sets `updates.url` if not set
25
26
  * - Ensure latest changes are reflected in the native config, if any
26
27
  */
27
- export declare function ensureEASUpdateIsConfiguredAsync(graphqlClient: ExpoGraphqlClient, { exp: expMaybeWithoutUpdates, projectId, projectDir, platform, }: {
28
+ export declare function ensureEASUpdateIsConfiguredAsync(graphqlClient: ExpoGraphqlClient, { exp: expMaybeWithoutUpdates, projectId, projectDir, vcsClient, platform, }: {
28
29
  exp: ExpoConfig;
29
30
  projectId: string;
30
31
  projectDir: string;
32
+ vcsClient: Client;
31
33
  platform: RequestedPlatform | null;
32
34
  }): Promise<void>;
33
35
  export declare function ensureUseClassicUpdatesIsRemovedAsync({ exp: expMaybeWithoutUpdates, projectDir, }: {
@@ -172,13 +172,13 @@ function warnEASUpdatesManualConfig({ modifyConfig, workflows, }) {
172
172
  /**
173
173
  * Make sure that the current `app.json` configuration for EAS Updates is set natively.
174
174
  */
175
- async function ensureEASUpdateIsConfiguredNativelyAsync(graphqlClient, { exp, projectId, projectDir, platform, workflows, }) {
175
+ async function ensureEASUpdateIsConfiguredNativelyAsync(graphqlClient, vcsClient, { exp, projectId, projectDir, platform, workflows, }) {
176
176
  if (['all', 'android'].includes(platform) && workflows.android === eas_build_job_1.Workflow.GENERIC) {
177
177
  await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(graphqlClient, projectDir, exp, projectId);
178
178
  log_1.default.withTick(`Configured ${chalk_1.default.bold('AndroidManifest.xml')} for EAS Update`);
179
179
  }
180
180
  if (['all', 'ios'].includes(platform) && workflows.ios === eas_build_job_1.Workflow.GENERIC) {
181
- await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(graphqlClient, projectDir, exp, projectId);
181
+ await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(graphqlClient, vcsClient, projectDir, exp, projectId);
182
182
  log_1.default.withTick(`Configured ${chalk_1.default.bold('Expo.plist')} for EAS Update`);
183
183
  }
184
184
  }
@@ -237,7 +237,7 @@ exports.ensureEASUpdateIsConfiguredInEasJsonAsync = ensureEASUpdateIsConfiguredI
237
237
  * - Sets `updates.url` if not set
238
238
  * - Ensure latest changes are reflected in the native config, if any
239
239
  */
240
- async function ensureEASUpdateIsConfiguredAsync(graphqlClient, { exp: expMaybeWithoutUpdates, projectId, projectDir, platform, }) {
240
+ async function ensureEASUpdateIsConfiguredAsync(graphqlClient, { exp: expMaybeWithoutUpdates, projectId, projectDir, vcsClient, platform, }) {
241
241
  var _a;
242
242
  // EAS Update and SDK 49's "useClassicUpdates" option are mutually exclusive
243
243
  if ((_a = expMaybeWithoutUpdates.updates) === null || _a === void 0 ? void 0 : _a.useClassicUpdates) {
@@ -260,7 +260,7 @@ async function ensureEASUpdateIsConfiguredAsync(graphqlClient, { exp: expMaybeWi
260
260
  if (!platform) {
261
261
  return;
262
262
  }
263
- const workflows = await (0, workflow_1.resolveWorkflowPerPlatformAsync)(projectDir);
263
+ const workflows = await (0, workflow_1.resolveWorkflowPerPlatformAsync)(projectDir, vcsClient);
264
264
  const { projectChanged, exp: expWithUpdates } = await ensureEASUpdatesIsConfiguredInExpoConfigAsync({
265
265
  exp: expMaybeWithoutUpdates,
266
266
  projectDir,
@@ -269,7 +269,7 @@ async function ensureEASUpdateIsConfiguredAsync(graphqlClient, { exp: expMaybeWi
269
269
  workflows,
270
270
  });
271
271
  if (projectChanged || !hasExpoUpdates) {
272
- await ensureEASUpdateIsConfiguredNativelyAsync(graphqlClient, {
272
+ await ensureEASUpdateIsConfiguredNativelyAsync(graphqlClient, vcsClient, {
273
273
  exp: expWithUpdates,
274
274
  projectDir,
275
275
  projectId,
@@ -1,5 +1,6 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
3
- export declare function syncUpdatesConfigurationAsync(graphqlClient: ExpoGraphqlClient, projectDir: string, exp: ExpoConfig, projectId: string): Promise<void>;
3
+ import { Client } from '../../vcs/vcs';
4
+ export declare function syncUpdatesConfigurationAsync(graphqlClient: ExpoGraphqlClient, vcsClient: Client, projectDir: string, exp: ExpoConfig, projectId: string): Promise<void>;
4
5
  export declare function readReleaseChannelSafelyAsync(projectDir: string): Promise<string | null>;
5
6
  export declare function readChannelSafelyAsync(projectDir: string): Promise<string | null>;
@@ -5,14 +5,13 @@ const config_plugins_1 = require("@expo/config-plugins");
5
5
  const platform_1 = require("../../platform");
6
6
  const projectUtils_1 = require("../../project/projectUtils");
7
7
  const plist_1 = require("../../utils/plist");
8
- const vcs_1 = require("../../vcs");
9
8
  const utils_1 = require("../utils");
10
- async function syncUpdatesConfigurationAsync(graphqlClient, projectDir, exp, projectId) {
9
+ async function syncUpdatesConfigurationAsync(graphqlClient, vcsClient, projectDir, exp, projectId) {
11
10
  (0, utils_1.ensureValidVersions)(exp, platform_1.RequestedPlatform.Ios);
12
11
  const accountName = (await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId)).name;
13
12
  const expoPlist = await readExpoPlistAsync(projectDir);
14
13
  const updatedExpoPlist = config_plugins_1.IOSConfig.Updates.setUpdatesConfig(projectDir, exp, expoPlist, accountName);
15
- await writeExpoPlistAsync(projectDir, updatedExpoPlist);
14
+ await writeExpoPlistAsync(vcsClient, projectDir, updatedExpoPlist);
16
15
  }
17
16
  exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
18
17
  async function readExpoPlistAsync(projectDir) {
@@ -20,10 +19,10 @@ async function readExpoPlistAsync(projectDir) {
20
19
  const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
21
20
  return ((_a = (await (0, plist_1.readPlistAsync)(expoPlistPath))) !== null && _a !== void 0 ? _a : {});
22
21
  }
23
- async function writeExpoPlistAsync(projectDir, expoPlist) {
22
+ async function writeExpoPlistAsync(vcsClient, projectDir, expoPlist) {
24
23
  const expoPlistPath = config_plugins_1.IOSConfig.Paths.getExpoPlistPath(projectDir);
25
24
  await (0, plist_1.writePlistAsync)(expoPlistPath, expoPlist);
26
- await (0, vcs_1.getVcsClient)().trackFileAsync(expoPlistPath);
25
+ await vcsClient.trackFileAsync(expoPlistPath);
27
26
  }
28
27
  async function readReleaseChannelSafelyAsync(projectDir) {
29
28
  var _a;
@@ -7,4 +7,4 @@ export interface PresignedPost {
7
7
  fields: Record<string, string>;
8
8
  }
9
9
  export declare function uploadFileAtPathToGCSAsync(graphqlClient: ExpoGraphqlClient, type: UploadSessionType, path: string, handleProgressEvent: ProgressHandler): Promise<string>;
10
- export declare function uploadWithPresignedPostWithRetryAsync(file: string, presignedPost: PresignedPost): Promise<Response>;
10
+ export declare function uploadWithPresignedPostWithRetryAsync(file: string, presignedPost: PresignedPost, onAssetUploadBegin: () => void): Promise<Response>;
package/build/uploads.js CHANGED
@@ -13,11 +13,12 @@ async function uploadFileAtPathToGCSAsync(graphqlClient, type, path, handleProgr
13
13
  return signedUrl.bucketKey;
14
14
  }
15
15
  exports.uploadFileAtPathToGCSAsync = uploadFileAtPathToGCSAsync;
16
- async function uploadWithPresignedPostWithRetryAsync(file, presignedPost) {
16
+ async function uploadWithPresignedPostWithRetryAsync(file, presignedPost, onAssetUploadBegin) {
17
17
  return await (0, promise_retry_1.default)(async (retry) => {
18
18
  // retry fetch errors (usually connection or DNS errors)
19
19
  let response;
20
20
  try {
21
+ onAssetUploadBegin();
21
22
  response = await uploadWithPresignedPostAsync(file, presignedPost);
22
23
  }
23
24
  catch (e) {