eas-cli 0.32.0 → 0.34.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.
- package/README.md +29 -28
- package/build/analytics.js +3 -9
- package/build/build/android/UpdatesModule.js +4 -15
- package/build/build/android/configure.js +3 -3
- package/build/build/android/graphql.js +2 -4
- package/build/build/android/prepareJob.js +4 -3
- package/build/build/build.js +2 -2
- package/build/build/configure.js +26 -13
- package/build/build/ios/UpdatesModule.js +6 -18
- package/build/build/ios/configure.js +1 -1
- package/build/build/ios/graphql.js +2 -23
- package/build/build/ios/prepareJob.js +4 -6
- package/build/build/metadata.js +5 -10
- package/build/build/utils/appJson.d.ts +1 -0
- package/build/build/utils/appJson.js +13 -4
- package/build/build/utils/devClient.d.ts +4 -4
- package/build/build/utils/devClient.js +16 -21
- package/build/build/utils/repository.js +10 -7
- package/build/build/validate.js +4 -4
- package/build/commandUtils/EasCommand.d.ts +1 -0
- package/build/commandUtils/EasCommand.js +21 -0
- package/build/commands/branch/create.js +3 -2
- package/build/commands/branch/delete.js +1 -1
- package/build/commands/branch/list.js +1 -1
- package/build/commands/branch/publish.js +20 -48
- package/build/commands/branch/view.js +1 -1
- package/build/commands/build/index.d.ts +1 -1
- package/build/commands/build/index.js +64 -49
- package/build/commands/channel/edit.js +1 -1
- package/build/commands/channel/list.js +1 -1
- package/build/commands/channel/view.js +1 -1
- package/build/commands/diagnostics.js +2 -2
- package/build/commands/project/info.js +1 -1
- package/build/commands/submit.js +15 -8
- package/build/commands/update/view.js +1 -1
- package/build/credentials/android/api/graphql/queries/GoogleServiceAccountKeyQuery.js +2 -0
- package/build/credentials/credentialsJson/update.js +5 -4
- package/build/credentials/ios/IosCredentialsProvider.js +1 -1
- package/build/credentials/ios/actions/CreateDistributionCertificate.js +1 -1
- package/build/credentials/ios/actions/CreatePushKey.js +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.d.ts +1 -1
- package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -7
- package/build/credentials/ios/actions/PushKeyUtils.d.ts +1 -1
- package/build/credentials/ios/actions/PushKeyUtils.js +5 -5
- package/build/credentials/ios/actions/SetupTargetBuildCredentials.js +1 -1
- package/build/credentials/ios/api/graphql/queries/AppQuery.js +3 -1
- package/build/credentials/ios/api/graphql/queries/AppleDeviceQuery.js +6 -2
- package/build/credentials/ios/api/graphql/queries/AppleDistributionCertificateQuery.js +7 -1
- package/build/credentials/ios/api/graphql/queries/AppleProvisioningProfileQuery.js +5 -1
- package/build/credentials/ios/api/graphql/queries/ApplePushKeyQuery.js +2 -0
- package/build/credentials/ios/api/graphql/queries/AppleTeamQuery.js +5 -1
- package/build/credentials/ios/utils/printCredentials.js +30 -1
- package/build/credentials/manager/Actions.d.ts +47 -0
- package/build/credentials/manager/Actions.js +48 -0
- package/build/credentials/manager/AndroidActions.d.ts +6 -0
- package/build/credentials/manager/AndroidActions.js +114 -0
- package/build/credentials/manager/IosActions.d.ts +6 -0
- package/build/credentials/manager/IosActions.js +110 -0
- package/build/credentials/manager/ManageAndroid.d.ts +1 -29
- package/build/credentials/manager/ManageAndroid.js +26 -159
- package/build/credentials/manager/ManageIos.d.ts +1 -29
- package/build/credentials/manager/ManageIos.js +28 -155
- package/build/graphql/client.d.ts +8 -2
- package/build/graphql/generated.d.ts +131 -143
- package/build/graphql/generated.js +44 -28
- package/build/graphql/queries/BuildQuery.js +4 -1
- package/build/graphql/queries/EnvironmentSecretsQuery.js +4 -2
- package/build/graphql/queries/ProjectQuery.js +3 -1
- package/build/graphql/queries/PublishQuery.js +4 -1
- package/build/graphql/queries/SubmissionQuery.js +5 -2
- package/build/graphql/queries/UserQuery.js +4 -1
- package/build/graphql/queries/WebhookQuery.js +6 -2
- package/build/graphql/types/credentials/AppStoreConnectApiKey.d.ts +1 -0
- package/build/graphql/types/credentials/AppStoreConnectApiKey.js +23 -0
- package/build/graphql/types/credentials/IosAppCredentials.js +6 -0
- package/build/log.d.ts +0 -2
- package/build/log.js +2 -12
- package/build/project/android/applicationId.d.ts +1 -1
- package/build/project/android/applicationId.js +7 -6
- package/build/project/ios/bundleIdentifier.d.ts +1 -1
- package/build/project/ios/bundleIdentifier.js +7 -6
- package/build/project/projectUtils.js +1 -1
- package/build/project/publish.js +2 -2
- package/build/project/workflow.js +2 -2
- package/build/submit/ArchiveSource.js +4 -4
- package/build/submit/ios/IosSubmitCommand.js +4 -0
- package/build/submit/ios/IosSubmitter.js +1 -1
- package/build/user/User.js +1 -0
- package/build/utils/easCli.d.ts +1 -0
- package/build/utils/easCli.js +5 -0
- package/build/utils/{expoCommand.d.ts → expoCli.d.ts} +0 -0
- package/build/utils/{expoCommand.js → expoCli.js} +0 -0
- package/build/utils/profiles.d.ts +11 -0
- package/build/utils/profiles.js +46 -0
- package/build/vcs/clients/git.d.ts +26 -0
- package/build/vcs/clients/git.js +184 -0
- package/build/vcs/clients/gitNoCommit.d.ts +7 -0
- package/build/vcs/clients/gitNoCommit.js +27 -0
- package/build/vcs/clients/noVcs.d.ts +6 -0
- package/build/vcs/clients/noVcs.js +19 -0
- package/build/vcs/git.d.ts +10 -17
- package/build/vcs/git.js +7 -175
- package/build/vcs/index.d.ts +2 -2
- package/build/vcs/index.js +15 -6
- package/build/vcs/local.d.ts +18 -5
- package/build/vcs/local.js +61 -32
- package/build/vcs/vcs.d.ts +2 -1
- package/build/vcs/vcs.js +8 -4
- package/oclif.manifest.json +1 -1
- package/package.json +9 -9
|
@@ -7,6 +7,8 @@ const eas_json_1 = require("@expo/eas-json");
|
|
|
7
7
|
const command_1 = require("@oclif/command");
|
|
8
8
|
const errors_1 = require("@oclif/errors");
|
|
9
9
|
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
10
|
+
const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
|
|
11
|
+
const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
|
|
10
12
|
const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
|
|
11
13
|
const build_1 = require("../../build/android/build");
|
|
12
14
|
const build_2 = require("../../build/build");
|
|
@@ -19,7 +21,7 @@ const repository_1 = require("../../build/utils/repository");
|
|
|
19
21
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
|
|
20
22
|
const generated_1 = require("../../graphql/generated");
|
|
21
23
|
const AppPlatform_1 = require("../../graphql/types/AppPlatform");
|
|
22
|
-
const log_1 = (0, tslib_1.
|
|
24
|
+
const log_1 = (0, tslib_1.__importStar)(require("../../log"));
|
|
23
25
|
const platform_1 = require("../../platform");
|
|
24
26
|
const isEasEnabledForProject_1 = require("../../project/isEasEnabledForProject");
|
|
25
27
|
const metroConfig_1 = require("../../project/metroConfig");
|
|
@@ -28,8 +30,11 @@ const prompts_1 = require("../../prompts");
|
|
|
28
30
|
const context_2 = require("../../submit/context");
|
|
29
31
|
const submit_1 = require("../../submit/submit");
|
|
30
32
|
const urls_1 = require("../../submit/utils/urls");
|
|
33
|
+
const easCli_1 = require("../../utils/easCli");
|
|
31
34
|
const json_1 = require("../../utils/json");
|
|
32
|
-
const
|
|
35
|
+
const profiles_1 = require("../../utils/profiles");
|
|
36
|
+
const vcs_1 = require("../../vcs");
|
|
37
|
+
const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
|
|
33
38
|
class Build extends EasCommand_1.default {
|
|
34
39
|
constructor() {
|
|
35
40
|
super(...arguments);
|
|
@@ -45,45 +50,53 @@ class Build extends EasCommand_1.default {
|
|
|
45
50
|
const { requestedPlatform } = flags;
|
|
46
51
|
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
47
52
|
await handleDeprecatedEasJsonAsync(projectDir, flags.nonInteractive);
|
|
48
|
-
await vcs_1.
|
|
53
|
+
await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
|
|
49
54
|
await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
|
|
50
55
|
await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, requestedPlatform);
|
|
51
56
|
const platforms = (0, platform_1.toPlatforms)(requestedPlatform);
|
|
52
|
-
|
|
57
|
+
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
58
|
+
const buildProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
53
59
|
platforms,
|
|
60
|
+
profileName: flags.profile,
|
|
61
|
+
async readProfileAsync(platform, profileName) {
|
|
62
|
+
return await easJsonReader.readBuildProfileAsync(platform, profileName);
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
|
|
54
66
|
projectDir,
|
|
55
|
-
profile: flags.profile,
|
|
56
67
|
nonInteractive: flags.nonInteractive,
|
|
68
|
+
buildProfiles,
|
|
57
69
|
});
|
|
58
70
|
const startedBuilds = [];
|
|
59
71
|
const buildCtxByPlatform = {};
|
|
60
|
-
for (const
|
|
72
|
+
for (const buildProfile of buildProfiles) {
|
|
61
73
|
const { build: maybeBuild, buildCtx } = await this.prepareAndStartBuildAsync({
|
|
62
74
|
projectDir,
|
|
63
|
-
platform,
|
|
64
75
|
flags,
|
|
65
76
|
moreBuilds: platforms.length > 1,
|
|
77
|
+
buildProfile,
|
|
66
78
|
});
|
|
67
79
|
if (maybeBuild) {
|
|
68
|
-
startedBuilds.push(maybeBuild);
|
|
80
|
+
startedBuilds.push({ build: maybeBuild, buildProfile });
|
|
69
81
|
}
|
|
70
|
-
buildCtxByPlatform[(0, AppPlatform_1.toAppPlatform)(platform)] = buildCtx;
|
|
82
|
+
buildCtxByPlatform[(0, AppPlatform_1.toAppPlatform)(buildProfile.platform)] = buildCtx;
|
|
71
83
|
}
|
|
72
84
|
if (flags.local) {
|
|
73
85
|
return;
|
|
74
86
|
}
|
|
75
87
|
log_1.default.newLine();
|
|
76
|
-
(0, printBuildInfo_1.printLogsUrls)(startedBuilds);
|
|
88
|
+
(0, printBuildInfo_1.printLogsUrls)(startedBuilds.map(startedBuild => startedBuild.build));
|
|
77
89
|
log_1.default.newLine();
|
|
78
90
|
const submissions = [];
|
|
79
91
|
if (flags.autoSubmit) {
|
|
80
|
-
for (const
|
|
92
|
+
for (const startedBuild of startedBuilds) {
|
|
81
93
|
const submission = await this.prepareAndStartSubmissionAsync({
|
|
82
|
-
build,
|
|
83
|
-
credentialsCtx: (0, nullthrows_1.default)((_a = buildCtxByPlatform[build.platform]) === null || _a === void 0 ? void 0 : _a.credentialsCtx),
|
|
94
|
+
build: startedBuild.build,
|
|
95
|
+
credentialsCtx: (0, nullthrows_1.default)((_a = buildCtxByPlatform[startedBuild.build.platform]) === null || _a === void 0 ? void 0 : _a.credentialsCtx),
|
|
84
96
|
flags,
|
|
85
97
|
moreBuilds: startedBuilds.length > 1,
|
|
86
98
|
projectDir,
|
|
99
|
+
buildProfile: startedBuild.buildProfile,
|
|
87
100
|
});
|
|
88
101
|
submissions.push(submission);
|
|
89
102
|
}
|
|
@@ -94,7 +107,7 @@ class Build extends EasCommand_1.default {
|
|
|
94
107
|
if (!flags.wait) {
|
|
95
108
|
return;
|
|
96
109
|
}
|
|
97
|
-
const builds = await (0, build_2.waitForBuildEndAsync)(startedBuilds.map(build => build.id));
|
|
110
|
+
const builds = await (0, build_2.waitForBuildEndAsync)(startedBuilds.map(({ build }) => build.id));
|
|
98
111
|
(0, printBuildInfo_1.printBuildResults)(builds, flags.json);
|
|
99
112
|
const haveAllBuildsFailedOrCanceled = builds.every(build => (build === null || build === void 0 ? void 0 : build.status) && [generated_1.BuildStatus.Errored, generated_1.BuildStatus.Canceled].includes(build === null || build === void 0 ? void 0 : build.status));
|
|
100
113
|
if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
|
|
@@ -135,7 +148,7 @@ class Build extends EasCommand_1.default {
|
|
|
135
148
|
return {
|
|
136
149
|
requestedPlatform,
|
|
137
150
|
skipProjectConfiguration: flags['skip-project-configuration'],
|
|
138
|
-
profile,
|
|
151
|
+
profile: profile !== null && profile !== void 0 ? profile : null,
|
|
139
152
|
nonInteractive,
|
|
140
153
|
local: flags['local'],
|
|
141
154
|
wait: flags['wait'],
|
|
@@ -145,22 +158,20 @@ class Build extends EasCommand_1.default {
|
|
|
145
158
|
submitProfile: (_a = flags['auto-submit-with-profile']) !== null && _a !== void 0 ? _a : profile,
|
|
146
159
|
};
|
|
147
160
|
}
|
|
148
|
-
async prepareAndStartBuildAsync({ projectDir,
|
|
149
|
-
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
150
|
-
const buildProfile = await easJsonReader.readBuildProfileAsync(platform, flags.profile);
|
|
161
|
+
async prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, }) {
|
|
151
162
|
const buildCtx = await (0, context_1.createBuildContextAsync)({
|
|
152
|
-
buildProfileName:
|
|
163
|
+
buildProfileName: buildProfile.profileName,
|
|
153
164
|
clearCache: flags.clearCache,
|
|
154
|
-
buildProfile,
|
|
165
|
+
buildProfile: buildProfile.profile,
|
|
155
166
|
local: flags.local,
|
|
156
167
|
nonInteractive: flags.nonInteractive,
|
|
157
|
-
platform,
|
|
168
|
+
platform: buildProfile.platform,
|
|
158
169
|
projectDir,
|
|
159
170
|
skipProjectConfiguration: flags.skipProjectConfiguration,
|
|
160
171
|
});
|
|
161
172
|
if (moreBuilds) {
|
|
162
173
|
log_1.default.newLine();
|
|
163
|
-
const appPlatform = (0, AppPlatform_1.toAppPlatform)(platform);
|
|
174
|
+
const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
|
|
164
175
|
log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
|
|
165
176
|
}
|
|
166
177
|
if (buildCtx.workflow === eas_build_job_1.Workflow.MANAGED && !this.metroConfigValidated) {
|
|
@@ -186,10 +197,9 @@ class Build extends EasCommand_1.default {
|
|
|
186
197
|
}
|
|
187
198
|
return await sendBuildRequestAsync();
|
|
188
199
|
}
|
|
189
|
-
async prepareAndStartSubmissionAsync({ build, credentialsCtx, flags, moreBuilds, projectDir, }) {
|
|
200
|
+
async prepareAndStartSubmissionAsync({ build, credentialsCtx, flags, moreBuilds, projectDir, buildProfile, }) {
|
|
190
201
|
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
191
202
|
const platform = (0, AppPlatform_1.toPlatform)(build.platform);
|
|
192
|
-
const buildProfile = await easJsonReader.readBuildProfileAsync(platform, flags.profile);
|
|
193
203
|
const submitProfile = await easJsonReader.readSubmitProfileAsync(platform, flags.submitProfile);
|
|
194
204
|
const submissionCtx = await (0, context_2.createSubmissionContextAsync)({
|
|
195
205
|
platform,
|
|
@@ -198,7 +208,7 @@ class Build extends EasCommand_1.default {
|
|
|
198
208
|
profile: submitProfile,
|
|
199
209
|
archiveFlags: { id: build.id },
|
|
200
210
|
nonInteractive: flags.nonInteractive,
|
|
201
|
-
env: buildProfile.env,
|
|
211
|
+
env: buildProfile.profile.env,
|
|
202
212
|
credentialsCtx,
|
|
203
213
|
});
|
|
204
214
|
if (moreBuilds) {
|
|
@@ -234,8 +244,7 @@ Build.flags = {
|
|
|
234
244
|
description: 'Skip project configuration',
|
|
235
245
|
}),
|
|
236
246
|
profile: command_1.flags.string({
|
|
237
|
-
|
|
238
|
-
description: 'Name of the build profile from eas.json',
|
|
247
|
+
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
239
248
|
helpValue: 'PROFILE_NAME',
|
|
240
249
|
}),
|
|
241
250
|
'non-interactive': command_1.flags.boolean({
|
|
@@ -267,28 +276,34 @@ Build.flags = {
|
|
|
267
276
|
}),
|
|
268
277
|
};
|
|
269
278
|
async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
|
|
270
|
-
if (await (
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
279
|
+
if (!(await fs_extra_1.default.pathExists(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir)))) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
283
|
+
const rawEasJson = await easJsonReader.readRawAsync();
|
|
284
|
+
if (rawEasJson === null || rawEasJson === void 0 ? void 0 : rawEasJson.cli) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
if (nonInteractive) {
|
|
288
|
+
log_1.default.warn(`${figures_1.default.warning} Action required: the default behavior of EAS CLI has changed and your eas.json must be updated to remove ambiguity around which Git integration workflow to use. Refer to ${(0, log_1.link)('https://expo.fyi/eas-vcs-workflow')} for more information.`);
|
|
289
|
+
log_1.default.warn('This warning will become an error in an upcoming EAS CLI release. For now, we will proceed with the old default behavior to avoid disruption of your builds.');
|
|
290
|
+
(0, vcs_1.setVcsClient)(new git_1.default());
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
log_1.default.log(`${chalk_1.default.bold('eas-cli@>=0.34.0 no longer requires that you commit changes to Git before starting a build.')} ${(0, log_1.learnMore)('https://expo.fyi/eas-vcs-workflow')}`);
|
|
294
|
+
log_1.default.log(`If you want to continue using the Git integration, you can opt in with ${chalk_1.default.bold('cli.requireCommit')} in ${chalk_1.default.bold('eas.json')} or with the following prompt.`);
|
|
295
|
+
log_1.default.newLine();
|
|
296
|
+
const mode = await (0, prompts_1.selectAsync)('Select your preferred Git integration', [
|
|
297
|
+
{ title: 'Require changes to be committed in Git (old default)', value: 'requireCommit' },
|
|
298
|
+
{ title: 'Allow builds with dirty Git working tree (new default)', value: 'noCommit' },
|
|
299
|
+
]);
|
|
300
|
+
rawEasJson.cli =
|
|
301
|
+
mode === 'requireCommit'
|
|
302
|
+
? { version: `>= ${easCli_1.easCliVersion}`, requireCommit: true }
|
|
303
|
+
: { version: `>= ${easCli_1.easCliVersion}` };
|
|
304
|
+
await fs_extra_1.default.writeJSON(eas_json_1.EasJsonReader.formatEasJsonPath(projectDir), rawEasJson, { spaces: 2 });
|
|
305
|
+
if (mode === 'requireCommit') {
|
|
306
|
+
(0, vcs_1.setVcsClient)(new git_1.default());
|
|
292
307
|
}
|
|
293
308
|
}
|
|
294
309
|
exports.handleDeprecatedEasJsonAsync = handleDeprecatedEasJsonAsync;
|
|
@@ -30,7 +30,7 @@ async function getChannelByNameForAppAsync({ appId, channelName, }) {
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
`, { appId, channelName })
|
|
33
|
+
`, { appId, channelName }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch'] })
|
|
34
34
|
.toPromise());
|
|
35
35
|
const updateChannelByNameResult = (_a = data.app) === null || _a === void 0 ? void 0 : _a.byId.updateChannelByName;
|
|
36
36
|
if (!updateChannelByNameResult) {
|
|
@@ -47,7 +47,7 @@ async function getAllUpdateChannelForAppAsync({ appId, }) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
`, { appId, offset: 0, limit: CHANNEL_LIMIT })
|
|
50
|
+
`, { appId, offset: 0, limit: CHANNEL_LIMIT }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] })
|
|
51
51
|
.toPromise());
|
|
52
52
|
}
|
|
53
53
|
class ChannelList extends EasCommand_1.default {
|
|
@@ -101,7 +101,7 @@ async function getUpdateChannelByNameForAppAsync({ appId, channelName, }) {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
`, { appId, channelName })
|
|
104
|
+
`, { appId, channelName }, { additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] })
|
|
105
105
|
.toPromise());
|
|
106
106
|
}
|
|
107
107
|
exports.getUpdateChannelByNameForAppAsync = getUpdateChannelByNameForAppAsync;
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const envinfo_1 = (0, tslib_1.__importDefault)(require("envinfo"));
|
|
5
5
|
const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCommand"));
|
|
6
6
|
const log_1 = (0, tslib_1.__importDefault)(require("../log"));
|
|
7
|
-
const
|
|
7
|
+
const easCli_1 = require("../utils/easCli");
|
|
8
8
|
class Diagnostics extends EasCommand_1.default {
|
|
9
9
|
constructor() {
|
|
10
10
|
super(...arguments);
|
|
@@ -28,7 +28,7 @@ class Diagnostics extends EasCommand_1.default {
|
|
|
28
28
|
],
|
|
29
29
|
npmGlobalPackages: ['eas-cli', 'expo-cli'],
|
|
30
30
|
}, {
|
|
31
|
-
title: `EAS CLI ${
|
|
31
|
+
title: `EAS CLI ${easCli_1.easCliVersion} environment info`,
|
|
32
32
|
});
|
|
33
33
|
log_1.default.log(info);
|
|
34
34
|
}
|
package/build/commands/submit.js
CHANGED
|
@@ -15,6 +15,7 @@ const projectUtils_1 = require("../project/projectUtils");
|
|
|
15
15
|
const context_1 = require("../submit/context");
|
|
16
16
|
const submit_1 = require("../submit/submit");
|
|
17
17
|
const urls_1 = require("../submit/utils/urls");
|
|
18
|
+
const profiles_1 = require("../utils/profiles");
|
|
18
19
|
class Submit extends EasCommand_1.default {
|
|
19
20
|
async runAsync() {
|
|
20
21
|
const { flags: rawFlags } = this.parse(Submit);
|
|
@@ -27,22 +28,28 @@ class Submit extends EasCommand_1.default {
|
|
|
27
28
|
process.exitCode = 1;
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
31
31
|
const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
|
|
32
|
+
const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
|
|
33
|
+
const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
34
|
+
platforms,
|
|
35
|
+
profileName: flags.profile,
|
|
36
|
+
async readProfileAsync(platform, profileName) {
|
|
37
|
+
return await easJsonReader.readSubmitProfileAsync(platform, profileName);
|
|
38
|
+
},
|
|
39
|
+
});
|
|
32
40
|
const submissions = [];
|
|
33
|
-
for (const
|
|
34
|
-
const profile = await easJsonReader.readSubmitProfileAsync(platform, flags.profile);
|
|
41
|
+
for (const submissionProfile of submissionProfiles) {
|
|
35
42
|
const ctx = await (0, context_1.createSubmissionContextAsync)({
|
|
36
|
-
platform,
|
|
43
|
+
platform: submissionProfile.platform,
|
|
37
44
|
projectDir,
|
|
38
45
|
projectId,
|
|
39
|
-
profile,
|
|
46
|
+
profile: submissionProfile.profile,
|
|
40
47
|
archiveFlags: flags.archiveFlags,
|
|
41
48
|
nonInteractive: flags.nonInteractive,
|
|
42
49
|
});
|
|
43
|
-
if (
|
|
50
|
+
if (submissionProfiles.length > 1) {
|
|
44
51
|
log_1.default.newLine();
|
|
45
|
-
const appPlatform = (0, AppPlatform_1.toAppPlatform)(platform);
|
|
52
|
+
const appPlatform = (0, AppPlatform_1.toAppPlatform)(submissionProfile.platform);
|
|
46
53
|
log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} submission`)}`);
|
|
47
54
|
}
|
|
48
55
|
const submission = await (0, submit_1.submitAsync)(ctx);
|
|
@@ -85,7 +92,7 @@ Submit.flags = {
|
|
|
85
92
|
options: ['android', 'ios', 'all'],
|
|
86
93
|
}),
|
|
87
94
|
profile: command_1.flags.string({
|
|
88
|
-
description: 'Name of the submit profile from eas.json. Defaults to "
|
|
95
|
+
description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
89
96
|
}),
|
|
90
97
|
latest: command_1.flags.boolean({
|
|
91
98
|
description: 'Submit the latest build for specified platform',
|
|
@@ -24,6 +24,8 @@ exports.GoogleServiceAccountKeyQuery = {
|
|
|
24
24
|
${(0, graphql_1.print)(GoogleServiceAccountKey_1.GoogleServiceAccountKeyFragmentNode)}
|
|
25
25
|
`, {
|
|
26
26
|
accountName,
|
|
27
|
+
}, {
|
|
28
|
+
additionalTypenames: ['GoogleServiceAccountKey'],
|
|
27
29
|
})
|
|
28
30
|
.toPromise());
|
|
29
31
|
return data.account.byName.googleServiceAccountKeys;
|
|
@@ -8,8 +8,8 @@ const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
|
8
8
|
const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
|
|
9
9
|
const target_1 = require("../../project/ios/target");
|
|
10
10
|
const zipObject_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/zipObject"));
|
|
11
|
-
const vcs_1 =
|
|
12
|
-
const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/git"));
|
|
11
|
+
const vcs_1 = require("../../vcs");
|
|
12
|
+
const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
|
|
13
13
|
const read_1 = require("./read");
|
|
14
14
|
const utils_1 = require("./utils");
|
|
15
15
|
/**
|
|
@@ -197,8 +197,9 @@ async function updateFileAsync(projectDir, filePath, base64Data) {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
async function isFileUntrackedAsync(path) {
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
const vcsClient = (0, vcs_1.getVcsClient)();
|
|
201
|
+
if (vcsClient instanceof git_1.default) {
|
|
202
|
+
return await vcsClient.isFileUntrackedAsync(path);
|
|
202
203
|
}
|
|
203
204
|
return false;
|
|
204
205
|
}
|
|
@@ -65,7 +65,7 @@ class IosCredentialsProvider {
|
|
|
65
65
|
return null;
|
|
66
66
|
}
|
|
67
67
|
const confirmSetup = await (0, prompts_1.confirmAsync)({
|
|
68
|
-
message: `Would you like to
|
|
68
|
+
message: `Would you like to set up Push Notifications for your project?`,
|
|
69
69
|
});
|
|
70
70
|
if (!confirmSetup) {
|
|
71
71
|
return null;
|
|
@@ -9,7 +9,7 @@ class CreateDistributionCertificate {
|
|
|
9
9
|
this.account = account;
|
|
10
10
|
}
|
|
11
11
|
async runAsync(ctx) {
|
|
12
|
-
const distCert = await (0, DistributionCertificateUtils_1.provideOrGenerateDistributionCertificateAsync)(ctx
|
|
12
|
+
const distCert = await (0, DistributionCertificateUtils_1.provideOrGenerateDistributionCertificateAsync)(ctx);
|
|
13
13
|
const result = await ctx.ios.createDistributionCertificateAsync(this.account, distCert);
|
|
14
14
|
log_1.default.succeed('Created distribution certificate');
|
|
15
15
|
return result;
|
|
@@ -12,7 +12,7 @@ class CreatePushKey {
|
|
|
12
12
|
if (ctx.nonInteractive) {
|
|
13
13
|
throw new Error(`A new push key cannot be created in non-interactive mode.`);
|
|
14
14
|
}
|
|
15
|
-
const pushKey = await (0, PushKeyUtils_1.provideOrGeneratePushKeyAsync)(ctx
|
|
15
|
+
const pushKey = await (0, PushKeyUtils_1.provideOrGeneratePushKeyAsync)(ctx);
|
|
16
16
|
const result = await ctx.ios.createPushKeyAsync(this.account, pushKey);
|
|
17
17
|
log_1.default.succeed('Created push key');
|
|
18
18
|
return result;
|
|
@@ -12,4 +12,4 @@ export declare function selectDistributionCertificateWithDependenciesAsync(ctx:
|
|
|
12
12
|
* select a distribution certificate from a valid set (curated on a best effort basis)
|
|
13
13
|
* */
|
|
14
14
|
export declare function selectValidDistributionCertificateAsync(ctx: CredentialsContext, appLookupParams: AppLookupParams): Promise<AppleDistributionCertificateFragment | null>;
|
|
15
|
-
export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext
|
|
15
|
+
export declare function provideOrGenerateDistributionCertificateAsync(ctx: CredentialsContext): Promise<DistributionCertificate>;
|
|
@@ -99,7 +99,7 @@ You can have only ${chalk_1.default.underline('three')} Apple Distribution Certi
|
|
|
99
99
|
Please revoke the old ones or reuse existing from your other apps.
|
|
100
100
|
Please remember that Apple Distribution Certificates are not application specific!
|
|
101
101
|
`;
|
|
102
|
-
async function provideOrGenerateDistributionCertificateAsync(ctx
|
|
102
|
+
async function provideOrGenerateDistributionCertificateAsync(ctx) {
|
|
103
103
|
if (!ctx.nonInteractive) {
|
|
104
104
|
const userProvided = await promptForDistCertAsync(ctx);
|
|
105
105
|
if (userProvided) {
|
|
@@ -112,13 +112,11 @@ async function provideOrGenerateDistributionCertificateAsync(ctx, accountName) {
|
|
|
112
112
|
if (!isValid) {
|
|
113
113
|
log_1.default.warn("Provided Distribution Certificate is no longer valid on Apple's server");
|
|
114
114
|
}
|
|
115
|
-
return isValid
|
|
116
|
-
? userProvided
|
|
117
|
-
: await provideOrGenerateDistributionCertificateAsync(ctx, accountName);
|
|
115
|
+
return isValid ? userProvided : await provideOrGenerateDistributionCertificateAsync(ctx);
|
|
118
116
|
}
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
|
-
return await generateDistributionCertificateAsync(ctx
|
|
119
|
+
return await generateDistributionCertificateAsync(ctx);
|
|
122
120
|
}
|
|
123
121
|
exports.provideOrGenerateDistributionCertificateAsync = provideOrGenerateDistributionCertificateAsync;
|
|
124
122
|
async function promptForDistCertAsync(ctx) {
|
|
@@ -140,7 +138,7 @@ async function promptForDistCertAsync(ctx) {
|
|
|
140
138
|
}
|
|
141
139
|
return userProvided;
|
|
142
140
|
}
|
|
143
|
-
async function generateDistributionCertificateAsync(ctx
|
|
141
|
+
async function generateDistributionCertificateAsync(ctx) {
|
|
144
142
|
await ctx.appStore.ensureAuthenticatedAsync();
|
|
145
143
|
try {
|
|
146
144
|
return await ctx.appStore.createDistributionCertificateAsync();
|
|
@@ -176,7 +174,7 @@ async function generateDistributionCertificateAsync(ctx, accountName) {
|
|
|
176
174
|
throw e;
|
|
177
175
|
}
|
|
178
176
|
}
|
|
179
|
-
return await generateDistributionCertificateAsync(ctx
|
|
177
|
+
return await generateDistributionCertificateAsync(ctx);
|
|
180
178
|
}
|
|
181
179
|
function formatDistributionCertificateFromApple(appleInfo) {
|
|
182
180
|
const { name, status, id, expires, created, ownerName, serialNumber } = appleInfo;
|
|
@@ -2,7 +2,7 @@ import { ApplePushKeyFragment } from '../../../graphql/generated';
|
|
|
2
2
|
import { Account } from '../../../user/Account';
|
|
3
3
|
import { CredentialsContext } from '../../context';
|
|
4
4
|
import { PushKey } from '../appstore/Credentials.types';
|
|
5
|
-
export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext
|
|
5
|
+
export declare function provideOrGeneratePushKeyAsync(ctx: CredentialsContext): Promise<PushKey>;
|
|
6
6
|
/**
|
|
7
7
|
* select a push key from an account (validity status shown on a best effort basis)
|
|
8
8
|
* */
|
|
@@ -12,7 +12,7 @@ const pushKey_1 = require("../appstore/pushKey");
|
|
|
12
12
|
const credentials_1 = require("../credentials");
|
|
13
13
|
const validatePushKey_1 = require("../validators/validatePushKey");
|
|
14
14
|
const AppleTeamUtils_1 = require("./AppleTeamUtils");
|
|
15
|
-
async function provideOrGeneratePushKeyAsync(ctx
|
|
15
|
+
async function provideOrGeneratePushKeyAsync(ctx) {
|
|
16
16
|
if (!ctx.nonInteractive) {
|
|
17
17
|
const userProvided = await promptForPushKeyAsync(ctx);
|
|
18
18
|
if (userProvided) {
|
|
@@ -32,11 +32,11 @@ async function provideOrGeneratePushKeyAsync(ctx, accountName) {
|
|
|
32
32
|
if (useUserProvided) {
|
|
33
33
|
return userProvided;
|
|
34
34
|
}
|
|
35
|
-
return await provideOrGeneratePushKeyAsync(ctx
|
|
35
|
+
return await provideOrGeneratePushKeyAsync(ctx);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
return await generatePushKeyAsync(ctx
|
|
39
|
+
return await generatePushKeyAsync(ctx);
|
|
40
40
|
}
|
|
41
41
|
exports.provideOrGeneratePushKeyAsync = provideOrGeneratePushKeyAsync;
|
|
42
42
|
async function promptForPushKeyAsync(ctx) {
|
|
@@ -58,7 +58,7 @@ async function promptForPushKeyAsync(ctx) {
|
|
|
58
58
|
}
|
|
59
59
|
return userProvided;
|
|
60
60
|
}
|
|
61
|
-
async function generatePushKeyAsync(ctx
|
|
61
|
+
async function generatePushKeyAsync(ctx) {
|
|
62
62
|
await ctx.appStore.ensureAuthenticatedAsync();
|
|
63
63
|
try {
|
|
64
64
|
return await ctx.appStore.createPushKeyAsync();
|
|
@@ -94,7 +94,7 @@ async function generatePushKeyAsync(ctx, accountName) {
|
|
|
94
94
|
throw e;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
return await generatePushKeyAsync(ctx
|
|
97
|
+
return await generatePushKeyAsync(ctx);
|
|
98
98
|
}
|
|
99
99
|
function formatPushKeyFromApple(pushKey) {
|
|
100
100
|
const { name, id } = pushKey;
|
|
@@ -20,7 +20,9 @@ exports.AppQuery = {
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
${(0, graphql_1.print)(App_1.AppFragmentNode)}
|
|
23
|
-
`, { fullName }
|
|
23
|
+
`, { fullName }, {
|
|
24
|
+
additionalTypenames: ['App'],
|
|
25
|
+
})
|
|
24
26
|
.toPromise());
|
|
25
27
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
26
28
|
return data.app.byFullName;
|
|
@@ -68,7 +68,9 @@ exports.AppleDeviceQuery = {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`, { accountName, appleTeamIdentifier }
|
|
71
|
+
`, { accountName, appleTeamIdentifier }, {
|
|
72
|
+
additionalTypenames: ['AppleDevice', 'AppleTeam'],
|
|
73
|
+
})
|
|
72
74
|
.toPromise());
|
|
73
75
|
return data.account.byName.appleTeams[0];
|
|
74
76
|
},
|
|
@@ -95,7 +97,9 @@ exports.AppleDeviceQuery = {
|
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
`, { accountName, identifier }
|
|
100
|
+
`, { accountName, identifier }, {
|
|
101
|
+
additionalTypenames: ['AppleDevice', 'AppleTeam'],
|
|
102
|
+
})
|
|
99
103
|
.toPromise());
|
|
100
104
|
return (_a = data.account.byName.appleDevices[0]) !== null && _a !== void 0 ? _a : null;
|
|
101
105
|
},
|
|
@@ -47,7 +47,11 @@ exports.AppleDistributionCertificateQuery = {
|
|
|
47
47
|
appleAppIdentifierId,
|
|
48
48
|
iosDistributionType,
|
|
49
49
|
}, {
|
|
50
|
-
additionalTypenames: [
|
|
50
|
+
additionalTypenames: [
|
|
51
|
+
'AppleDistributionCertificate',
|
|
52
|
+
'IosAppCredentials',
|
|
53
|
+
'IosAppBuildCredentials',
|
|
54
|
+
],
|
|
51
55
|
})
|
|
52
56
|
.toPromise());
|
|
53
57
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
@@ -70,6 +74,8 @@ exports.AppleDistributionCertificateQuery = {
|
|
|
70
74
|
${(0, graphql_1.print)(AppleDistributionCertificate_1.AppleDistributionCertificateFragmentNode)}
|
|
71
75
|
`, {
|
|
72
76
|
accountName,
|
|
77
|
+
}, {
|
|
78
|
+
additionalTypenames: ['AppleDistributionCertificate'],
|
|
73
79
|
})
|
|
74
80
|
.toPromise());
|
|
75
81
|
return data.account.byName.appleDistributionCertificates;
|
|
@@ -59,7 +59,11 @@ exports.AppleProvisioningProfileQuery = {
|
|
|
59
59
|
appleAppIdentifierId,
|
|
60
60
|
iosDistributionType,
|
|
61
61
|
}, {
|
|
62
|
-
additionalTypenames: [
|
|
62
|
+
additionalTypenames: [
|
|
63
|
+
'AppleProvisioningProfile',
|
|
64
|
+
'IosAppCredentials',
|
|
65
|
+
'IosAppBuildCredentials',
|
|
66
|
+
],
|
|
63
67
|
})
|
|
64
68
|
.toPromise());
|
|
65
69
|
(0, assert_1.default)(data.app, 'GraphQL: `app` not defined in server response');
|
|
@@ -22,7 +22,9 @@ exports.AppleTeamQuery = {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
`, { accountName }
|
|
25
|
+
`, { accountName }, {
|
|
26
|
+
additionalTypenames: ['AppleTeam'],
|
|
27
|
+
})
|
|
26
28
|
.toPromise());
|
|
27
29
|
return data.account.byName.appleTeams;
|
|
28
30
|
},
|
|
@@ -42,6 +44,8 @@ exports.AppleTeamQuery = {
|
|
|
42
44
|
`, {
|
|
43
45
|
accountId,
|
|
44
46
|
appleTeamIdentifier,
|
|
47
|
+
}, {
|
|
48
|
+
additionalTypenames: ['AppleTeam'],
|
|
45
49
|
})
|
|
46
50
|
.toPromise());
|
|
47
51
|
return (_a = data.appleTeam.byAppleTeamIdentifier) !== null && _a !== void 0 ? _a : null;
|