eas-cli 7.6.2 → 7.8.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 (52) hide show
  1. package/README.md +99 -73
  2. package/build/build/android/graphql.js +3 -0
  3. package/build/build/android/prepareJob.d.ts +2 -2
  4. package/build/build/android/prepareJob.js +2 -1
  5. package/build/build/build.d.ts +4 -4
  6. package/build/build/build.js +33 -3
  7. package/build/build/context.d.ts +2 -0
  8. package/build/build/createContext.d.ts +3 -1
  9. package/build/build/createContext.js +2 -1
  10. package/build/build/graphql.d.ts +3 -1
  11. package/build/build/graphql.js +11 -1
  12. package/build/build/ios/graphql.js +3 -0
  13. package/build/build/ios/prepareJob.d.ts +2 -2
  14. package/build/build/ios/prepareJob.js +2 -1
  15. package/build/build/local.js +1 -1
  16. package/build/build/runBuildAndSubmit.d.ts +2 -0
  17. package/build/build/runBuildAndSubmit.js +20 -0
  18. package/build/build/utils/repository.d.ts +4 -2
  19. package/build/build/utils/repository.js +37 -1
  20. package/build/commands/build/index.d.ts +2 -0
  21. package/build/commands/build/index.js +6 -0
  22. package/build/commands/credentials/configure-build.d.ts +18 -0
  23. package/build/commands/credentials/configure-build.js +43 -0
  24. package/build/commands/credentials/index.d.ts +16 -0
  25. package/build/commands/{credentials.js → credentials/index.js} +2 -2
  26. package/build/commands/submit.d.ts +1 -0
  27. package/build/commands/submit.js +7 -1
  28. package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +1 -0
  29. package/build/credentials/manager/Actions.d.ts +2 -1
  30. package/build/credentials/manager/Actions.js +1 -0
  31. package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.d.ts +10 -0
  32. package/build/credentials/manager/CheckBuildProfileFlagAgainstEasJson.js +35 -0
  33. package/build/credentials/manager/ManageAndroid.d.ts +9 -5
  34. package/build/credentials/manager/ManageAndroid.js +4 -0
  35. package/build/credentials/manager/ManageIos.d.ts +17 -8
  36. package/build/credentials/manager/SetUpAndroidBuildCredentials.d.ts +7 -0
  37. package/build/credentials/manager/SetUpAndroidBuildCredentials.js +48 -0
  38. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.d.ts +19 -0
  39. package/build/credentials/manager/SetUpBuildCredentialsCommandAction.js +25 -0
  40. package/build/credentials/manager/SetUpIosBuildCredentials.d.ts +7 -0
  41. package/build/credentials/manager/SetUpIosBuildCredentials.js +58 -0
  42. package/build/devices/utils/formatDevice.js +1 -0
  43. package/build/graphql/generated.d.ts +346 -47
  44. package/build/graphql/generated.js +25 -2
  45. package/build/graphql/types/credentials/AppleDevice.js +1 -0
  46. package/build/submit/android/AndroidSubmitter.js +1 -0
  47. package/build/submit/context.d.ts +2 -0
  48. package/build/submit/ios/IosSubmitter.d.ts +1 -0
  49. package/build/submit/ios/IosSubmitter.js +2 -0
  50. package/oclif.manifest.json +92 -32
  51. package/package.json +7 -6
  52. package/build/commands/credentials.d.ts +0 -16
@@ -1,10 +1,14 @@
1
- import { ActionInfo } from './Actions';
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import { BuildProfile } from '@expo/eas-json';
3
+ import { ActionInfo, AndroidActionType } from './Actions';
2
4
  import { Action } from './HelperActions';
5
+ import { GradleBuildContext } from '../../project/android/gradle';
6
+ import { CredentialsContext } from '../context';
3
7
  export declare class ManageAndroid {
4
- private callingAction;
5
- private projectDir;
8
+ protected callingAction: Action;
9
+ protected projectDir: string;
6
10
  constructor(callingAction: Action, projectDir: string);
7
11
  runAsync(currentActions?: ActionInfo[]): Promise<void>;
8
- private createProjectContextAsync;
9
- private runProjectSpecificActionAsync;
12
+ protected createProjectContextAsync(ctx: CredentialsContext, buildProfile: BuildProfile<Platform.ANDROID>): Promise<GradleBuildContext | undefined>;
13
+ protected runProjectSpecificActionAsync(ctx: CredentialsContext, action: AndroidActionType, gradleContext?: GradleBuildContext): Promise<void>;
10
14
  }
@@ -24,6 +24,7 @@ const DownloadKeystore_1 = require("../android/actions/DownloadKeystore");
24
24
  const RemoveFcm_1 = require("../android/actions/RemoveFcm");
25
25
  const RemoveGoogleServiceAccountKey_1 = require("../android/actions/RemoveGoogleServiceAccountKey");
26
26
  const RemoveKeystore_1 = require("../android/actions/RemoveKeystore");
27
+ const SetUpBuildCredentials_1 = require("../android/actions/SetUpBuildCredentials");
27
28
  const SetUpBuildCredentialsFromCredentialsJson_1 = require("../android/actions/SetUpBuildCredentialsFromCredentialsJson");
28
29
  const SetUpGoogleServiceAccountKeyForFcmV1_1 = require("../android/actions/SetUpGoogleServiceAccountKeyForFcmV1");
29
30
  const SetUpGoogleServiceAccountKeyForSubmissions_1 = require("../android/actions/SetUpGoogleServiceAccountKeyForSubmissions");
@@ -208,6 +209,9 @@ class ManageAndroid {
208
209
  else if (action === Actions_1.AndroidActionType.SetUpBuildCredentialsFromCredentialsJson) {
209
210
  await new SetUpBuildCredentialsFromCredentialsJson_1.SetUpBuildCredentialsFromCredentialsJson(appLookupParams).runAsync(ctx);
210
211
  }
212
+ else if (action === Actions_1.AndroidActionType.SetUpBuildCredentials) {
213
+ await new SetUpBuildCredentials_1.SetUpBuildCredentials({ app: appLookupParams }).runAsync(ctx);
214
+ }
211
215
  }
212
216
  }
213
217
  exports.ManageAndroid = ManageAndroid;
@@ -1,13 +1,22 @@
1
- import { ActionInfo } from './Actions';
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import { BuildProfile } from '@expo/eas-json';
3
+ import { ActionInfo, IosActionType } from './Actions';
2
4
  import { Action } from './HelperActions';
5
+ import { AccountFragment, AppleDistributionCertificateFragment, IosAppBuildCredentialsFragment, IosDistributionType as IosDistributionTypeGraphql } from '../../graphql/generated';
6
+ import { CredentialsContext } from '../context';
7
+ import { AppLookupParams } from '../ios/api/graphql/types/AppLookupParams';
8
+ import { App, Target } from '../ios/types';
3
9
  export declare class ManageIos {
4
- private callingAction;
5
- private projectDir;
10
+ protected callingAction: Action;
11
+ protected projectDir: string;
6
12
  constructor(callingAction: Action, projectDir: string);
7
13
  runAsync(currentActions?: ActionInfo[]): Promise<void>;
8
- private createProjectContextAsync;
9
- private runAccountSpecificActionAsync;
10
- private runProjectSpecificActionAsync;
11
- private setupProvisioningProfileWithSpecificDistCertAsync;
12
- private selectTargetAsync;
14
+ protected createProjectContextAsync(ctx: CredentialsContext, account: AccountFragment, buildProfile: BuildProfile<Platform.IOS>): Promise<{
15
+ app: App;
16
+ targets: Target[];
17
+ }>;
18
+ protected runAccountSpecificActionAsync(ctx: CredentialsContext, account: AccountFragment, action: IosActionType): Promise<void>;
19
+ protected runProjectSpecificActionAsync(ctx: CredentialsContext, app: App, targets: Target[], buildProfile: BuildProfile<Platform.IOS>, action: IosActionType): Promise<void>;
20
+ protected setupProvisioningProfileWithSpecificDistCertAsync(ctx: CredentialsContext, target: Target, appLookupParams: AppLookupParams, distCert: AppleDistributionCertificateFragment, distributionType: IosDistributionTypeGraphql): Promise<IosAppBuildCredentialsFragment>;
21
+ protected selectTargetAsync(targets: Target[]): Promise<Target>;
13
22
  }
@@ -0,0 +1,7 @@
1
+ import { Action } from './HelperActions';
2
+ import { ManageAndroid } from './ManageAndroid';
3
+ export declare class SetUpAndroidBuildCredentials extends ManageAndroid {
4
+ private setUpBuildCredentialsWithProfileNameFromFlag;
5
+ constructor(callingAction: Action, projectDir: string, setUpBuildCredentialsWithProfileNameFromFlag: string);
6
+ runAsync(): Promise<void>;
7
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetUpAndroidBuildCredentials = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const assert_1 = tslib_1.__importDefault(require("assert"));
7
+ const Actions_1 = require("./Actions");
8
+ const CheckBuildProfileFlagAgainstEasJson_1 = require("./CheckBuildProfileFlagAgainstEasJson");
9
+ const ManageAndroid_1 = require("./ManageAndroid");
10
+ const context_1 = require("../context");
11
+ class SetUpAndroidBuildCredentials extends ManageAndroid_1.ManageAndroid {
12
+ constructor(callingAction, projectDir, setUpBuildCredentialsWithProfileNameFromFlag) {
13
+ super(callingAction, projectDir);
14
+ this.setUpBuildCredentialsWithProfileNameFromFlag = setUpBuildCredentialsWithProfileNameFromFlag;
15
+ }
16
+ async runAsync() {
17
+ const hasProjectContext = !!this.callingAction.projectInfo;
18
+ const buildProfile = hasProjectContext
19
+ ? await new CheckBuildProfileFlagAgainstEasJson_1.CheckBuildProfileFlagAgainstEasJson(this.projectDir, eas_build_job_1.Platform.ANDROID, this.setUpBuildCredentialsWithProfileNameFromFlag).runAsync()
20
+ : null;
21
+ let projectInfo = null;
22
+ if (hasProjectContext) {
23
+ const { exp, projectId } = await this.callingAction.getDynamicPrivateProjectConfigAsync({
24
+ env: buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.env,
25
+ });
26
+ projectInfo = { exp, projectId };
27
+ }
28
+ const ctx = new context_1.CredentialsContext({
29
+ projectDir: process.cwd(),
30
+ projectInfo,
31
+ user: this.callingAction.actor,
32
+ graphqlClient: this.callingAction.graphqlClient,
33
+ analytics: this.callingAction.analytics,
34
+ env: buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.env,
35
+ nonInteractive: false,
36
+ vcsClient: this.callingAction.vcsClient,
37
+ });
38
+ let gradleContext;
39
+ if (ctx.hasProjectContext) {
40
+ (0, assert_1.default)(buildProfile, 'buildProfile must be defined in a project context');
41
+ gradleContext = await this.createProjectContextAsync(ctx, buildProfile);
42
+ }
43
+ if (this.setUpBuildCredentialsWithProfileNameFromFlag) {
44
+ await this.runProjectSpecificActionAsync(ctx, Actions_1.AndroidActionType.SetUpBuildCredentials, gradleContext);
45
+ }
46
+ }
47
+ }
48
+ exports.SetUpAndroidBuildCredentials = SetUpAndroidBuildCredentials;
@@ -0,0 +1,19 @@
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import { Analytics } from '../../analytics/AnalyticsManager';
3
+ import { DynamicConfigContextFn } from '../../commandUtils/context/DynamicProjectConfigContextField';
4
+ import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
5
+ import { Actor } from '../../user/User';
6
+ import { Client } from '../../vcs/vcs';
7
+ import { CredentialsContextProjectInfo } from '../context';
8
+ export declare class SetUpBuildCredentialsCommandAction {
9
+ readonly actor: Actor;
10
+ readonly graphqlClient: ExpoGraphqlClient;
11
+ readonly vcsClient: Client;
12
+ readonly analytics: Analytics;
13
+ readonly projectInfo: CredentialsContextProjectInfo | null;
14
+ readonly getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn;
15
+ private readonly platform;
16
+ private readonly profileName;
17
+ constructor(actor: Actor, graphqlClient: ExpoGraphqlClient, vcsClient: Client, analytics: Analytics, projectInfo: CredentialsContextProjectInfo | null, getDynamicPrivateProjectConfigAsync: DynamicConfigContextFn, platform: Platform, profileName: string);
18
+ runAsync(): Promise<void>;
19
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetUpBuildCredentialsCommandAction = void 0;
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
5
+ const SetUpAndroidBuildCredentials_1 = require("../manager/SetUpAndroidBuildCredentials");
6
+ const SetUpIosBuildCredentials_1 = require("../manager/SetUpIosBuildCredentials");
7
+ class SetUpBuildCredentialsCommandAction {
8
+ constructor(actor, graphqlClient, vcsClient, analytics, projectInfo, getDynamicPrivateProjectConfigAsync, platform, profileName) {
9
+ this.actor = actor;
10
+ this.graphqlClient = graphqlClient;
11
+ this.vcsClient = vcsClient;
12
+ this.analytics = analytics;
13
+ this.projectInfo = projectInfo;
14
+ this.getDynamicPrivateProjectConfigAsync = getDynamicPrivateProjectConfigAsync;
15
+ this.platform = platform;
16
+ this.profileName = profileName;
17
+ }
18
+ async runAsync() {
19
+ if (this.platform === eas_build_job_1.Platform.IOS) {
20
+ return await new SetUpIosBuildCredentials_1.SetUpIosBuildCredentials(this, process.cwd(), this.profileName).runAsync();
21
+ }
22
+ return await new SetUpAndroidBuildCredentials_1.SetUpAndroidBuildCredentials(this, process.cwd(), this.profileName).runAsync();
23
+ }
24
+ }
25
+ exports.SetUpBuildCredentialsCommandAction = SetUpBuildCredentialsCommandAction;
@@ -0,0 +1,7 @@
1
+ import { Action } from './HelperActions';
2
+ import { ManageIos } from './ManageIos';
3
+ export declare class SetUpIosBuildCredentials extends ManageIos {
4
+ private setUpBuildCredentialsWithProfileNameFromFlag;
5
+ constructor(callingAction: Action, projectDir: string, setUpBuildCredentialsWithProfileNameFromFlag: string);
6
+ runAsync(): Promise<void>;
7
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SetUpIosBuildCredentials = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const assert_1 = tslib_1.__importDefault(require("assert"));
7
+ const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
8
+ const Actions_1 = require("./Actions");
9
+ const CheckBuildProfileFlagAgainstEasJson_1 = require("./CheckBuildProfileFlagAgainstEasJson");
10
+ const ManageIos_1 = require("./ManageIos");
11
+ const projectUtils_1 = require("../../project/projectUtils");
12
+ const actions_1 = require("../../user/actions");
13
+ const context_1 = require("../context");
14
+ class SetUpIosBuildCredentials extends ManageIos_1.ManageIos {
15
+ constructor(callingAction, projectDir, setUpBuildCredentialsWithProfileNameFromFlag) {
16
+ super(callingAction, projectDir);
17
+ this.setUpBuildCredentialsWithProfileNameFromFlag = setUpBuildCredentialsWithProfileNameFromFlag;
18
+ }
19
+ async runAsync() {
20
+ const buildProfile = this.callingAction.projectInfo
21
+ ? await new CheckBuildProfileFlagAgainstEasJson_1.CheckBuildProfileFlagAgainstEasJson(this.projectDir, eas_build_job_1.Platform.IOS, this.setUpBuildCredentialsWithProfileNameFromFlag).runAsync()
22
+ : null;
23
+ let projectInfo = null;
24
+ if (this.callingAction.projectInfo) {
25
+ const { exp, projectId } = await this.callingAction.getDynamicPrivateProjectConfigAsync({
26
+ env: buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.env,
27
+ });
28
+ projectInfo = { exp, projectId };
29
+ }
30
+ const ctx = new context_1.CredentialsContext({
31
+ projectDir: process.cwd(),
32
+ projectInfo,
33
+ user: this.callingAction.actor,
34
+ graphqlClient: this.callingAction.graphqlClient,
35
+ analytics: this.callingAction.analytics,
36
+ env: buildProfile === null || buildProfile === void 0 ? void 0 : buildProfile.env,
37
+ nonInteractive: false,
38
+ vcsClient: this.callingAction.vcsClient,
39
+ });
40
+ await ctx.bestEffortAppStoreAuthenticateAsync();
41
+ const getAccountForProjectAsync = async (projectId) => {
42
+ return await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(ctx.graphqlClient, projectId);
43
+ };
44
+ const account = ctx.hasProjectContext
45
+ ? await getAccountForProjectAsync(ctx.projectId)
46
+ : (0, actions_1.ensureActorHasPrimaryAccount)(ctx.user);
47
+ let app = null;
48
+ let targets = null;
49
+ if (ctx.hasProjectContext) {
50
+ (0, assert_1.default)(buildProfile, 'buildProfile must be defined in project context');
51
+ const projectContext = await this.createProjectContextAsync(ctx, account, buildProfile);
52
+ app = projectContext.app;
53
+ targets = projectContext.targets;
54
+ }
55
+ await this.runProjectSpecificActionAsync(ctx, (0, nullthrows_1.default)(app, 'app must be defined in project context'), (0, nullthrows_1.default)(targets, 'targets must be defined in project context'), (0, nullthrows_1.default)(buildProfile, 'buildProfile must be defined in project context'), Actions_1.IosActionType.SetUpBuildCredentials);
56
+ }
57
+ }
58
+ exports.SetUpIosBuildCredentials = SetUpIosBuildCredentials;
@@ -8,6 +8,7 @@ const DEVICE_CLASS_DISPLAY_NAMES = {
8
8
  [generated_1.AppleDeviceClass.Iphone]: 'iPhone',
9
9
  [generated_1.AppleDeviceClass.Ipad]: 'iPad',
10
10
  [generated_1.AppleDeviceClass.Mac]: 'Mac',
11
+ [generated_1.AppleDeviceClass.Unknown]: 'Unknown',
11
12
  };
12
13
  function formatDeviceClass(device) {
13
14
  if (!device.deviceClass || !DEVICE_CLASS_DISPLAY_NAMES[device.deviceClass]) {