eas-cli 3.7.2 → 3.8.1

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.
@@ -12,11 +12,13 @@ const metadata_1 = require("../metadata");
12
12
  const iosResourceClassToBuildResourceClassMapping = {
13
13
  [eas_json_1.ResourceClass.DEFAULT]: generated_1.BuildResourceClass.IosDefault,
14
14
  [eas_json_1.ResourceClass.LARGE]: generated_1.BuildResourceClass.IosLarge,
15
- [eas_json_1.ResourceClass.M1_EXPERIMENTAL]: generated_1.BuildResourceClass.IosM1Large,
16
- [eas_json_1.ResourceClass.M1_MEDIUM]: generated_1.BuildResourceClass.IosM1Medium,
17
- [eas_json_1.ResourceClass.M1_LARGE]: generated_1.BuildResourceClass.IosM1Large,
15
+ [eas_json_1.ResourceClass.M1_EXPERIMENTAL]: generated_1.BuildResourceClass.IosMMedium,
16
+ [eas_json_1.ResourceClass.M1_MEDIUM]: generated_1.BuildResourceClass.IosMMedium,
17
+ [eas_json_1.ResourceClass.M1_LARGE]: generated_1.BuildResourceClass.IosMLarge,
18
18
  [eas_json_1.ResourceClass.INTEL_MEDIUM]: generated_1.BuildResourceClass.IosIntelMedium,
19
19
  [eas_json_1.ResourceClass.MEDIUM]: generated_1.BuildResourceClass.IosMedium,
20
+ [eas_json_1.ResourceClass.M_MEDIUM]: generated_1.BuildResourceClass.IosMMedium,
21
+ [eas_json_1.ResourceClass.M_LARGE]: generated_1.BuildResourceClass.IosMLarge,
20
22
  };
21
23
  const androidResourceClassToBuildResourceClassMapping = {
22
24
  [eas_json_1.ResourceClass.DEFAULT]: generated_1.BuildResourceClass.AndroidDefault,
@@ -49,8 +51,11 @@ function resolveAndroidResourceClass(selectedResourceClass) {
49
51
  }
50
52
  async function resolveIosResourceClassAsync(exp, projectDir, selectedResourceClass) {
51
53
  const resourceClass = selectedResourceClass !== null && selectedResourceClass !== void 0 ? selectedResourceClass : (await resolveIosDefaultRequestedResourceClassAsync(exp, projectDir));
52
- if (resourceClass === eas_json_1.ResourceClass.M1_EXPERIMENTAL) {
53
- log_1.default.warn(`Resource class ${chalk_1.default.bold('m1-experimental')} is deprecated.`);
54
+ if ([eas_json_1.ResourceClass.M1_EXPERIMENTAL, eas_json_1.ResourceClass.M1_MEDIUM].includes(resourceClass)) {
55
+ log_1.default.warn(`Resource class ${chalk_1.default.bold(resourceClass)} is deprecated. Use ${chalk_1.default.bold('m-medium')} instead.`);
56
+ }
57
+ if (resourceClass === eas_json_1.ResourceClass.M1_LARGE) {
58
+ log_1.default.warn(`Resource class ${chalk_1.default.bold('m1-large')} is deprecated. Use ${chalk_1.default.bold('m-large')} instead.`);
54
59
  }
55
60
  return iosResourceClassToBuildResourceClassMapping[resourceClass];
56
61
  }
@@ -59,7 +64,7 @@ async function resolveIosDefaultRequestedResourceClassAsync(exp, projectDir) {
59
64
  const reactNativeVersion = await (0, metadata_1.getReactNativeVersionAsync)(projectDir);
60
65
  if ((sdkVersion && semver_1.default.satisfies(sdkVersion, '>=48')) ||
61
66
  (reactNativeVersion && semver_1.default.satisfies(reactNativeVersion, '>=0.71.0'))) {
62
- return eas_json_1.ResourceClass.M1_MEDIUM;
67
+ return eas_json_1.ResourceClass.M_MEDIUM;
63
68
  }
64
69
  else {
65
70
  return eas_json_1.ResourceClass.DEFAULT;
@@ -85,6 +85,16 @@ export default abstract class EasCommand extends Command {
85
85
  * it requires the `ProjectConfig` context, and then call `getContextAsync` to get the project ID.
86
86
  */
87
87
  static contextDefinition: ContextInput;
88
+ /**
89
+ * The user session manager. Responsible for coordinating all user session related state.
90
+ * If needed in a subclass, use the SessionManager ContextOption.
91
+ */
92
+ private sessionManagerInternal?;
93
+ /**
94
+ * The analytics manager. Used for logging analytics.
95
+ * It is set up here to ensure a consistent setup.
96
+ */
97
+ private analyticsInternal?;
88
98
  /**
89
99
  * Execute the context in the contextDefinition to satisfy command prerequisites.
90
100
  */
@@ -95,20 +105,11 @@ export default abstract class EasCommand extends Command {
95
105
  }, { nonInteractive }: {
96
106
  nonInteractive: boolean;
97
107
  }): Promise<ContextOutput<C>>;
98
- /**
99
- * The user session manager. Responsible for coordinating all user session related state.
100
- * If needed in a subclass, use the SessionManager ContextOption.
101
- */
102
- private sessionManagerInternal?;
103
108
  private get sessionManager();
104
- /**
105
- * The analytics manager. Used for logging analytics.
106
- * It is set up here to ensure a consistent set up.
107
- */
108
- private analyticsInternal?;
109
109
  private get analytics();
110
110
  protected abstract runAsync(): Promise<any>;
111
111
  run(): Promise<any>;
112
112
  finally(err: Error): Promise<any>;
113
+ protected catch(err: Error): Promise<any>;
113
114
  }
114
115
  export {};
@@ -2,8 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const core_1 = require("@oclif/core");
5
+ const core_2 = require("@urql/core");
5
6
  const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
6
7
  const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
8
+ const log_1 = tslib_1.__importDefault(require("../log"));
7
9
  const SessionManager_1 = tslib_1.__importDefault(require("../user/SessionManager"));
8
10
  const AnalyticsContextField_1 = tslib_1.__importDefault(require("./context/AnalyticsContextField"));
9
11
  const DynamicProjectConfigContextField_1 = require("./context/DynamicProjectConfigContextField");
@@ -13,6 +15,8 @@ const OptionalProjectConfigContextField_1 = require("./context/OptionalProjectCo
13
15
  const ProjectConfigContextField_1 = tslib_1.__importDefault(require("./context/ProjectConfigContextField"));
14
16
  const ProjectDirContextField_1 = tslib_1.__importDefault(require("./context/ProjectDirContextField"));
15
17
  const SessionManagementContextField_1 = tslib_1.__importDefault(require("./context/SessionManagementContextField"));
18
+ const errors_1 = require("./errors");
19
+ const BASE_GRAPHQL_ERROR_MESSAGE = 'GraphQL request failed.';
16
20
  class EasCommand extends core_1.Command {
17
21
  /**
18
22
  * Execute the context in the contextDefinition to satisfy command prerequisites.
@@ -58,6 +62,22 @@ class EasCommand extends core_1.Command {
58
62
  await this.analytics.flushAsync();
59
63
  return super.finally(err);
60
64
  }
65
+ catch(err) {
66
+ let baseMessage = `${this.id} command failed.`;
67
+ if (err instanceof errors_1.EasCommandError) {
68
+ log_1.default.error(err.message);
69
+ }
70
+ else if (err instanceof core_2.CombinedError && (err === null || err === void 0 ? void 0 : err.graphQLErrors)) {
71
+ const cleanMessage = err.message.replace('[GraphQL] ', '');
72
+ log_1.default.error(cleanMessage);
73
+ baseMessage = BASE_GRAPHQL_ERROR_MESSAGE;
74
+ }
75
+ else {
76
+ log_1.default.error(err.message);
77
+ }
78
+ log_1.default.debug(err);
79
+ throw new Error(baseMessage);
80
+ }
61
81
  }
62
82
  exports.default = EasCommand;
63
83
  EasCommand.ContextOptions = {
@@ -0,0 +1,3 @@
1
+ export declare class EasCommandError extends Error {
2
+ constructor(message: string);
3
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EasCommandError = void 0;
4
+ class EasCommandError extends Error {
5
+ // constructor is not useless, since the constructor for Error allows for optional `message`
6
+ // eslint-disable-next-line @typescript-eslint/no-useless-constructor
7
+ constructor(message) {
8
+ super(message);
9
+ }
10
+ }
11
+ exports.EasCommandError = EasCommandError;
@@ -76,7 +76,7 @@ class UpdatePublish extends EasCommand_1.default {
76
76
  projectDir,
77
77
  projectId,
78
78
  });
79
- const { exp } = await getDynamicProjectConfigAsync({});
79
+ const { exp } = await getDynamicProjectConfigAsync({ isPublicConfig: true });
80
80
  const codeSigningInfo = await (0, code_signing_1.getCodeSigningInfoAsync)(expPrivate, privateKeyPath);
81
81
  let realizedPlatforms = [];
82
82
  if (channelName && branchName) {
@@ -112,6 +112,8 @@ export type Account = {
112
112
  offers?: Maybe<Array<Offer>>;
113
113
  /** Owning User of this account if personal account */
114
114
  owner?: Maybe<User>;
115
+ /** Owning UserActor of this account if personal account */
116
+ ownerUserActor?: Maybe<UserActor>;
115
117
  pushSecurityEnabled: Scalars['Boolean'];
116
118
  /** @deprecated Legacy access tokens are deprecated */
117
119
  requiresAccessTokenForPushSecurity: Scalars['Boolean'];
@@ -130,7 +132,10 @@ export type Account = {
130
132
  updatedAt: Scalars['DateTime'];
131
133
  /** Account query object for querying EAS usage metrics */
132
134
  usageMetrics: AccountUsageMetrics;
133
- /** Owning UserActor of this account if personal account */
135
+ /**
136
+ * Owning UserActor of this account if personal account
137
+ * @deprecated Deprecated in favor of ownerUserActor
138
+ */
134
139
  userActorOwner?: Maybe<UserActor>;
135
140
  /** Pending user invitations for this account */
136
141
  userInvitations: Array<UserInvitation>;
@@ -799,6 +804,7 @@ export type App = Project & {
799
804
  /** ios.appStoreUrl field from most recent classic update manifest */
800
805
  appStoreUrl?: Maybe<Scalars['String']>;
801
806
  assetLimitPerUpdateGroup: Scalars['Int'];
807
+ branchesPaginated: AppBranchesConnection;
802
808
  buildJobs: Array<BuildJob>;
803
809
  /**
804
810
  * Coalesced Build (EAS) or BuildJob (Classic) items for this app.
@@ -882,6 +888,7 @@ export type App = Project & {
882
888
  updated: Scalars['DateTime'];
883
889
  /** EAS updates owned by an app */
884
890
  updates: Array<Update>;
891
+ updatesPaginated: AppUpdatesConnection;
885
892
  /** @deprecated Use ownerAccount.name instead */
886
893
  username: Scalars['String'];
887
894
  /** @deprecated No longer supported */
@@ -903,6 +910,13 @@ export type AppAndroidAppCredentialsArgs = {
903
910
  filter?: InputMaybe<AndroidAppCredentialsFilter>;
904
911
  };
905
912
  /** Represents an Exponent App (or Experience in legacy terms) */
913
+ export type AppBranchesPaginatedArgs = {
914
+ after?: InputMaybe<Scalars['String']>;
915
+ before?: InputMaybe<Scalars['String']>;
916
+ first?: InputMaybe<Scalars['Int']>;
917
+ last?: InputMaybe<Scalars['Int']>;
918
+ };
919
+ /** Represents an Exponent App (or Experience in legacy terms) */
906
920
  export type AppBuildJobsArgs = {
907
921
  limit: Scalars['Int'];
908
922
  offset: Scalars['Int'];
@@ -1000,9 +1014,26 @@ export type AppUpdatesArgs = {
1000
1014
  offset: Scalars['Int'];
1001
1015
  };
1002
1016
  /** Represents an Exponent App (or Experience in legacy terms) */
1017
+ export type AppUpdatesPaginatedArgs = {
1018
+ after?: InputMaybe<Scalars['String']>;
1019
+ before?: InputMaybe<Scalars['String']>;
1020
+ first?: InputMaybe<Scalars['Int']>;
1021
+ last?: InputMaybe<Scalars['Int']>;
1022
+ };
1023
+ /** Represents an Exponent App (or Experience in legacy terms) */
1003
1024
  export type AppWebhooksArgs = {
1004
1025
  filter?: InputMaybe<WebhookFilter>;
1005
1026
  };
1027
+ export type AppBranchEdge = {
1028
+ __typename?: 'AppBranchEdge';
1029
+ cursor: Scalars['String'];
1030
+ node: UpdateBranch;
1031
+ };
1032
+ export type AppBranchesConnection = {
1033
+ __typename?: 'AppBranchesConnection';
1034
+ edges: Array<AppBranchEdge>;
1035
+ pageInfo: PageInfo;
1036
+ };
1006
1037
  export type AppDataInput = {
1007
1038
  id: Scalars['ID'];
1008
1039
  privacy?: InputMaybe<Scalars['String']>;
@@ -1159,6 +1190,16 @@ export declare enum AppStoreConnectUserRole {
1159
1190
  Technical = "TECHNICAL",
1160
1191
  Unknown = "UNKNOWN"
1161
1192
  }
1193
+ export type AppUpdateEdge = {
1194
+ __typename?: 'AppUpdateEdge';
1195
+ cursor: Scalars['String'];
1196
+ node: Update;
1197
+ };
1198
+ export type AppUpdatesConnection = {
1199
+ __typename?: 'AppUpdatesConnection';
1200
+ edges: Array<AppUpdateEdge>;
1201
+ pageInfo: PageInfo;
1202
+ };
1162
1203
  /** Represents Play Store/App Store version of an application */
1163
1204
  export type AppVersion = {
1164
1205
  __typename?: 'AppVersion';
@@ -1502,7 +1543,10 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
1502
1543
  __typename?: 'Build';
1503
1544
  activityTimestamp: Scalars['DateTime'];
1504
1545
  actor?: Maybe<Actor>;
1505
- /** The actual resource class of the builder assigned to the build job */
1546
+ /**
1547
+ * The actual resource class of the builder assigned to the build job
1548
+ * @deprecated Use resourceClassDisplayName instead
1549
+ */
1506
1550
  actualResourceClass?: Maybe<BuildResourceClass>;
1507
1551
  appBuildVersion?: Maybe<Scalars['String']>;
1508
1552
  appVersion?: Maybe<Scalars['String']>;
@@ -1545,8 +1589,13 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
1545
1589
  queuePosition?: Maybe<Scalars['Int']>;
1546
1590
  reactNativeVersion?: Maybe<Scalars['String']>;
1547
1591
  releaseChannel?: Maybe<Scalars['String']>;
1548
- /** The builder resource class requested by the developer */
1592
+ /**
1593
+ * The builder resource class requested by the developer
1594
+ * @deprecated Use resourceClassDisplayName instead
1595
+ */
1549
1596
  resourceClass: BuildResourceClass;
1597
+ /** String describing the resource class used to run the build */
1598
+ resourceClassDisplayName: Scalars['String'];
1550
1599
  runFromCI?: Maybe<Scalars['Boolean']>;
1551
1600
  runtimeVersion?: Maybe<Scalars['String']>;
1552
1601
  sdkVersion?: Maybe<Scalars['String']>;
@@ -1845,14 +1894,18 @@ export declare enum BuildResourceClass {
1845
1894
  AndroidLarge = "ANDROID_LARGE",
1846
1895
  AndroidMedium = "ANDROID_MEDIUM",
1847
1896
  IosDefault = "IOS_DEFAULT",
1897
+ /** @deprecated Use IOS_INTEL_MEDIUM instead */
1848
1898
  IosIntelLarge = "IOS_INTEL_LARGE",
1849
1899
  IosIntelMedium = "IOS_INTEL_MEDIUM",
1850
1900
  IosLarge = "IOS_LARGE",
1901
+ /** @deprecated Use IOS_M_MEDIUM instead */
1851
1902
  IosM1Large = "IOS_M1_LARGE",
1852
1903
  IosM1Medium = "IOS_M1_MEDIUM",
1853
1904
  IosM2Medium = "IOS_M2_MEDIUM",
1854
1905
  IosM2ProMedium = "IOS_M2_PRO_MEDIUM",
1855
1906
  IosMedium = "IOS_MEDIUM",
1907
+ IosMLarge = "IOS_M_LARGE",
1908
+ IosMMedium = "IOS_M_MEDIUM",
1856
1909
  Legacy = "LEGACY"
1857
1910
  }
1858
1911
  export declare enum BuildStatus {
@@ -1967,7 +2020,7 @@ export type CreateGitHubRepositoryInput = {
1967
2020
  };
1968
2021
  export type CreateGitHubRepositorySettingsInput = {
1969
2022
  appId: Scalars['ID'];
1970
- /** The base directory is the directory to change to before starting a build. This string should be a properly formatted Unix path starting with '/', './', or the name of the directory relative to the root of the repository. Valid examples include: '/apps/expo-app', './apps/expo-app', and 'apps/expo-app'. This is intended for monorepos or apps that live in a subdirectory of a repository. */
2023
+ /** The base directory is the directory to change to before starting a build. This string should be a properly formatted POSIX path starting with '/', './', or the name of the directory relative to the root of the repository. Valid examples include: '/apps/expo-app', './apps/expo-app', and 'apps/expo-app'. This is intended for monorepos or apps that live in a subdirectory of a repository. */
1971
2024
  baseDirectory: Scalars['String'];
1972
2025
  };
1973
2026
  export type CreateIosSubmissionInput = {
@@ -3849,6 +3902,8 @@ export type User = Actor & UserActor & {
3849
3902
  id: Scalars['ID'];
3850
3903
  industry?: Maybe<Scalars['String']>;
3851
3904
  isExpoAdmin: Scalars['Boolean'];
3905
+ /** @deprecated This field no longer exists */
3906
+ isLegacy: Scalars['Boolean'];
3852
3907
  isSecondFactorAuthenticationEnabled: Scalars['Boolean'];
3853
3908
  lastName?: Maybe<Scalars['String']>;
3854
3909
  location?: Maybe<Scalars['String']>;
@@ -4075,6 +4130,7 @@ export type UserPermission = {
4075
4130
  role?: Maybe<Role>;
4076
4131
  /** @deprecated User type is deprecated */
4077
4132
  user?: Maybe<User>;
4133
+ userActor?: Maybe<UserActor>;
4078
4134
  };
4079
4135
  export type UserQuery = {
4080
4136
  __typename?: 'UserQuery';
@@ -133,14 +133,18 @@ var BuildResourceClass;
133
133
  BuildResourceClass["AndroidLarge"] = "ANDROID_LARGE";
134
134
  BuildResourceClass["AndroidMedium"] = "ANDROID_MEDIUM";
135
135
  BuildResourceClass["IosDefault"] = "IOS_DEFAULT";
136
+ /** @deprecated Use IOS_INTEL_MEDIUM instead */
136
137
  BuildResourceClass["IosIntelLarge"] = "IOS_INTEL_LARGE";
137
138
  BuildResourceClass["IosIntelMedium"] = "IOS_INTEL_MEDIUM";
138
139
  BuildResourceClass["IosLarge"] = "IOS_LARGE";
140
+ /** @deprecated Use IOS_M_MEDIUM instead */
139
141
  BuildResourceClass["IosM1Large"] = "IOS_M1_LARGE";
140
142
  BuildResourceClass["IosM1Medium"] = "IOS_M1_MEDIUM";
141
143
  BuildResourceClass["IosM2Medium"] = "IOS_M2_MEDIUM";
142
144
  BuildResourceClass["IosM2ProMedium"] = "IOS_M2_PRO_MEDIUM";
143
145
  BuildResourceClass["IosMedium"] = "IOS_MEDIUM";
146
+ BuildResourceClass["IosMLarge"] = "IOS_M_LARGE";
147
+ BuildResourceClass["IosMMedium"] = "IOS_M_MEDIUM";
144
148
  BuildResourceClass["Legacy"] = "LEGACY";
145
149
  })(BuildResourceClass = exports.BuildResourceClass || (exports.BuildResourceClass = {}));
146
150
  var BuildStatus;