eas-cli 21.8.0 → 22.0.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 +166 -156
- 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/go.js +2 -45
- 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/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 +596 -922
- package/build/graphql/generated.js +12 -2
- package/build/graphql/queries/ChannelInsightsQuery.js +4 -1
- 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/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/user/User.js +1 -1
- package/oclif.manifest.json +2323 -2311
- package/package.json +6 -6
package/build/build/metadata.js
CHANGED
|
@@ -60,7 +60,6 @@ async function collectMetadataAsync(ctx, runtimeAndFingerprintMetadata) {
|
|
|
60
60
|
customWorkflowName: ctx.customBuildConfigMetadata?.workflowName,
|
|
61
61
|
developmentClient: ctx.developmentClient,
|
|
62
62
|
requiredPackageManager: ctx.requiredPackageManager ?? undefined,
|
|
63
|
-
selectedImage: ctx.buildProfile.image,
|
|
64
63
|
customNodeVersion: ctx.buildProfile.node,
|
|
65
64
|
simulator: 'simulator' in ctx.buildProfile && ctx.buildProfile.simulator,
|
|
66
65
|
};
|
|
@@ -369,7 +369,7 @@ function exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds) {
|
|
|
369
369
|
}
|
|
370
370
|
async function downloadAndRunAsync(build, simulator) {
|
|
371
371
|
(0, assert_1.default)(build.artifacts?.applicationArchiveUrl);
|
|
372
|
-
const cachedAppPath = (0, run_1.getEasBuildRunCachedAppPath)(build.
|
|
372
|
+
const cachedAppPath = (0, run_1.getEasBuildRunCachedAppPath)(build.app.id, build.id, build.platform);
|
|
373
373
|
if (await (0, fs_extra_1.pathExists)(cachedAppPath)) {
|
|
374
374
|
log_1.default.newLine();
|
|
375
375
|
log_1.default.log(`Using cached app...`);
|
|
@@ -88,7 +88,7 @@ function formatGraphQLBuild(build) {
|
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
label: 'Channel',
|
|
91
|
-
value: build.
|
|
91
|
+
value: build.updateChannel?.name,
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
label: 'SDK Version',
|
|
@@ -96,7 +96,7 @@ function formatGraphQLBuild(build) {
|
|
|
96
96
|
},
|
|
97
97
|
{
|
|
98
98
|
label: 'Runtime Version',
|
|
99
|
-
value: build.
|
|
99
|
+
value: build.runtime?.version,
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
label: 'Version',
|
package/build/build/utils/url.js
CHANGED
|
@@ -23,10 +23,8 @@ function getProjectPageUrl(accountName, projectName, page) {
|
|
|
23
23
|
return new URL(page ? `${projectPath}/${page}` : projectPath, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
|
|
24
24
|
}
|
|
25
25
|
function getBuildLogsUrl(build, hash) {
|
|
26
|
-
const {
|
|
27
|
-
const url =
|
|
28
|
-
? `/builds/${build.id}`
|
|
29
|
-
: `/accounts/${project.ownerAccount.name}/projects/${project.slug}/builds/${build.id}${hash ? `#${hash}` : ''}`;
|
|
26
|
+
const { app } = build;
|
|
27
|
+
const url = `/accounts/${app.ownerAccount.name}/projects/${app.slug}/builds/${build.id}${hash ? `#${hash}` : ''}`;
|
|
30
28
|
return new URL(url, (0, api_1.getExpoWebsiteBaseUrl)()).toString();
|
|
31
29
|
}
|
|
32
30
|
function getArtifactUrl(artifactId) {
|
|
@@ -34,7 +32,7 @@ function getArtifactUrl(artifactId) {
|
|
|
34
32
|
}
|
|
35
33
|
function getInternalDistributionInstallUrl(build) {
|
|
36
34
|
if (build.platform === generated_1.AppPlatform.Ios) {
|
|
37
|
-
return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/v2/projects/${build.
|
|
35
|
+
return `itms-services://?action=download-manifest;url=${(0, api_1.getExpoApiBaseUrl)()}/v2/projects/${build.app.id}/builds/${build.id}/manifest.plist`;
|
|
38
36
|
}
|
|
39
37
|
(0, assert_1.default)(build.artifacts?.buildUrl, 'buildUrl is missing');
|
|
40
38
|
return build.artifacts.buildUrl;
|
|
@@ -15,6 +15,7 @@ const ora_1 = require("../../../ora");
|
|
|
15
15
|
const accountSelection_1 = require("../../../project/accountSelection");
|
|
16
16
|
const expoConfig_1 = require("../../../project/expoConfig");
|
|
17
17
|
const fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1 = require("../../../project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync");
|
|
18
|
+
const projectNotConfiguredError_1 = require("../../../project/projectNotConfiguredError");
|
|
18
19
|
const prompts_1 = require("../../../prompts");
|
|
19
20
|
const User_1 = require("../../../user/User");
|
|
20
21
|
/**
|
|
@@ -106,7 +107,9 @@ async function validateOrSetProjectIdAsync({ exp, graphqlClient, actor, options,
|
|
|
106
107
|
if (!projectDir) {
|
|
107
108
|
throw new Error('This command must be run inside a project directory.');
|
|
108
109
|
}
|
|
109
|
-
|
|
110
|
+
if (!options.nonInteractive) {
|
|
111
|
+
log_1.default.warn('EAS project not configured.');
|
|
112
|
+
}
|
|
110
113
|
const accountName = await chooseAccountNameForEASProjectAsync(exp, actor, options);
|
|
111
114
|
const projectId = await (0, fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync_1.fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync)(graphqlClient, {
|
|
112
115
|
accountName,
|
|
@@ -135,14 +138,18 @@ async function chooseAccountNameForEASProjectAsync(exp, actor, options) {
|
|
|
135
138
|
return exp.owner;
|
|
136
139
|
}
|
|
137
140
|
if (actor.__typename === 'Robot') {
|
|
138
|
-
throw
|
|
141
|
+
throw (0, projectNotConfiguredError_1.getUnconfiguredProjectError)({
|
|
142
|
+
actor,
|
|
143
|
+
reason: 'A robot access token cannot configure it interactively.',
|
|
144
|
+
additionalFix: 'Alternatively, set the "owner" field in your app config.',
|
|
145
|
+
});
|
|
139
146
|
}
|
|
140
147
|
const allAccounts = actor.accounts;
|
|
141
148
|
if (allAccounts.length === 1) {
|
|
142
149
|
return allAccounts[0].name;
|
|
143
150
|
}
|
|
144
151
|
if (options.nonInteractive) {
|
|
145
|
-
throw
|
|
152
|
+
throw (0, projectNotConfiguredError_1.getUnconfiguredProjectError)({ actor });
|
|
146
153
|
}
|
|
147
154
|
const choices = (0, accountSelection_1.getAccountChoices)(actor, (0, accountSelection_1.getAccountNamesWhereUserHasSufficientPermissionsToCreateApp)(actor));
|
|
148
155
|
return (await (0, prompts_1.promptAsync)({
|
|
@@ -55,7 +55,7 @@ async function generateProjectConfigAsync(pathArg, options) {
|
|
|
55
55
|
function getAccountPermissionsMap(actor) {
|
|
56
56
|
const permissionsMap = new Map();
|
|
57
57
|
for (const account of actor.accounts) {
|
|
58
|
-
const hasPermission = account.
|
|
58
|
+
const hasPermission = account.viewerUserPermission.role !== generated_1.Role.ViewOnly;
|
|
59
59
|
permissionsMap.set(account.name, hasPermission);
|
|
60
60
|
}
|
|
61
61
|
return permissionsMap;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
|
-
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
5
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
6
|
const generated_1 = require("../../graphql/generated");
|
|
8
7
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
@@ -45,7 +44,7 @@ class AccountView extends EasCommand_1.default {
|
|
|
45
44
|
if ('username' in actor && account.name === actor.username) {
|
|
46
45
|
return generated_1.Role.Owner;
|
|
47
46
|
}
|
|
48
|
-
return
|
|
47
|
+
return account.viewerUserPermission.role;
|
|
49
48
|
}
|
|
50
49
|
static getLabelForRole(role) {
|
|
51
50
|
switch (role) {
|
|
@@ -18,8 +18,8 @@ async function cancelBuildAsync(graphqlClient, buildId) {
|
|
|
18
18
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
19
19
|
.mutation((0, graphql_tag_1.default) `
|
|
20
20
|
mutation CancelBuildMutation($buildId: ID!) {
|
|
21
|
-
build
|
|
22
|
-
|
|
21
|
+
build {
|
|
22
|
+
cancelBuild(buildId: $buildId) {
|
|
23
23
|
id
|
|
24
24
|
status
|
|
25
25
|
}
|
|
@@ -27,7 +27,7 @@ async function cancelBuildAsync(graphqlClient, buildId) {
|
|
|
27
27
|
}
|
|
28
28
|
`, { buildId })
|
|
29
29
|
.toPromise());
|
|
30
|
-
return data.build.
|
|
30
|
+
return data.build.cancelBuild;
|
|
31
31
|
}
|
|
32
32
|
async function selectBuildToCancelAsync(graphqlClient, projectId, projectDisplayName, filters) {
|
|
33
33
|
const spinner = (0, ora_1.ora)().start('Fetching the uncompleted builds…');
|
|
@@ -168,7 +168,7 @@ class Download extends EasCommand_1.default {
|
|
|
168
168
|
return builds[0];
|
|
169
169
|
}
|
|
170
170
|
async getPathToBuildArtifactAsync(build, platform) {
|
|
171
|
-
const cachedBuildArtifactPath = (0, run_1.getEasBuildRunCachedAppPath)(build.
|
|
171
|
+
const cachedBuildArtifactPath = (0, run_1.getEasBuildRunCachedAppPath)(build.app.id, build.id, platform);
|
|
172
172
|
if (await fs_extra_1.default.pathExists(cachedBuildArtifactPath)) {
|
|
173
173
|
log_1.default.newLine();
|
|
174
174
|
log_1.default.log(`Using cached build...`);
|
package/build/commands/go.js
CHANGED
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.detectProjectSdkVersionAsync = detectProjectSdkVersionAsync;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_1 = require("@expo/config");
|
|
6
|
-
const apple_utils_1 = require("@expo/apple-utils");
|
|
7
6
|
const core_1 = require("@oclif/core");
|
|
8
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
9
8
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
@@ -17,6 +16,7 @@ const SetUpAscApiKey_1 = require("../credentials/ios/actions/SetUpAscApiKey");
|
|
|
17
16
|
const SetUpBuildCredentials_1 = require("../credentials/ios/actions/SetUpBuildCredentials");
|
|
18
17
|
const SetUpPushKey_1 = require("../credentials/ios/actions/SetUpPushKey");
|
|
19
18
|
const ensureAppExists_1 = require("../credentials/ios/appstore/ensureAppExists");
|
|
19
|
+
const ensureTestFlightGroup_1 = require("../credentials/ios/appstore/ensureTestFlightGroup");
|
|
20
20
|
const generated_1 = require("../graphql/generated");
|
|
21
21
|
const url_1 = require("../build/utils/url");
|
|
22
22
|
const AppMutation_1 = require("../graphql/mutations/AppMutation");
|
|
@@ -49,51 +49,8 @@ async function detectProjectSdkVersionAsync(projectDir) {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const TESTFLIGHT_GROUP_NAME = 'Team (Expo)';
|
|
53
52
|
async function setupTestFlightAsync(ascApp) {
|
|
54
|
-
|
|
55
|
-
for (let attempt = 0; attempt < 10; attempt++) {
|
|
56
|
-
try {
|
|
57
|
-
const groups = await ascApp.getBetaGroupsAsync({
|
|
58
|
-
query: { includes: ['betaTesters'] },
|
|
59
|
-
});
|
|
60
|
-
group = groups.find(g => g.attributes.isInternalGroup && g.attributes.name === TESTFLIGHT_GROUP_NAME);
|
|
61
|
-
if (!group) {
|
|
62
|
-
group = await ascApp.createBetaGroupAsync({
|
|
63
|
-
name: TESTFLIGHT_GROUP_NAME,
|
|
64
|
-
isInternalGroup: true,
|
|
65
|
-
hasAccessToAllBuilds: true,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
// Apple returns this error when the app isn't ready yet
|
|
72
|
-
if (error?.data?.errors?.some((e) => e.code === 'ENTITY_ERROR.RELATIONSHIP.INVALID')) {
|
|
73
|
-
if (attempt < 9) {
|
|
74
|
-
await (0, promise_1.sleepAsync)(10_000);
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
throw error;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
if (!group) {
|
|
82
|
-
throw new Error('Failed to create TestFlight group');
|
|
83
|
-
}
|
|
84
|
-
const users = await apple_utils_1.User.getAsync(ascApp.context);
|
|
85
|
-
const admins = users.filter(u => u.attributes.roles?.includes(apple_utils_1.UserRole.ADMIN));
|
|
86
|
-
const existingEmails = new Set(group.attributes.betaTesters?.map((t) => t.attributes.email?.toLowerCase()) ?? []);
|
|
87
|
-
const newTesters = admins
|
|
88
|
-
.filter(u => u.attributes.email && !existingEmails.has(u.attributes.email.toLowerCase()))
|
|
89
|
-
.map(u => ({
|
|
90
|
-
email: u.attributes.email,
|
|
91
|
-
firstName: u.attributes.firstName ?? '',
|
|
92
|
-
lastName: u.attributes.lastName ?? '',
|
|
93
|
-
}));
|
|
94
|
-
if (newTesters.length > 0) {
|
|
95
|
-
await group.createBulkBetaTesterAssignmentsAsync(newTesters);
|
|
96
|
-
}
|
|
53
|
+
await (0, ensureTestFlightGroup_1.ensureTestFlightGroupExistsAsync)(ascApp);
|
|
97
54
|
}
|
|
98
55
|
/* eslint-disable no-console */
|
|
99
56
|
async function withSuppressedOutputAsync(fn) {
|
|
@@ -3,21 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
7
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
6
|
const url_1 = require("../../../build/utils/url");
|
|
9
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
|
|
10
8
|
const flags_1 = require("../../../commandUtils/flags");
|
|
11
|
-
const generated_1 = require("../../../graphql/generated");
|
|
12
9
|
const AppQuery_1 = require("../../../graphql/queries/AppQuery");
|
|
13
10
|
const log_1 = tslib_1.__importStar(require("../../../log"));
|
|
14
11
|
const ora_1 = require("../../../ora");
|
|
15
|
-
const
|
|
16
|
-
const promise_1 = require("../../../utils/promise");
|
|
17
|
-
const ALLOWED_EXTENSIONS = ['.png', '.jpg', '.jpeg'];
|
|
18
|
-
const MAX_IMAGE_SIZE_BYTES = 10 * 1024 * 1024; // matches the upload session's GCS limit
|
|
19
|
-
const POLL_INTERVAL_MS = 2000;
|
|
20
|
-
const POLL_TIMEOUT_MS = 90_000;
|
|
12
|
+
const projectIcon_1 = require("../../../project/projectIcon");
|
|
21
13
|
class ProjectIconSet extends EasCommand_1.default {
|
|
22
14
|
static description = 'set the project icon displayed on the EAS dashboard';
|
|
23
15
|
static args = {
|
|
@@ -38,21 +30,17 @@ class ProjectIconSet extends EasCommand_1.default {
|
|
|
38
30
|
const { projectId, loggedIn: { graphqlClient }, } = await this.getContextAsync(ProjectIconSet, {
|
|
39
31
|
nonInteractive: flags['non-interactive'],
|
|
40
32
|
});
|
|
41
|
-
await
|
|
33
|
+
await (0, projectIcon_1.validateIconAsync)(imagePath);
|
|
42
34
|
const app = await AppQuery_1.AppQuery.byIdAsync(graphqlClient, projectId);
|
|
43
35
|
const projectDashboardUrl = (0, url_1.getProjectDashboardUrl)(app.ownerAccount.name, app.slug);
|
|
44
36
|
const previousProfileImageUrl = await AppQuery_1.AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId);
|
|
45
37
|
const spinner = (0, ora_1.ora)('Uploading project icon').start();
|
|
46
38
|
try {
|
|
47
|
-
await (0,
|
|
48
|
-
type: generated_1.AppUploadSessionType.ProfileImageUpload,
|
|
49
|
-
appId: projectId,
|
|
50
|
-
path: imagePath,
|
|
51
|
-
});
|
|
39
|
+
await (0, projectIcon_1.uploadProjectIconAsync)(graphqlClient, { projectId, imagePath });
|
|
52
40
|
// The icon is processed asynchronously (resized and assigned to the
|
|
53
41
|
// project by the server), so poll until the icon URL changes.
|
|
54
42
|
spinner.text = 'Processing project icon';
|
|
55
|
-
await pollForProfileImageChangeAsync(graphqlClient, {
|
|
43
|
+
await (0, projectIcon_1.pollForProfileImageChangeAsync)(graphqlClient, {
|
|
56
44
|
projectId,
|
|
57
45
|
previousProfileImageUrl,
|
|
58
46
|
projectDashboardUrl,
|
|
@@ -67,27 +55,3 @@ class ProjectIconSet extends EasCommand_1.default {
|
|
|
67
55
|
}
|
|
68
56
|
}
|
|
69
57
|
exports.default = ProjectIconSet;
|
|
70
|
-
async function validateImageAsync(imagePath) {
|
|
71
|
-
if (!(await fs_extra_1.default.pathExists(imagePath))) {
|
|
72
|
-
throw new Error(`No file found at ${imagePath}`);
|
|
73
|
-
}
|
|
74
|
-
const extension = path_1.default.extname(imagePath).toLowerCase();
|
|
75
|
-
if (!ALLOWED_EXTENSIONS.includes(extension)) {
|
|
76
|
-
throw new Error(`Unsupported image format "${extension}". The icon must be a PNG or JPEG file.`);
|
|
77
|
-
}
|
|
78
|
-
const { size } = await fs_extra_1.default.stat(imagePath);
|
|
79
|
-
if (size > MAX_IMAGE_SIZE_BYTES) {
|
|
80
|
-
throw new Error(`The image is ${(size / 1024 / 1024).toFixed(1)} MB, but the maximum allowed size is 10 MB.`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
async function pollForProfileImageChangeAsync(graphqlClient, { projectId, previousProfileImageUrl, projectDashboardUrl, }) {
|
|
84
|
-
const startTime = Date.now();
|
|
85
|
-
while (Date.now() - startTime < POLL_TIMEOUT_MS) {
|
|
86
|
-
await (0, promise_1.sleepAsync)(POLL_INTERVAL_MS);
|
|
87
|
-
const profileImageUrl = await AppQuery_1.AppQuery.byIdProfileImageUrlAsync(graphqlClient, projectId);
|
|
88
|
-
if (profileImageUrl && profileImageUrl !== previousProfileImageUrl) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
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)}`);
|
|
93
|
-
}
|
|
@@ -9,6 +9,7 @@ export default class ProjectInit extends EasCommand {
|
|
|
9
9
|
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
10
|
account: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
11
|
force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
+
icon: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
};
|
|
13
14
|
static contextDefinition: {
|
|
14
15
|
projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
|
|
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const url_1 = require("../../build/utils/url");
|
|
6
6
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
7
|
const flags_1 = require("../../commandUtils/flags");
|
|
8
|
+
const projectIcon_1 = require("../../project/projectIcon");
|
|
8
9
|
const projectInitialization_1 = require("../../project/projectInitialization");
|
|
9
10
|
const json_1 = require("../../utils/json");
|
|
10
11
|
class ProjectInit extends EasCommand_1.default {
|
|
@@ -27,6 +28,11 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
27
28
|
force: core_1.Flags.boolean({
|
|
28
29
|
description: 'Whether to create a new project/link an existing project without additional prompts or overwrite any existing project ID when running with --id flag',
|
|
29
30
|
}),
|
|
31
|
+
icon: core_1.Flags.boolean({
|
|
32
|
+
description: 'Set the icon shown on the EAS dashboard from the app config, when the project does not have one yet',
|
|
33
|
+
default: true,
|
|
34
|
+
allowNo: true,
|
|
35
|
+
}),
|
|
30
36
|
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
31
37
|
};
|
|
32
38
|
static contextDefinition = {
|
|
@@ -60,6 +66,12 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
60
66
|
force,
|
|
61
67
|
nonInteractive,
|
|
62
68
|
});
|
|
69
|
+
const iconResult = flags.icon
|
|
70
|
+
? await (0, projectIcon_1.maybeSetProjectIconFromAppConfigAsync)(graphqlClient, {
|
|
71
|
+
projectId: result.projectId,
|
|
72
|
+
projectDir,
|
|
73
|
+
})
|
|
74
|
+
: null;
|
|
63
75
|
if (jsonFlag) {
|
|
64
76
|
(0, json_1.printJsonOnlyOutput)({
|
|
65
77
|
status: result.status,
|
|
@@ -67,6 +79,7 @@ class ProjectInit extends EasCommand_1.default {
|
|
|
67
79
|
owner,
|
|
68
80
|
slug,
|
|
69
81
|
dashboardUrl: (0, url_1.getProjectDashboardUrl)(owner, slug),
|
|
82
|
+
...(iconResult?.status === 'set' ? { icon: { source: iconResult.icon.field } } : {}),
|
|
70
83
|
});
|
|
71
84
|
}
|
|
72
85
|
}
|
|
@@ -15,6 +15,7 @@ export default class Submit extends EasCommand {
|
|
|
15
15
|
'verbose-fastlane': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
16
|
groups: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
17
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
|
+
'auto-testflight-setup': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
18
19
|
};
|
|
19
20
|
static contextDefinition: {
|
|
20
21
|
vcsClient: import("../commandUtils/context/VcsClientContextField").default;
|
package/build/commands/submit.js
CHANGED
|
@@ -67,6 +67,11 @@ class Submit extends EasCommand_1.default {
|
|
|
67
67
|
default: false,
|
|
68
68
|
description: 'Run command in non-interactive mode',
|
|
69
69
|
}),
|
|
70
|
+
'auto-testflight-setup': core_1.Flags.boolean({
|
|
71
|
+
default: true,
|
|
72
|
+
allowNo: true,
|
|
73
|
+
description: 'Set up an internal TestFlight group for the app (iOS only)',
|
|
74
|
+
}),
|
|
70
75
|
};
|
|
71
76
|
static contextDefinition = {
|
|
72
77
|
...this.ContextOptions.LoggedIn,
|
|
@@ -101,6 +106,7 @@ class Submit extends EasCommand_1.default {
|
|
|
101
106
|
profile: submissionProfile.profile,
|
|
102
107
|
archiveFlags: flagsWithPlatform.archiveFlags,
|
|
103
108
|
nonInteractive: flagsWithPlatform.nonInteractive,
|
|
109
|
+
autoTestFlightSetup: flagsWithPlatform.autoTestFlightSetup,
|
|
104
110
|
isVerboseFastlaneEnabled: flagsWithPlatform.isVerboseFastlaneEnabled,
|
|
105
111
|
groups: flagsWithPlatform.groups,
|
|
106
112
|
actor,
|
|
@@ -130,7 +136,7 @@ class Submit extends EasCommand_1.default {
|
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
sanitizeFlags(flags) {
|
|
133
|
-
const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'verbose-fastlane': isVerboseFastlaneEnabled, groups, 'what-to-test': whatToTest, ...archiveFlags } = flags;
|
|
139
|
+
const { platform, verbose, wait, profile, 'non-interactive': nonInteractive, 'auto-testflight-setup': autoTestFlightSetup, 'verbose-fastlane': isVerboseFastlaneEnabled, groups, 'what-to-test': whatToTest, ...archiveFlags } = flags;
|
|
134
140
|
if (!flags.platform && nonInteractive) {
|
|
135
141
|
core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
|
|
136
142
|
}
|
|
@@ -145,6 +151,7 @@ class Submit extends EasCommand_1.default {
|
|
|
145
151
|
wait,
|
|
146
152
|
profile,
|
|
147
153
|
nonInteractive,
|
|
154
|
+
autoTestFlightSetup,
|
|
148
155
|
whatToTest,
|
|
149
156
|
isVerboseFastlaneEnabled,
|
|
150
157
|
groups,
|
|
@@ -453,7 +453,7 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
453
453
|
}
|
|
454
454
|
log_1.default.addNewLineIfNone();
|
|
455
455
|
for (const runtime of (0, uniqBy_1.default)(runtimeToPlatformsAndFingerprintInfoMapping, version => version.runtimeVersion)) {
|
|
456
|
-
const newUpdatesForRuntimeVersion = newUpdates.filter(update => update.
|
|
456
|
+
const newUpdatesForRuntimeVersion = newUpdates.filter(update => update.runtime.version === runtime.runtimeVersion);
|
|
457
457
|
if (newUpdatesForRuntimeVersion.length === 0) {
|
|
458
458
|
throw new Error(`Publish response is missing updates with runtime ${runtime.runtimeVersion}.`);
|
|
459
459
|
}
|
|
@@ -193,7 +193,7 @@ class UpdateRevertUpdateRollout extends EasCommand_1.default {
|
|
|
193
193
|
rolloutUpdateGroup,
|
|
194
194
|
});
|
|
195
195
|
const platforms = rolloutUpdateGroup.map(update => update.platform);
|
|
196
|
-
const runtimeVersion = rolloutUpdateGroup[0].
|
|
196
|
+
const runtimeVersion = rolloutUpdateGroup[0].runtime.version;
|
|
197
197
|
const targetBranch = {
|
|
198
198
|
name: rolloutUpdateGroup[0].branchName,
|
|
199
199
|
id: rolloutUpdateGroup[0].branchId,
|
|
@@ -115,7 +115,7 @@ async function getSourceUpdateGroupAsync(graphqlClient, groupId) {
|
|
|
115
115
|
return {
|
|
116
116
|
groupId,
|
|
117
117
|
branchName: arbitraryUpdate.branch.name,
|
|
118
|
-
runtimeVersion: arbitraryUpdate.
|
|
118
|
+
runtimeVersion: arbitraryUpdate.runtime.version,
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
async function getPreviousUpdateGroupAsync(graphqlClient, projectId, sourceGroup) {
|
|
@@ -38,18 +38,22 @@ exports.AppleDeviceQuery = {
|
|
|
38
38
|
account {
|
|
39
39
|
byName(accountName: $accountName) {
|
|
40
40
|
id
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
appleTeamsPaginated(first: 1, filter: { appleTeamIdentifier: $appleTeamIdentifier }) {
|
|
42
|
+
edges {
|
|
43
|
+
node {
|
|
44
|
+
id
|
|
45
|
+
appleTeamIdentifier
|
|
46
|
+
appleTeamName
|
|
47
|
+
appleDevices(offset: $offset, limit: $limit) {
|
|
48
|
+
id
|
|
49
|
+
identifier
|
|
50
|
+
name
|
|
51
|
+
deviceClass
|
|
52
|
+
enabled
|
|
53
|
+
model
|
|
54
|
+
createdAt
|
|
55
|
+
}
|
|
56
|
+
}
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
}
|
|
@@ -59,7 +63,10 @@ exports.AppleDeviceQuery = {
|
|
|
59
63
|
additionalTypenames: ['AppleDevice', 'AppleTeam'],
|
|
60
64
|
})
|
|
61
65
|
.toPromise());
|
|
62
|
-
const
|
|
66
|
+
const appleTeam = data.account.byName.appleTeamsPaginated.edges[0]?.node;
|
|
67
|
+
if (!appleTeam) {
|
|
68
|
+
throw new Error(`Could not find Apple team with the identifier ${appleTeamIdentifier} on account ${accountName}`);
|
|
69
|
+
}
|
|
63
70
|
const { appleDevices } = appleTeam;
|
|
64
71
|
if (!appleDevices) {
|
|
65
72
|
throw new Error(`Could not find devices on Apple team -- ${(0, AppleTeamFormatting_1.formatAppleTeam)(appleTeam)}`);
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../../../../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
-
import {
|
|
2
|
+
import { AppleTeamFilterInput, AppleTeamFragment } from '../../../../../graphql/generated';
|
|
3
|
+
import { Connection } from '../../../../../utils/relay';
|
|
3
4
|
export declare const AppleTeamQuery: {
|
|
4
|
-
getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, { accountName, offset, limit }:
|
|
5
|
+
getAllForAccountAsync(graphqlClient: ExpoGraphqlClient, { accountName, offset, limit, }: {
|
|
6
|
+
accountName: string;
|
|
7
|
+
offset?: number | null;
|
|
8
|
+
limit?: number | null;
|
|
9
|
+
}): Promise<AppleTeamFragment[]>;
|
|
10
|
+
getAllForAccountPaginatedAsync(graphqlClient: ExpoGraphqlClient, accountName: string, { after, first, before, last, filter, }: {
|
|
11
|
+
after?: string;
|
|
12
|
+
first?: number;
|
|
13
|
+
before?: string;
|
|
14
|
+
last?: number;
|
|
15
|
+
filter?: AppleTeamFilterInput;
|
|
16
|
+
}): Promise<Connection<AppleTeamFragment>>;
|
|
5
17
|
getByAppleTeamIdentifierAsync(graphqlClient: ExpoGraphqlClient, accountId: string, appleTeamIdentifier: string): Promise<AppleTeamFragment | null>;
|
|
6
18
|
};
|
|
@@ -7,26 +7,66 @@ const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
|
7
7
|
const client_1 = require("../../../../../graphql/client");
|
|
8
8
|
const AppleTeam_1 = require("../../../../../graphql/types/credentials/AppleTeam");
|
|
9
9
|
exports.AppleTeamQuery = {
|
|
10
|
-
async getAllForAccountAsync(graphqlClient, { accountName, offset, limit }) {
|
|
10
|
+
async getAllForAccountAsync(graphqlClient, { accountName, offset, limit, }) {
|
|
11
|
+
// appleTeamsPaginated is cursor-based, so emulate offset/limit by fetching
|
|
12
|
+
// pages from the start until enough nodes are collected
|
|
13
|
+
const start = offset ?? 0;
|
|
14
|
+
const teams = [];
|
|
15
|
+
let after;
|
|
16
|
+
while (limit == null || teams.length < start + limit) {
|
|
17
|
+
const connection = await exports.AppleTeamQuery.getAllForAccountPaginatedAsync(graphqlClient, accountName, { first: 100, after });
|
|
18
|
+
teams.push(...connection.edges.map(edge => edge.node));
|
|
19
|
+
if (!connection.pageInfo.hasNextPage) {
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
after = connection.pageInfo.endCursor ?? undefined;
|
|
23
|
+
}
|
|
24
|
+
return limit == null ? teams.slice(start) : teams.slice(start, start + limit);
|
|
25
|
+
},
|
|
26
|
+
async getAllForAccountPaginatedAsync(graphqlClient, accountName, { after, first, before, last, filter, }) {
|
|
11
27
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
12
28
|
.query((0, graphql_tag_1.default) `
|
|
13
|
-
query
|
|
29
|
+
query AppleTeamsPaginatedByAccountQuery(
|
|
30
|
+
$accountName: String!
|
|
31
|
+
$after: String
|
|
32
|
+
$first: Int
|
|
33
|
+
$before: String
|
|
34
|
+
$last: Int
|
|
35
|
+
$filter: AppleTeamFilterInput
|
|
36
|
+
) {
|
|
14
37
|
account {
|
|
15
38
|
byName(accountName: $accountName) {
|
|
16
39
|
id
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
40
|
+
appleTeamsPaginated(
|
|
41
|
+
after: $after
|
|
42
|
+
first: $first
|
|
43
|
+
before: $before
|
|
44
|
+
last: $last
|
|
45
|
+
filter: $filter
|
|
46
|
+
) {
|
|
47
|
+
edges {
|
|
48
|
+
cursor
|
|
49
|
+
node {
|
|
50
|
+
id
|
|
51
|
+
...AppleTeamFragment
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
pageInfo {
|
|
55
|
+
hasNextPage
|
|
56
|
+
hasPreviousPage
|
|
57
|
+
startCursor
|
|
58
|
+
endCursor
|
|
59
|
+
}
|
|
20
60
|
}
|
|
21
61
|
}
|
|
22
62
|
}
|
|
23
63
|
}
|
|
24
64
|
${(0, graphql_1.print)(AppleTeam_1.AppleTeamFragmentNode)}
|
|
25
|
-
`, { accountName,
|
|
65
|
+
`, { accountName, after, first, before, last, filter }, {
|
|
26
66
|
additionalTypenames: ['AppleTeam'],
|
|
27
67
|
})
|
|
28
68
|
.toPromise());
|
|
29
|
-
return data.account.byName.
|
|
69
|
+
return data.account.byName.appleTeamsPaginated;
|
|
30
70
|
},
|
|
31
71
|
async getByAppleTeamIdentifierAsync(graphqlClient, accountId, appleTeamIdentifier) {
|
|
32
72
|
const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
@@ -3,4 +3,6 @@ import { App } from '@expo/apple-utils';
|
|
|
3
3
|
* Ensure a TestFlight internal group with access to all builds exists for the app and has all admin users invited to it.
|
|
4
4
|
* This allows users to instantly access their builds from TestFlight after it finishes processing.
|
|
5
5
|
*/
|
|
6
|
-
export declare function ensureTestFlightGroupExistsAsync(app: App
|
|
6
|
+
export declare function ensureTestFlightGroupExistsAsync(app: App, { nonInteractive }?: {
|
|
7
|
+
nonInteractive?: boolean;
|
|
8
|
+
}): Promise<void>;
|