eas-cli 21.8.0 → 22.2.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.
- package/README.md +209 -186
- package/build/build/android/prepareJob.js +1 -0
- package/build/build/ios/prepareJob.js +1 -0
- package/build/build/metadata.js +0 -1
- package/build/build/runBuildAndSubmit.js +1 -1
- package/build/build/utils/formatBuild.js +2 -2
- package/build/build/utils/url.js +3 -5
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +10 -3
- package/build/commandUtils/new/configs.js +1 -1
- package/build/commands/account/view.js +1 -2
- package/build/commands/build/cancel.js +3 -3
- package/build/commands/build/download.js +1 -1
- package/build/commands/fingerprint/compare.js +100 -48
- package/build/commands/go.d.ts +1 -0
- package/build/commands/go.js +10 -47
- package/build/commands/project/icon/set.js +4 -40
- package/build/commands/project/init.d.ts +1 -0
- package/build/commands/project/init.js +13 -0
- package/build/commands/simulator/availability.js +2 -1
- package/build/commands/simulator/index.d.ts +1 -0
- package/build/commands/simulator/index.js +10 -5
- package/build/commands/simulator/stop.js +1 -0
- package/build/commands/submit.d.ts +1 -0
- package/build/commands/submit.js +8 -1
- package/build/commands/update/index.js +1 -1
- package/build/commands/update/revert-update-rollout.js +1 -1
- package/build/commands/update/rollback.js +1 -1
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +20 -13
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.d.ts +14 -2
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +47 -7
- package/build/credentials/ios/appstore/ensureTestFlightGroup.d.ts +3 -1
- package/build/credentials/ios/appstore/ensureTestFlightGroup.js +14 -11
- package/build/graphql/generated.d.ts +703 -932
- package/build/graphql/generated.js +16 -2
- package/build/graphql/queries/ChannelInsightsQuery.js +4 -1
- package/build/graphql/queries/DeviceRunSessionQuery.js +5 -0
- package/build/graphql/types/Account.js +1 -4
- package/build/graphql/types/Build.js +13 -8
- package/build/graphql/types/Submission.js +0 -1
- package/build/graphql/types/Update.js +4 -1
- package/build/project/accountSelection.js +1 -3
- package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +3 -5
- package/build/project/projectIcon.d.ts +40 -0
- package/build/project/projectIcon.js +132 -0
- package/build/project/projectNotConfiguredError.d.ts +17 -0
- package/build/project/projectNotConfiguredError.js +24 -0
- package/build/simulator/env.d.ts +1 -1
- package/build/simulator/env.js +12 -2
- package/build/simulator/utils.js +26 -0
- package/build/submit/ArchiveSource.js +3 -3
- package/build/submit/context.d.ts +2 -0
- package/build/submit/context.js +1 -0
- package/build/submit/ios/AppProduce.js +1 -1
- package/build/submit/ios/IosSubmitCommand.js +2 -0
- package/build/submit/ios/ensureTestFlightSetup.d.ts +7 -0
- package/build/submit/ios/ensureTestFlightSetup.js +81 -0
- package/build/submit/status.js +1 -1
- package/build/submit/utils/formatSubmission.js +2 -2
- package/build/update/queries.js +1 -1
- package/build/update/republish.js +3 -3
- package/build/update/roll-back-to-embedded.js +1 -1
- package/build/update/utils.d.ts +2 -1
- package/build/update/utils.js +7 -7
- package/build/uploads.d.ts +5 -0
- package/build/uploads.js +22 -0
- package/build/user/User.js +1 -1
- package/oclif.manifest.json +222 -186
- package/package.json +7 -7
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.BuildWorkflow = exports.BuildTrigger = exports.BuildStatus = exports.BuildRetryDisabledReason = exports.BuildResourceClass = exports.BuildPriority = exports.BuildPhase = exports.BuildMode = exports.BuildLimitThresholdExceededMetadataType = exports.BuildIosEnterpriseProvisioning = exports.BuildCredentialsSource = exports.BuildAnnotationType = exports.BackgroundJobState = exports.BackgroundJobResultType = exports.AuthProviderIdentifier = exports.AuthProtocolType = exports.AuditLogsExportFormat = exports.AssetMetadataStatus = exports.AssetMapSourceType = exports.AppleTeamType = exports.AppleDeviceClass = exports.AppUploadSessionType = exports.AppStoreConnectWorkflowConnectionStatus = exports.AppStoreConnectUserRole = exports.AppStoreConnectBuildUploadState = exports.AppStoreConnectBuildProcessingState = exports.AppProfileImageWidth = exports.AppPrivacy = exports.AppPlatform = exports.AppObserveUpdatesOrderByField = exports.AppObserveUpdatesOrderByDirection = exports.AppObservePropertyType = exports.AppObservePlatform = exports.AppObserveNavigationRoutesOrderByField = exports.AppObserveEventsOrderByField = exports.AppObserveEventsOrderByDirection = exports.AppObserveErrorSeverity = exports.AppObserveErrorGroupsOrderBy = exports.AppObserveErrorBreakdownDimension = exports.AppObserveCustomEventNamesOrderByField = exports.AppObserveCustomEventNamesOrderByDirection = exports.AppObserveCustomEventListOrderByField = exports.AppInternalDistributionBuildPrivacy = exports.AndroidKeystoreType = exports.AndroidFcmVersion = exports.AndroidBuildType = exports.ActivityTimelineProjectActivityType = exports.AccountUploadSessionType = exports.AccountMemberType = exports.AccountAppsSortByField = void 0;
|
|
10
10
|
exports.IosManagedBuildType = exports.IosDistributionType = exports.IosBuildType = exports.InvoiceDiscountType = exports.InsightsFilterType = exports.GitHubJobRunTriggerType = exports.GitHubJobRunTriggerRunStatus = exports.GitHubJobRunJobType = exports.GitHubBuildTriggerType = exports.GitHubBuildTriggerRunStatus = exports.GitHubBuildTriggerExecutionBehavior = exports.GitHubAppInstallationStatus = exports.GitHubAppInstallationAccountType = exports.GitHubAppEnvironment = exports.FingerprintSourceType = exports.Feature = exports.Experiment = exports.ExitInterviewOutcome = exports.ExitInterviewMessageRole = exports.EnvironmentVariableVisibility = exports.EnvironmentVariableScope = exports.EnvironmentSecretType = exports.EntityTypeName = exports.EchoVersionSource = exports.EchoTurnCompletionStatus = exports.EchoProjectVisibility = exports.EchoProjectUploadSessionType = exports.EchoProjectIconSource = exports.EchoMessageRole = exports.EchoMessagePartType = exports.EchoChatState = exports.EchoChangeType = exports.EchoBuildStatus = exports.EchoAgentType = exports.EasTotalPlanEnablementUnit = exports.EasServiceMetric = exports.EasService = exports.EasBuildWaiverType = exports.EasBuildDeprecationInfoType = exports.EasBuildBillingResourceClass = exports.DistributionType = exports.DeviceRunSessionType = exports.DeviceRunSessionStatus = exports.DashboardViewPin = exports.DashboardChatMessageStatus = exports.DashboardChatMessageRole = exports.CustomDomainStatus = exports.CustomDomainDnsRecordType = exports.CrashSampleFor = exports.ContinentCode = void 0;
|
|
11
|
-
exports.
|
|
12
|
-
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkflowJobReviewDecision = exports.WorkflowDispatchInputType = exports.WorkflowDeviceTestCaseStatusFilter = exports.WorkflowDeviceTestCaseStatus = exports.WorkflowDeviceTestCaseStatSortField = exports.WorkflowDeviceTestCaseSortDirection = exports.WorkflowDeviceTestCaseInsightsTimeSeriesGranularity = exports.WorkflowArtifactStorageType = void 0;
|
|
11
|
+
exports.WorkerDeploymentCrashKind = exports.WebhookType = exports.UserSpecifiedAccountUsage = exports.UserEntityTypeName = exports.UserAgentPlatform = exports.UserAgentOs = exports.UserAgentBrowser = exports.UsageMetricsGranularity = exports.UsageMetricType = exports.UploadSessionType = exports.UpdatesTimelineItemType = exports.UpdateDiffReceiptStateValue = exports.UpdateDiffReceiptOrderByField = exports.UpdateDiffReceiptOrderByDirection = exports.TurtleSshTransportType = exports.TargetEntityMutationType = exports.SubmissionStatus = exports.SubmissionPriority = exports.SubmissionArchiveSourceType = exports.SubmissionAndroidReleaseStatus = exports.StatuspageServiceStatus = exports.StatuspageServiceName = exports.StatuspageIncidentStatus = exports.StatuspageIncidentImpact = exports.StandardOffer = exports.SecondFactorMethod = exports.Role = exports.ResponseType = exports.ResponseStatusType = exports.ResponseCacheStatus = exports.ResourceClassExperiment = exports.RequestsOrderByField = exports.RequestsOrderByDirection = exports.RequestMethod = exports.RealtimeLogsTargetType = exports.ProjectArchiveSourceType = exports.PostHogRegion = exports.PostHogDeepLinkPurpose = exports.Permission = exports.Order = exports.OnboardingEnvironment = exports.OnboardingDeviceType = exports.OfferType = exports.OAuthProvider = exports.NotificationType = exports.NotificationEvent = exports.LocalBuildArchiveSourceType = exports.JobRunStatus = exports.JobRunPriority = exports.IosSchemeBuildConfiguration = void 0;
|
|
12
|
+
exports.WorkflowsInsightsRunsOverTimeGranularity = exports.WorkflowsInsightsExportFormat = exports.WorkflowRunTriggerEventType = exports.WorkflowRunStatus = exports.WorkflowProjectSourceType = exports.WorkflowJobType = exports.WorkflowJobStatus = exports.WorkflowJobReviewDecision = exports.WorkflowDispatchInputType = exports.WorkflowDeviceTestCaseStatusFilter = exports.WorkflowDeviceTestCaseStatus = exports.WorkflowDeviceTestCaseStatSortField = exports.WorkflowDeviceTestCaseSortDirection = exports.WorkflowDeviceTestCaseInsightsTimeSeriesGranularity = exports.WorkflowArtifactStorageType = exports.WorkerLoggerLevel = exports.WorkerDeploymentLogLevel = void 0;
|
|
13
13
|
var AccountAppsSortByField;
|
|
14
14
|
(function (AccountAppsSortByField) {
|
|
15
15
|
AccountAppsSortByField["LatestActivityTime"] = "LATEST_ACTIVITY_TIME";
|
|
@@ -125,6 +125,9 @@ var AppObservePlatform;
|
|
|
125
125
|
(function (AppObservePlatform) {
|
|
126
126
|
AppObservePlatform["Android"] = "ANDROID";
|
|
127
127
|
AppObservePlatform["Ios"] = "IOS";
|
|
128
|
+
AppObservePlatform["Ipados"] = "IPADOS";
|
|
129
|
+
AppObservePlatform["Macos"] = "MACOS";
|
|
130
|
+
AppObservePlatform["Tvos"] = "TVOS";
|
|
128
131
|
})(AppObservePlatform || (exports.AppObservePlatform = AppObservePlatform = {}));
|
|
129
132
|
var AppObservePropertyType;
|
|
130
133
|
(function (AppObservePropertyType) {
|
|
@@ -341,6 +344,7 @@ var BuildPhase;
|
|
|
341
344
|
BuildPhase["SaveCache"] = "SAVE_CACHE";
|
|
342
345
|
BuildPhase["SetUpBuildEnvironment"] = "SET_UP_BUILD_ENVIRONMENT";
|
|
343
346
|
BuildPhase["SpinUpBuilder"] = "SPIN_UP_BUILDER";
|
|
347
|
+
BuildPhase["SshSession"] = "SSH_SESSION";
|
|
344
348
|
BuildPhase["StartBuild"] = "START_BUILD";
|
|
345
349
|
BuildPhase["Unknown"] = "UNKNOWN";
|
|
346
350
|
BuildPhase["UploadApplicationArchive"] = "UPLOAD_APPLICATION_ARCHIVE";
|
|
@@ -462,6 +466,7 @@ var DeviceRunSessionStatus;
|
|
|
462
466
|
var DeviceRunSessionType;
|
|
463
467
|
(function (DeviceRunSessionType) {
|
|
464
468
|
DeviceRunSessionType["AgentDevice"] = "AGENT_DEVICE";
|
|
469
|
+
DeviceRunSessionType["Appium"] = "APPIUM";
|
|
465
470
|
DeviceRunSessionType["Argent"] = "ARGENT";
|
|
466
471
|
DeviceRunSessionType["ServeSim"] = "SERVE_SIM";
|
|
467
472
|
})(DeviceRunSessionType || (exports.DeviceRunSessionType = DeviceRunSessionType = {}));
|
|
@@ -848,6 +853,11 @@ var ProjectArchiveSourceType;
|
|
|
848
853
|
ProjectArchiveSourceType["None"] = "NONE";
|
|
849
854
|
ProjectArchiveSourceType["Url"] = "URL";
|
|
850
855
|
})(ProjectArchiveSourceType || (exports.ProjectArchiveSourceType = ProjectArchiveSourceType = {}));
|
|
856
|
+
var RealtimeLogsTargetType;
|
|
857
|
+
(function (RealtimeLogsTargetType) {
|
|
858
|
+
RealtimeLogsTargetType["Build"] = "BUILD";
|
|
859
|
+
RealtimeLogsTargetType["JobRun"] = "JOB_RUN";
|
|
860
|
+
})(RealtimeLogsTargetType || (exports.RealtimeLogsTargetType = RealtimeLogsTargetType = {}));
|
|
851
861
|
var RequestMethod;
|
|
852
862
|
(function (RequestMethod) {
|
|
853
863
|
RequestMethod["Delete"] = "DELETE";
|
|
@@ -1003,6 +1013,10 @@ var TargetEntityMutationType;
|
|
|
1003
1013
|
TargetEntityMutationType["Delete"] = "DELETE";
|
|
1004
1014
|
TargetEntityMutationType["Update"] = "UPDATE";
|
|
1005
1015
|
})(TargetEntityMutationType || (exports.TargetEntityMutationType = TargetEntityMutationType = {}));
|
|
1016
|
+
var TurtleSshTransportType;
|
|
1017
|
+
(function (TurtleSshTransportType) {
|
|
1018
|
+
TurtleSshTransportType["UptermV1"] = "UPTERM_V1";
|
|
1019
|
+
})(TurtleSshTransportType || (exports.TurtleSshTransportType = TurtleSshTransportType = {}));
|
|
1006
1020
|
var UpdateDiffReceiptOrderByDirection;
|
|
1007
1021
|
(function (UpdateDiffReceiptOrderByDirection) {
|
|
1008
1022
|
UpdateDiffReceiptOrderByDirection["Asc"] = "ASC";
|
|
@@ -32,26 +32,31 @@ exports.BuildFragmentNode = (0, graphql_tag_1.default) `
|
|
|
32
32
|
displayName
|
|
33
33
|
}
|
|
34
34
|
logFiles
|
|
35
|
-
|
|
35
|
+
app {
|
|
36
36
|
__typename
|
|
37
37
|
id
|
|
38
38
|
name
|
|
39
39
|
slug
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
name
|
|
44
|
-
}
|
|
40
|
+
ownerAccount {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
|
-
|
|
45
|
+
updateChannel {
|
|
46
|
+
id
|
|
47
|
+
name
|
|
48
|
+
}
|
|
48
49
|
distribution
|
|
49
50
|
iosEnterpriseProvisioning
|
|
50
51
|
buildProfile
|
|
52
|
+
appIdentifier
|
|
51
53
|
sdkVersion
|
|
52
54
|
appVersion
|
|
53
55
|
appBuildVersion
|
|
54
|
-
|
|
56
|
+
runtime {
|
|
57
|
+
id
|
|
58
|
+
version
|
|
59
|
+
}
|
|
55
60
|
gitCommitHash
|
|
56
61
|
gitCommitMessage
|
|
57
62
|
initialQueuePosition
|
|
@@ -4,9 +4,7 @@ exports.getAccountNamesWhereUserHasSufficientPermissionsToCreateApp = getAccount
|
|
|
4
4
|
exports.getAccountChoices = getAccountChoices;
|
|
5
5
|
const generated_1 = require("../graphql/generated");
|
|
6
6
|
function getAccountNamesWhereUserHasSufficientPermissionsToCreateApp(actor) {
|
|
7
|
-
return new Set(actor.accounts
|
|
8
|
-
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
9
|
-
.map(it => it.name));
|
|
7
|
+
return new Set(actor.accounts.filter(a => a.viewerUserPermission.role !== generated_1.Role.ViewOnly).map(it => it.name));
|
|
10
8
|
}
|
|
11
9
|
function getAccountChoices(actor, namesWithSufficientPermissions) {
|
|
12
10
|
const allAccounts = actor.accounts;
|
|
@@ -4,6 +4,7 @@ exports.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync = fetchOrCre
|
|
|
4
4
|
exports.findProjectIdByAccountNameAndSlugNullableAsync = findProjectIdByAccountNameAndSlugNullableAsync;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const projectNotConfiguredError_1 = require("./projectNotConfiguredError");
|
|
7
8
|
const url_1 = require("../build/utils/url");
|
|
8
9
|
const generated_1 = require("../graphql/generated");
|
|
9
10
|
const AppMutation_1 = require("../graphql/mutations/AppMutation");
|
|
@@ -11,7 +12,6 @@ const AppQuery_1 = require("../graphql/queries/AppQuery");
|
|
|
11
12
|
const log_1 = require("../log");
|
|
12
13
|
const ora_1 = require("../ora");
|
|
13
14
|
const prompts_1 = require("../prompts");
|
|
14
|
-
const User_1 = require("../user/User");
|
|
15
15
|
/**
|
|
16
16
|
* 1. Looks for an existing project on EAS servers. If found, ask the user whether this is the
|
|
17
17
|
* project they would like to link. If yes, return that. If not, throw.
|
|
@@ -22,11 +22,9 @@ async function fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync(graph
|
|
|
22
22
|
const { accountName, projectName } = projectInfo;
|
|
23
23
|
const projectFullName = `@${accountName}/${projectName}`;
|
|
24
24
|
const allAccounts = actor.accounts;
|
|
25
|
-
const accountNamesWhereUserHasSufficientPublishPermissions = new Set(allAccounts
|
|
26
|
-
.filter(a => a.users.find(it => it.actor.id === actor.id)?.role !== generated_1.Role.ViewOnly)
|
|
27
|
-
.map(it => it.name));
|
|
25
|
+
const accountNamesWhereUserHasSufficientPublishPermissions = new Set(allAccounts.filter(a => a.viewerUserPermission.role !== generated_1.Role.ViewOnly).map(it => it.name));
|
|
28
26
|
if (options.nonInteractive) {
|
|
29
|
-
throw
|
|
27
|
+
throw (0, projectNotConfiguredError_1.getUnconfiguredProjectError)({ actor, accountName });
|
|
30
28
|
}
|
|
31
29
|
const account = allAccounts.find(a => a.name === accountName);
|
|
32
30
|
if (!account) {
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
/** An icon found in the app config, with the field it came from for display purposes. */
|
|
3
|
+
export interface AppConfigIcon {
|
|
4
|
+
field: string;
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
7
|
+
export type SetProjectIconFromAppConfigResult = {
|
|
8
|
+
status: 'set';
|
|
9
|
+
icon: AppConfigIcon;
|
|
10
|
+
} | {
|
|
11
|
+
status: 'skipped';
|
|
12
|
+
reason: 'no-icon-in-app-config' | 'icon-already-set' | 'invalid-icon' | 'upload-failed';
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Set the project icon from the app config, but only when the project does not have one yet.
|
|
16
|
+
* Overwriting an icon picked on the dashboard would be surprising, and the app config is not the
|
|
17
|
+
* source of truth for it.
|
|
18
|
+
*
|
|
19
|
+
* Never throws. The project is already created or linked by the time this runs, so a failed icon
|
|
20
|
+
* upload must not fail the command that called it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function maybeSetProjectIconFromAppConfigAsync(graphqlClient: ExpoGraphqlClient, { projectId, projectDir }: {
|
|
23
|
+
projectId: string;
|
|
24
|
+
projectDir: string;
|
|
25
|
+
}): Promise<SetProjectIconFromAppConfigResult>;
|
|
26
|
+
/**
|
|
27
|
+
* Find the app icon on disk. Falls through to the platform-specific icons so that a project that
|
|
28
|
+
* only sets `ios.icon` or an Android adaptive icon still gets one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveAppConfigIconAsync(projectDir: string): Promise<AppConfigIcon | null>;
|
|
31
|
+
export declare function validateIconAsync(imagePath: string): Promise<void>;
|
|
32
|
+
export declare function uploadProjectIconAsync(graphqlClient: ExpoGraphqlClient, { projectId, imagePath }: {
|
|
33
|
+
projectId: string;
|
|
34
|
+
imagePath: string;
|
|
35
|
+
}): Promise<void>;
|
|
36
|
+
export declare function pollForProfileImageChangeAsync(graphqlClient: ExpoGraphqlClient, { projectId, previousProfileImageUrl, projectDashboardUrl, }: {
|
|
37
|
+
projectId: string;
|
|
38
|
+
previousProfileImageUrl: string | null;
|
|
39
|
+
projectDashboardUrl: string;
|
|
40
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybeSetProjectIconFromAppConfigAsync = maybeSetProjectIconFromAppConfigAsync;
|
|
4
|
+
exports.resolveAppConfigIconAsync = resolveAppConfigIconAsync;
|
|
5
|
+
exports.validateIconAsync = validateIconAsync;
|
|
6
|
+
exports.uploadProjectIconAsync = uploadProjectIconAsync;
|
|
7
|
+
exports.pollForProfileImageChangeAsync = pollForProfileImageChangeAsync;
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
9
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
11
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
+
const expoConfig_1 = require("./expoConfig");
|
|
13
|
+
const generated_1 = require("../graphql/generated");
|
|
14
|
+
const AppQuery_1 = require("../graphql/queries/AppQuery");
|
|
15
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
16
|
+
const uploads_1 = require("../uploads");
|
|
17
|
+
const promise_1 = require("../utils/promise");
|
|
18
|
+
const ALLOWED_EXTENSIONS = ['.png', '.jpg', '.jpeg'];
|
|
19
|
+
const MAX_IMAGE_SIZE_BYTES = 10 * 1024 * 1024; // matches the upload session's GCS limit
|
|
20
|
+
const POLL_INTERVAL_MS = 2000;
|
|
21
|
+
const POLL_TIMEOUT_MS = 90_000;
|
|
22
|
+
/**
|
|
23
|
+
* Set the project icon from the app config, but only when the project does not have one yet.
|
|
24
|
+
* Overwriting an icon picked on the dashboard would be surprising, and the app config is not the
|
|
25
|
+
* source of truth for it.
|
|
26
|
+
*
|
|
27
|
+
* Never throws. The project is already created or linked by the time this runs, so a failed icon
|
|
28
|
+
* upload must not fail the command that called it.
|
|
29
|
+
*/
|
|
30
|
+
async function maybeSetProjectIconFromAppConfigAsync(graphqlClient, { projectId, projectDir }) {
|
|
31
|
+
const icon = await resolveAppConfigIconAsync(projectDir);
|
|
32
|
+
if (!icon) {
|
|
33
|
+
return { status: 'skipped', reason: 'no-icon-in-app-config' };
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
await validateIconAsync(icon.path);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
log_1.default.warn(`Did not set the project icon from "${icon.field}": ${error.message}`);
|
|
40
|
+
return { status: 'skipped', reason: 'invalid-icon' };
|
|
41
|
+
}
|
|
42
|
+
const existingIconUrl = await AppQuery_1.AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId);
|
|
43
|
+
if (existingIconUrl) {
|
|
44
|
+
log_1.default.debug('The project already has an icon, skipping the icon from the app config.');
|
|
45
|
+
return { status: 'skipped', reason: 'icon-already-set' };
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
await uploadProjectIconAsync(graphqlClient, { projectId, imagePath: icon.path });
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
log_1.default.warn(`Failed to set the project icon from "${icon.field}": ${error.message}`);
|
|
52
|
+
return { status: 'skipped', reason: 'upload-failed' };
|
|
53
|
+
}
|
|
54
|
+
// The server resizes the image and assigns it to the project asynchronously. Callers that need
|
|
55
|
+
// the icon to be visible before they return should poll with pollForProfileImageChangeAsync.
|
|
56
|
+
log_1.default.withTick(`Set the project icon from ${chalk_1.default.bold(icon.field)} in your app config`);
|
|
57
|
+
return { status: 'set', icon };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Find the app icon on disk. Falls through to the platform-specific icons so that a project that
|
|
61
|
+
* only sets `ios.icon` or an Android adaptive icon still gets one.
|
|
62
|
+
*/
|
|
63
|
+
async function resolveAppConfigIconAsync(projectDir) {
|
|
64
|
+
let exp;
|
|
65
|
+
try {
|
|
66
|
+
exp = await (0, expoConfig_1.getPrivateExpoConfigAsync)(projectDir);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
log_1.default.debug(`Could not read the app config to resolve the project icon: ${error.message}`);
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const candidates = [
|
|
73
|
+
['icon', exp.icon],
|
|
74
|
+
['ios.icon', exp.ios?.icon],
|
|
75
|
+
['android.adaptiveIcon.foregroundImage', exp.android?.adaptiveIcon?.foregroundImage],
|
|
76
|
+
];
|
|
77
|
+
for (const [field, value] of candidates) {
|
|
78
|
+
const iconPath = resolveLocalIconPath(projectDir, value);
|
|
79
|
+
if (iconPath && (await fs_extra_1.default.pathExists(iconPath))) {
|
|
80
|
+
return { field, path: iconPath };
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
function resolveLocalIconPath(projectDir, value) {
|
|
86
|
+
// SDK 52 and above allow `ios.icon` to be a per-appearance map. The light icon is the one shown
|
|
87
|
+
// in most places, so it is the closest match for a single project icon.
|
|
88
|
+
let rawPath = null;
|
|
89
|
+
if (typeof value === 'string') {
|
|
90
|
+
rawPath = value;
|
|
91
|
+
}
|
|
92
|
+
else if (value && typeof value === 'object' && typeof value.light === 'string') {
|
|
93
|
+
rawPath = value.light;
|
|
94
|
+
}
|
|
95
|
+
// Remote icons (http://, https://, data:) are not files we can upload. The scheme must be at
|
|
96
|
+
// least two characters so that a Windows drive letter is still treated as a path.
|
|
97
|
+
if (!rawPath || /^[a-z][a-z0-9+.-]+:/i.test(rawPath)) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return path_1.default.resolve(projectDir, rawPath);
|
|
101
|
+
}
|
|
102
|
+
async function validateIconAsync(imagePath) {
|
|
103
|
+
if (!(await fs_extra_1.default.pathExists(imagePath))) {
|
|
104
|
+
throw new Error(`No file found at ${imagePath}`);
|
|
105
|
+
}
|
|
106
|
+
const extension = path_1.default.extname(imagePath).toLowerCase();
|
|
107
|
+
if (!ALLOWED_EXTENSIONS.includes(extension)) {
|
|
108
|
+
throw new Error(`Unsupported image format "${extension}". The icon must be a PNG or JPEG file.`);
|
|
109
|
+
}
|
|
110
|
+
const { size } = await fs_extra_1.default.stat(imagePath);
|
|
111
|
+
if (size > MAX_IMAGE_SIZE_BYTES) {
|
|
112
|
+
throw new Error(`The image is ${(size / 1024 / 1024).toFixed(1)} MB, but the maximum allowed size is 10 MB.`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async function uploadProjectIconAsync(graphqlClient, { projectId, imagePath }) {
|
|
116
|
+
await (0, uploads_1.uploadAppScopedFileAtPathToGCSAsync)(graphqlClient, {
|
|
117
|
+
type: generated_1.AppUploadSessionType.ProfileImageUpload,
|
|
118
|
+
appId: projectId,
|
|
119
|
+
path: imagePath,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async function pollForProfileImageChangeAsync(graphqlClient, { projectId, previousProfileImageUrl, projectDashboardUrl, }) {
|
|
123
|
+
const startTime = Date.now();
|
|
124
|
+
while (Date.now() - startTime < POLL_TIMEOUT_MS) {
|
|
125
|
+
await (0, promise_1.sleepAsync)(POLL_INTERVAL_MS);
|
|
126
|
+
const profileImageUrl = await AppQuery_1.AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId);
|
|
127
|
+
if (profileImageUrl && profileImageUrl !== previousProfileImageUrl) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
throw new Error(`Timed out waiting for the icon to be processed. It may still appear on the project page shortly: ${chalk_1.default.underline(projectDashboardUrl)}`);
|
|
132
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Actor } from '../user/User';
|
|
2
|
+
/**
|
|
3
|
+
* Build the error shown when an EAS project is not configured and the CLI cannot configure it
|
|
4
|
+
* without more input. Lists the exact commands to run, because bare "eas init" also needs
|
|
5
|
+
* interaction and fails in the same situation.
|
|
6
|
+
*
|
|
7
|
+
* @param actor the logged-in actor
|
|
8
|
+
* @param accountName the account that should own the project, when it is already known
|
|
9
|
+
* @param reason why the CLI cannot configure the project here
|
|
10
|
+
* @param additionalFix an extra way to resolve the error, appended at the end
|
|
11
|
+
*/
|
|
12
|
+
export declare function getUnconfiguredProjectError({ actor, accountName, reason, additionalFix, }: {
|
|
13
|
+
actor: Actor;
|
|
14
|
+
accountName?: string;
|
|
15
|
+
reason?: string;
|
|
16
|
+
additionalFix?: string;
|
|
17
|
+
}): Error;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUnconfiguredProjectError = getUnconfiguredProjectError;
|
|
4
|
+
const User_1 = require("../user/User");
|
|
5
|
+
/**
|
|
6
|
+
* Build the error shown when an EAS project is not configured and the CLI cannot configure it
|
|
7
|
+
* without more input. Lists the exact commands to run, because bare "eas init" also needs
|
|
8
|
+
* interaction and fails in the same situation.
|
|
9
|
+
*
|
|
10
|
+
* @param actor the logged-in actor
|
|
11
|
+
* @param accountName the account that should own the project, when it is already known
|
|
12
|
+
* @param reason why the CLI cannot configure the project here
|
|
13
|
+
* @param additionalFix an extra way to resolve the error, appended at the end
|
|
14
|
+
*/
|
|
15
|
+
function getUnconfiguredProjectError({ actor, accountName, reason = 'This command cannot configure it in non-interactive mode.', additionalFix, }) {
|
|
16
|
+
return new Error(`EAS project not configured. ${reason} ` +
|
|
17
|
+
`Run one of the following, then re-run this command:\n\n` +
|
|
18
|
+
`To link an existing project:\n\n` +
|
|
19
|
+
` eas init --id <project-id> --non-interactive\n\n` +
|
|
20
|
+
`To create a new project:\n\n` +
|
|
21
|
+
` eas init --account ${accountName ?? '<account-name>'} --non-interactive\n\n` +
|
|
22
|
+
`Accounts you can create projects in: ${(0, User_1.getCreatableAccountNames)(actor).join(', ')}` +
|
|
23
|
+
(additionalFix ? `\n\n${additionalFix}` : ''));
|
|
24
|
+
}
|
package/build/simulator/env.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export declare const SIMULATOR_DOTENV_FILE_HEADER = "# Do not commit this file.\
|
|
|
4
4
|
export declare function getSimulatorEnvFilePath(projectDir: string): string;
|
|
5
5
|
export declare function loadSimulatorEnvAsync(projectDir: string): Promise<void>;
|
|
6
6
|
export declare function writeSimulatorEnvAsync(projectDir: string, environmentVariables: Record<string, string>): Promise<void>;
|
|
7
|
-
export declare function resetSimulatorEnvAsync(projectDir: string): Promise<void>;
|
|
7
|
+
export declare function resetSimulatorEnvAsync(projectDir: string, expectedDeviceRunSessionId: string): Promise<void>;
|
package/build/simulator/env.js
CHANGED
|
@@ -7,8 +7,10 @@ exports.writeSimulatorEnvAsync = writeSimulatorEnvAsync;
|
|
|
7
7
|
exports.resetSimulatorEnvAsync = resetSimulatorEnvAsync;
|
|
8
8
|
const tslib_1 = require("tslib");
|
|
9
9
|
const env_1 = require("@expo/env");
|
|
10
|
+
const dotenv_1 = require("dotenv");
|
|
10
11
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
11
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
12
14
|
exports.SIMULATOR_DOTENV_FILE_NAME = '.env.eas-simulator';
|
|
13
15
|
exports.EAS_SIMULATOR_SESSION_ID = 'EAS_SIMULATOR_SESSION_ID';
|
|
14
16
|
exports.SIMULATOR_DOTENV_FILE_HEADER = '# Do not commit this file.\n# Do not modify these values manually. They are managed by eas-cli.\n# It holds configuration only for the current simulator session.\n\n';
|
|
@@ -24,14 +26,22 @@ async function writeSimulatorEnvAsync(projectDir, environmentVariables) {
|
|
|
24
26
|
const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
|
|
25
27
|
const simulatorDotenvContent = exports.SIMULATOR_DOTENV_FILE_HEADER +
|
|
26
28
|
Object.entries(environmentVariables)
|
|
27
|
-
.map(([key, value]) => `${key}
|
|
29
|
+
.map(([key, value]) => `${key}='${value}'`)
|
|
28
30
|
.join('\n') +
|
|
29
31
|
'\n';
|
|
30
32
|
await fs.writeFile(simulatorDotenvFilePath, simulatorDotenvContent);
|
|
31
33
|
}
|
|
32
|
-
async function resetSimulatorEnvAsync(projectDir) {
|
|
34
|
+
async function resetSimulatorEnvAsync(projectDir, expectedDeviceRunSessionId) {
|
|
33
35
|
const simulatorDotenvFilePath = getSimulatorEnvFilePath(projectDir);
|
|
34
36
|
try {
|
|
37
|
+
const currentEnv = (0, dotenv_1.parse)(await fs.readFile(simulatorDotenvFilePath, 'utf8'));
|
|
38
|
+
if (currentEnv[exports.EAS_SIMULATOR_SESSION_ID] !== expectedDeviceRunSessionId) {
|
|
39
|
+
// The file was overwritten by a newer simulator session, so it is no longer
|
|
40
|
+
// ours to reset. This is expected when sessions overlap; log at debug level
|
|
41
|
+
// for troubleshooting without surfacing noise during normal use.
|
|
42
|
+
log_1.default.debug(`Skipping ${exports.SIMULATOR_DOTENV_FILE_NAME} reset: it belongs to simulator session ${currentEnv[exports.EAS_SIMULATOR_SESSION_ID] ?? '(unknown)'}, not ${expectedDeviceRunSessionId}.`);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
35
45
|
await fs.writeFile(simulatorDotenvFilePath, exports.SIMULATOR_DOTENV_FILE_HEADER, { flag: 'r+' });
|
|
36
46
|
await fs.truncate(simulatorDotenvFilePath, Buffer.byteLength(exports.SIMULATOR_DOTENV_FILE_HEADER));
|
|
37
47
|
}
|
package/build/simulator/utils.js
CHANGED
|
@@ -23,6 +23,7 @@ function formatSimulatorUnavailableMessage(accountName) {
|
|
|
23
23
|
// so adding a new enum value in codegen fails the build until it is wired up here.
|
|
24
24
|
exports.DEVICE_RUN_SESSION_TYPE_FLAG_VALUES = {
|
|
25
25
|
[generated_1.DeviceRunSessionType.AgentDevice]: 'agent-device',
|
|
26
|
+
[generated_1.DeviceRunSessionType.Appium]: 'appium',
|
|
26
27
|
[generated_1.DeviceRunSessionType.Argent]: 'argent',
|
|
27
28
|
[generated_1.DeviceRunSessionType.ServeSim]: 'serve-sim',
|
|
28
29
|
};
|
|
@@ -42,6 +43,11 @@ function getRemoteSessionEnvironmentVariables(remoteConfig) {
|
|
|
42
43
|
ARGENT_TOOLS_URL: remoteConfig.toolsUrl,
|
|
43
44
|
...(remoteConfig.toolsAuthToken ? { ARGENT_AUTH_TOKEN: remoteConfig.toolsAuthToken } : {}),
|
|
44
45
|
};
|
|
46
|
+
case 'AppiumRunSessionRemoteConfig':
|
|
47
|
+
return {
|
|
48
|
+
APPIUM_URL: remoteConfig.appiumUrl,
|
|
49
|
+
APPIUM_CAPS: JSON.stringify(remoteConfig.capabilities),
|
|
50
|
+
};
|
|
45
51
|
case 'ServeSimRunSessionRemoteConfig':
|
|
46
52
|
return {};
|
|
47
53
|
}
|
|
@@ -96,6 +102,26 @@ function formatRemoteSessionInstructions(remoteConfig, configType) {
|
|
|
96
102
|
}
|
|
97
103
|
return lines.join('\n');
|
|
98
104
|
}
|
|
105
|
+
case 'AppiumRunSessionRemoteConfig': {
|
|
106
|
+
const environmentVariables = getRemoteSessionEnvironmentVariables(remoteConfig);
|
|
107
|
+
const lines = configType === 'dotenv'
|
|
108
|
+
? [
|
|
109
|
+
'Run an Appium client with the simulator session environment:',
|
|
110
|
+
'',
|
|
111
|
+
'eas simulator:exec <appium-client> [args...]',
|
|
112
|
+
]
|
|
113
|
+
: [
|
|
114
|
+
'Run the following in your shell to attach an Appium client to this session:',
|
|
115
|
+
'',
|
|
116
|
+
...Object.entries(environmentVariables).map(([key, value]) => `export ${key}='${value}'`),
|
|
117
|
+
'',
|
|
118
|
+
'<appium-client> [args...]',
|
|
119
|
+
];
|
|
120
|
+
if (remoteConfig.webPreviewUrl) {
|
|
121
|
+
lines.push('', 'Open the iOS simulator preview:', '', remoteConfig.webPreviewUrl);
|
|
122
|
+
}
|
|
123
|
+
return lines.join('\n');
|
|
124
|
+
}
|
|
99
125
|
case 'ServeSimRunSessionRemoteConfig':
|
|
100
126
|
return [
|
|
101
127
|
'🌐 Open the following URL in your browser to access the simulator:',
|
|
@@ -211,7 +211,7 @@ async function handleBuildListSourceAsync(ctx) {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
function formatBuildChoice(build) {
|
|
214
|
-
const { id, updatedAt,
|
|
214
|
+
const { id, updatedAt, runtime, buildProfile, gitCommitHash, gitCommitMessage, updateChannel, message, status, } = build;
|
|
215
215
|
const buildDate = new Date(updatedAt);
|
|
216
216
|
const splitCommitMessage = gitCommitMessage?.split('\n');
|
|
217
217
|
const formattedCommitData = gitCommitHash && splitCommitMessage && splitCommitMessage.length > 0
|
|
@@ -220,8 +220,8 @@ function formatBuildChoice(build) {
|
|
|
220
220
|
const title = `${chalk_1.default.bold(`ID:`)} ${id} (${chalk_1.default.bold(`${(0, date_1.fromNow)(buildDate)} ago`)})`;
|
|
221
221
|
const descriptionItems = [
|
|
222
222
|
{ name: 'Profile', value: buildProfile ? chalk_1.default.bold(buildProfile) : null },
|
|
223
|
-
{ name: 'Channel', value:
|
|
224
|
-
{ name: 'Runtime version', value:
|
|
223
|
+
{ name: 'Channel', value: updateChannel ? chalk_1.default.bold(updateChannel.name) : null },
|
|
224
|
+
{ name: 'Runtime version', value: runtime ? chalk_1.default.bold(runtime.version) : null },
|
|
225
225
|
{ name: 'Commit', value: formattedCommitData },
|
|
226
226
|
{
|
|
227
227
|
name: 'Message',
|
|
@@ -13,6 +13,7 @@ export interface SubmissionContext<T extends Platform> {
|
|
|
13
13
|
analyticsEventProperties: AnalyticsEventProperties;
|
|
14
14
|
exp: ExpoConfig;
|
|
15
15
|
nonInteractive: boolean;
|
|
16
|
+
autoTestFlightSetup: boolean;
|
|
16
17
|
isVerboseFastlaneEnabled: boolean;
|
|
17
18
|
groups: T extends Platform.IOS ? string[] : undefined;
|
|
18
19
|
platform: T;
|
|
@@ -39,6 +40,7 @@ export declare function createSubmissionContextAsync<T extends Platform>(params:
|
|
|
39
40
|
credentialsCtx?: CredentialsContext;
|
|
40
41
|
env?: Env;
|
|
41
42
|
nonInteractive: boolean;
|
|
43
|
+
autoTestFlightSetup?: boolean;
|
|
42
44
|
isVerboseFastlaneEnabled: boolean;
|
|
43
45
|
groups: string[] | undefined;
|
|
44
46
|
platform: T;
|
package/build/submit/context.js
CHANGED
|
@@ -42,6 +42,7 @@ async function createSubmissionContextAsync(params) {
|
|
|
42
42
|
rest.analytics.logEvent(AnalyticsManager_1.SubmissionEvent.SUBMIT_COMMAND, analyticsEventProperties);
|
|
43
43
|
return {
|
|
44
44
|
...rest,
|
|
45
|
+
autoTestFlightSetup: params.autoTestFlightSetup ?? true,
|
|
45
46
|
accountName: account.name,
|
|
46
47
|
credentialsCtx,
|
|
47
48
|
groups,
|
|
@@ -55,7 +55,7 @@ async function createAppStoreConnectAppAsync(ctx, options) {
|
|
|
55
55
|
sku,
|
|
56
56
|
});
|
|
57
57
|
try {
|
|
58
|
-
await (0, ensureTestFlightGroup_1.ensureTestFlightGroupExistsAsync)(app);
|
|
58
|
+
await (0, ensureTestFlightGroup_1.ensureTestFlightGroupExistsAsync)(app, { nonInteractive: ctx.nonInteractive });
|
|
59
59
|
}
|
|
60
60
|
catch (error) {
|
|
61
61
|
// This process is not critical to the app submission so we shouldn't let it fail the entire process.
|
|
@@ -10,6 +10,7 @@ const AppProduce_1 = require("./AppProduce");
|
|
|
10
10
|
const AppSpecificPasswordSource_1 = require("./AppSpecificPasswordSource");
|
|
11
11
|
const AscApiKeySource_1 = require("./AscApiKeySource");
|
|
12
12
|
const IosSubmitter_1 = tslib_1.__importDefault(require("./IosSubmitter"));
|
|
13
|
+
const ensureTestFlightSetup_1 = require("./ensureTestFlightSetup");
|
|
13
14
|
const errors_1 = require("../../credentials/errors");
|
|
14
15
|
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
15
16
|
const ArchiveSource_1 = require("../ArchiveSource");
|
|
@@ -135,6 +136,7 @@ class IosSubmitCommand {
|
|
|
135
136
|
async resolveAscAppIdentifierAsync() {
|
|
136
137
|
const { ascAppId } = this.ctx.profile;
|
|
137
138
|
if (ascAppId) {
|
|
139
|
+
await (0, ensureTestFlightSetup_1.ensureTestFlightSetupForExistingAppAsync)(this.ctx, ascAppId);
|
|
138
140
|
return (0, results_1.result)(ascAppId);
|
|
139
141
|
}
|
|
140
142
|
else if (this.ctx.nonInteractive) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Platform } from '@expo/eas-build-job';
|
|
2
|
+
import { SubmissionContext } from '../context';
|
|
3
|
+
/**
|
|
4
|
+
* Best-effort TestFlight internal group setup for an App Store Connect app
|
|
5
|
+
* that already exists with `ascAppId` provided.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ensureTestFlightSetupForExistingAppAsync(ctx: SubmissionContext<Platform.IOS>, ascAppIdentifier: string): Promise<void>;
|