eas-cli 0.38.1 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/README.md +31 -31
  2. package/build/build/android/configure.d.ts +3 -2
  3. package/build/build/configure.js +1 -1
  4. package/build/build/createContext.js +1 -1
  5. package/build/build/ios/configure.d.ts +3 -2
  6. package/build/build/ios/version.d.ts +1 -1
  7. package/build/build/ios/version.js +4 -1
  8. package/build/build/local.js +1 -1
  9. package/build/build/metadata.js +14 -0
  10. package/build/commandUtils/EasCommand.js +0 -2
  11. package/build/commands/branch/publish.d.ts +1 -18
  12. package/build/commands/branch/publish.js +2 -344
  13. package/build/commands/build/configure.js +1 -1
  14. package/build/commands/build/index.js +18 -11
  15. package/build/commands/channel/edit.js +1 -1
  16. package/build/commands/channel/view.js +3 -3
  17. package/build/commands/config.js +1 -1
  18. package/build/commands/credentials.js +1 -7
  19. package/build/commands/diagnostics.d.ts +1 -0
  20. package/build/commands/diagnostics.js +19 -1
  21. package/build/commands/submit.js +1 -1
  22. package/build/commands/update/configure.d.ts +8 -0
  23. package/build/commands/update/configure.js +76 -0
  24. package/build/commands/update/index.d.ts +20 -0
  25. package/build/commands/update/index.js +361 -0
  26. package/build/credentials/context.d.ts +5 -0
  27. package/build/credentials/context.js +12 -7
  28. package/build/credentials/ios/actions/AscApiKeyUtils.js +1 -1
  29. package/build/credentials/ios/appstore/ensureAppExists.js +3 -3
  30. package/build/credentials/manager/ManageAndroid.d.ts +3 -3
  31. package/build/credentials/manager/ManageAndroid.js +21 -13
  32. package/build/credentials/manager/ManageIos.d.ts +3 -3
  33. package/build/credentials/manager/ManageIos.js +23 -13
  34. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -3
  35. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +4 -7
  36. package/build/credentials/manager/SelectIosDistributionTypeGraphqlFromBuildProfile.d.ts +3 -2
  37. package/build/credentials/manager/SelectPlatform.d.ts +1 -2
  38. package/build/credentials/manager/SelectPlatform.js +3 -3
  39. package/build/project/ios/scheme.d.ts +3 -2
  40. package/build/project/ios/target.js +32 -7
  41. package/build/submit/context.js +0 -1
  42. package/build/submit/ios/AppProduce.js +3 -3
  43. package/build/submit/ios/IosSubmitCommand.js +1 -1
  44. package/build/submit/utils/wait.js +1 -1
  45. package/build/update/utils.js +1 -1
  46. package/build/utils/profiles.d.ts +2 -3
  47. package/build/utils/profiles.js +20 -7
  48. package/oclif.manifest.json +1 -1
  49. package/package.json +10 -9
@@ -1,354 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.defaultPublishPlatforms = void 0;
4
3
  const tslib_1 = require("tslib");
5
- const config_1 = require("@expo/config");
6
- const config_plugins_1 = require("@expo/config-plugins");
7
- const eas_build_job_1 = require("@expo/eas-build-job");
8
- const command_1 = require("@oclif/command");
9
- const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
10
- const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
11
- const dateformat_1 = (0, tslib_1.__importDefault)(require("dateformat"));
12
- const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
13
4
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
14
- const client_1 = require("../../graphql/client");
15
- const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
16
- const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
17
- const ora_1 = require("../../ora");
18
- const projectUtils_1 = require("../../project/projectUtils");
19
- const publish_1 = require("../../project/publish");
20
- const workflow_1 = require("../../project/workflow");
21
- const prompts_1 = require("../../prompts");
22
- const utils_1 = require("../../update/utils");
23
- const uniqBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/uniqBy"));
24
- const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
25
- const vcs_1 = require("../../vcs");
26
- const create_1 = require("../channel/create");
27
- const create_2 = require("./create");
28
- const list_1 = require("./list");
29
- const view_1 = require("./view");
30
- exports.defaultPublishPlatforms = ['android', 'ios'];
31
- async function getUpdateGroupAsync({ group, }) {
32
- const { updatesByGroup } = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
33
- .query((0, graphql_tag_1.default) `
34
- query getUpdateGroupAsync($group: ID!) {
35
- updatesByGroup(group: $group) {
36
- id
37
- group
38
- runtimeVersion
39
- manifestFragment
40
- platform
41
- message
42
- }
43
- }
44
- `, {
45
- group,
46
- }, { additionalTypenames: ['Update'] })
47
- .toPromise());
48
- return updatesByGroup;
49
- }
50
- async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
51
- var _a;
52
- try {
53
- await (0, create_1.createUpdateChannelOnAppAsync)({
54
- appId,
55
- channelName,
56
- branchId,
57
- });
58
- log_1.default.withTick(`Created a channel: ${chalk_1.default.bold(channelName)} pointed at branch: ${chalk_1.default.bold(channelName)}.`);
59
- }
60
- catch (e) {
61
- const isIgnorableError = ((_a = e.graphQLErrors) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
62
- e.graphQLErrors[0].extensions.errorCode === 'CHANNEL_ALREADY_EXISTS';
63
- if (!isIgnorableError) {
64
- throw e;
65
- }
66
- }
67
- }
68
- async function ensureBranchExistsAsync({ appId, name: branchName, }) {
69
- const { app } = await (0, view_1.viewUpdateBranchAsync)({
70
- appId,
71
- name: branchName,
72
- });
73
- const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
74
- if (updateBranch) {
75
- const { id, updates } = updateBranch;
76
- await ensureChannelExistsAsync({ appId, branchId: id, channelName: branchName });
77
- return { id, updates };
78
- }
79
- const newUpdateBranch = await (0, create_2.createUpdateBranchOnAppAsync)({ appId, name: branchName });
80
- log_1.default.withTick(`Created branch: ${chalk_1.default.bold(branchName)}`);
81
- await ensureChannelExistsAsync({ appId, branchId: newUpdateBranch.id, channelName: branchName });
82
- return { id: newUpdateBranch.id, updates: [] };
83
- }
84
5
  class BranchPublish extends EasCommand_1.default {
85
6
  async runAsync() {
86
- var _a, _b, _c;
87
- let { args: { name: branchName }, flags: { json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, }, } = this.parse(BranchPublish);
88
- const platformFlag = this.parse(BranchPublish).flags.platform;
89
- // If a group was specified, that means we are republishing it.
90
- republish = group ? true : republish;
91
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
92
- const { exp } = (0, config_1.getConfig)(projectDir, {
93
- skipSDKVersionRequirement: true,
94
- isPublicConfig: true,
95
- });
96
- const runtimeVersions = await getRuntimeVersionObjectAsync(exp, platformFlag, projectDir);
97
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
98
- if (!branchName && autoFlag) {
99
- branchName =
100
- (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
101
- `branch-${Math.random().toString(36).substr(2, 4)}`;
102
- }
103
- if (!branchName) {
104
- const validationMessage = 'branch name may not be empty.';
105
- if (jsonFlag) {
106
- throw new Error(validationMessage);
107
- }
108
- const branches = await (0, list_1.listBranchesAsync)({ projectId });
109
- branchName = await (0, prompts_1.selectAsync)('which branch would you like to publish on?', branches.map(branch => {
110
- return {
111
- title: `${branch.name} ${chalk_1.default.grey(`- current update: ${(0, utils_1.formatUpdate)(branch.updates[0])}`)}`,
112
- value: branch.name,
113
- };
114
- }));
115
- (0, assert_1.default)(branchName, 'branch name must be specified.');
116
- }
117
- const { id: branchId, updates } = await ensureBranchExistsAsync({
118
- appId: projectId,
119
- name: branchName,
120
- });
121
- let unsortedUpdateInfoGroups = {};
122
- let oldMessage, oldRuntimeVersion;
123
- if (republish) {
124
- // If we are republishing, we don't need to worry about building the bundle or uploading the assets.
125
- // Instead we get the `updateInfoGroup` from the update we wish to republish.
126
- let updatesToRepublish;
127
- if (group) {
128
- updatesToRepublish = await getUpdateGroupAsync({ group });
129
- }
130
- else {
131
- // Drop into interactive mode if the user has not specified an update group to republish.
132
- if (jsonFlag) {
133
- throw new Error('You must specify the update group to republish.');
134
- }
135
- const updateGroups = (0, uniqBy_1.default)(updates, u => u.group)
136
- .filter(update => {
137
- // Only show groups that have updates on the specified platform(s).
138
- return platformFlag === 'all' || update.platform === platformFlag;
139
- })
140
- .map(update => ({
141
- title: formatUpdateTitle(update),
142
- value: update.group,
143
- }));
144
- if (updateGroups.length === 0) {
145
- throw new Error(`There are no updates on branch "${branchName}" published on the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`);
146
- }
147
- const selectedUpdateGroup = await (0, prompts_1.selectAsync)('which update would you like to republish?', updateGroups);
148
- updatesToRepublish = updates.filter(update => update.group === selectedUpdateGroup);
149
- }
150
- const updatesToRepublishFilteredByPlatform = updatesToRepublish.filter(
151
- // Only republish to the specified platforms
152
- update => platformFlag === 'all' || update.platform === platformFlag);
153
- if (updatesToRepublishFilteredByPlatform.length === 0) {
154
- throw new Error(`There are no updates on branch "${branchName}" published on the platform(s) "${platformFlag}" with group ID "${group ? group : updatesToRepublish[0].group}". Did you mean to publish a new update instead?`);
155
- }
156
- let publicationPlatformMessage;
157
- if (platformFlag === 'all') {
158
- if (updatesToRepublishFilteredByPlatform.length !== exports.defaultPublishPlatforms.length) {
159
- log_1.default.warn(`You are republishing an update that wasn't published for all platforms.`);
160
- }
161
- publicationPlatformMessage = `The republished update will appear on the same plaforms it was originally published on: ${updatesToRepublishFilteredByPlatform
162
- .map(update => update.platform)
163
- .join(',')}`;
164
- }
165
- else {
166
- publicationPlatformMessage = `The republished update will appear only on: ${platformFlag}`;
167
- }
168
- log_1.default.withTick(publicationPlatformMessage);
169
- for (const update of updatesToRepublishFilteredByPlatform) {
170
- const { manifestFragment } = update;
171
- const platform = update.platform;
172
- unsortedUpdateInfoGroups[platform] = JSON.parse(manifestFragment);
173
- }
174
- // These are the same for each member of an update group
175
- group = updatesToRepublishFilteredByPlatform[0].group;
176
- oldMessage = (_a = updatesToRepublishFilteredByPlatform[0].message) !== null && _a !== void 0 ? _a : '';
177
- oldRuntimeVersion = updatesToRepublishFilteredByPlatform[0].runtimeVersion;
178
- }
179
- else {
180
- // build bundle and upload assets for a new publish
181
- if (!skipBundler) {
182
- await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir });
183
- }
184
- const assetSpinner = (0, ora_1.ora)('Uploading assets...').start();
185
- try {
186
- const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
187
- const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
188
- await (0, publish_1.uploadAssetsAsync)(assets);
189
- unsortedUpdateInfoGroups = await (0, publish_1.buildUnsortedUpdateInfoGroupAsync)(assets, exp);
190
- assetSpinner.succeed('Uploaded assets!');
191
- }
192
- catch (e) {
193
- assetSpinner.fail('Failed to upload assets');
194
- throw e;
195
- }
196
- }
197
- if (!message && autoFlag) {
198
- message = (_b = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim();
199
- }
200
- if (!message) {
201
- const validationMessage = 'publish message may not be empty.';
202
- if (jsonFlag) {
203
- throw new Error(validationMessage);
204
- }
205
- ({ publishMessage: message } = await (0, prompts_1.promptAsync)({
206
- type: 'text',
207
- name: 'publishMessage',
208
- message: `Please enter a publication message.`,
209
- initial: republish
210
- ? `Republish "${oldMessage}" - group: ${group}`
211
- : (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
212
- validate: value => (value ? true : validationMessage),
213
- }));
214
- }
215
- const runtimeToPlatformMapping = {};
216
- for (const runtime of new Set(Object.values(runtimeVersions))) {
217
- runtimeToPlatformMapping[runtime] = Object.entries(runtimeVersions)
218
- .filter(pair => pair[1] === runtime)
219
- .map(pair => pair[0]);
220
- }
221
- // Sort the updates into different groups based on their platform specific runtime versions
222
- const updateGroups = Object.entries(runtimeToPlatformMapping).map(([runtime, platforms]) => {
223
- const localUpdateInfoGroup = Object.fromEntries(platforms.map(platform => [
224
- platform,
225
- unsortedUpdateInfoGroups[platform],
226
- ]));
227
- if (republish && !oldRuntimeVersion) {
228
- throw new Error('Can not find the runtime version of the update group that is being republished.');
229
- }
230
- return {
231
- branchId,
232
- updateInfoGroup: localUpdateInfoGroup,
233
- runtimeVersion: republish ? oldRuntimeVersion : runtime,
234
- message,
235
- };
236
- });
237
- let newUpdates;
238
- const publishSpinner = (0, ora_1.ora)('Publishing...').start();
239
- try {
240
- newUpdates = await PublishMutation_1.PublishMutation.publishUpdateGroupAsync(updateGroups);
241
- publishSpinner.succeed('Published!');
242
- }
243
- catch (e) {
244
- publishSpinner.fail('Failed to published updates');
245
- throw e;
246
- }
247
- if (jsonFlag) {
248
- log_1.default.log(JSON.stringify(newUpdates));
249
- }
250
- else {
251
- if (new Set(newUpdates.map(update => update.group)).size > 1) {
252
- log_1.default.addNewLineIfNone();
253
- log_1.default.log('👉 Since multiple runtime versions are defined, multiple update groups have been published.');
254
- }
255
- log_1.default.addNewLineIfNone();
256
- for (const runtime of new Set(Object.values(runtimeVersions))) {
257
- const platforms = newUpdates
258
- .filter(update => update.runtimeVersion === runtime)
259
- .map(update => update.platform);
260
- const newUpdate = newUpdates.find(update => update.runtimeVersion === runtime);
261
- if (!newUpdate) {
262
- throw new Error(`Publish response is missing updates with runtime ${runtime}.`);
263
- }
264
- log_1.default.log((0, formatFields_1.default)([
265
- { label: 'branch', value: branchName },
266
- { label: 'runtime version', value: runtime },
267
- { label: 'platform', value: platforms.join(',') },
268
- { label: 'update group ID', value: newUpdate.group },
269
- { label: 'message', value: message },
270
- ]));
271
- log_1.default.addNewLineIfNone();
272
- }
273
- }
7
+ throw new Error(BranchPublish.description);
274
8
  }
275
9
  }
276
10
  exports.default = BranchPublish;
11
+ BranchPublish.description = 'deprecated, use "eas update"';
277
12
  BranchPublish.hidden = true;
278
- BranchPublish.description = 'Publish an update group to a branch.';
279
- BranchPublish.args = [
280
- {
281
- name: 'name',
282
- description: 'Name of the branch to publish on',
283
- },
284
- ];
285
- BranchPublish.flags = {
286
- message: command_1.flags.string({
287
- description: 'short message describing the updates.',
288
- required: false,
289
- }),
290
- republish: command_1.flags.boolean({
291
- description: 'republish an update group',
292
- exclusive: ['input-dir', 'skip-bundler'],
293
- }),
294
- group: command_1.flags.string({
295
- description: 'update group to republish',
296
- exclusive: ['input-dir', 'skip-bundler'],
297
- }),
298
- 'input-dir': command_1.flags.string({
299
- description: 'location of the bundle',
300
- default: 'dist',
301
- required: false,
302
- }),
303
- 'skip-bundler': command_1.flags.boolean({
304
- description: `skip running Expo CLI to bundle the app before publishing`,
305
- default: false,
306
- }),
307
- platform: command_1.flags.enum({
308
- char: 'p',
309
- description: `only publish to a single platform`,
310
- options: [...exports.defaultPublishPlatforms, 'all'],
311
- default: 'all',
312
- required: false,
313
- }),
314
- json: command_1.flags.boolean({
315
- description: `return a json with the new update group.`,
316
- default: false,
317
- }),
318
- auto: command_1.flags.boolean({
319
- description: 'use the current git branch and commit message for the EAS branch and update message',
320
- default: false,
321
- }),
322
- };
323
- async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
324
- var _a, _b;
325
- const platforms = (platformFlag === 'all' ? ['android', 'ios'] : [platformFlag]);
326
- for (const platform of platforms) {
327
- const isPolicy = typeof ((_b = (_a = exp[platform]) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion) === 'object';
328
- if (isPolicy) {
329
- const isManaged = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)) === eas_build_job_1.Workflow.MANAGED;
330
- if (!isManaged) {
331
- throw new Error('Runtime version policies are only supported in the managed workflow.');
332
- }
333
- }
334
- }
335
- return Object.fromEntries(platforms.map(platform => [platform, config_plugins_1.Updates.getRuntimeVersion(exp, platform)]));
336
- }
337
- function formatUpdateTitle(update) {
338
- const { message, createdAt, actor, runtimeVersion } = update;
339
- let actorName;
340
- switch (actor === null || actor === void 0 ? void 0 : actor.__typename) {
341
- case 'User': {
342
- actorName = actor.username;
343
- break;
344
- }
345
- case 'Robot': {
346
- const { firstName, id } = actor;
347
- actorName = firstName !== null && firstName !== void 0 ? firstName : `robot: ${id.slice(0, 4)}...`;
348
- break;
349
- }
350
- default:
351
- actorName = 'unknown';
352
- }
353
- return `[${(0, dateformat_1.default)(createdAt, 'mmm dd HH:MM')} by ${actorName}, runtimeVersion: ${runtimeVersion}] ${message}`;
354
- }
@@ -44,7 +44,7 @@ function logSuccess(platform) {
44
44
  }
45
45
  else if (platform === 'ios') {
46
46
  platformsText = 'iOS project is';
47
- storesText = 'the Apple App Store';
47
+ storesText = 'the Apple App Store Connect';
48
48
  }
49
49
  log_1.default.log(`🎉 Your ${platformsText} ready to build.
50
50
 
@@ -40,6 +40,7 @@ class Build extends EasCommand_1.default {
40
40
  this.metroConfigValidated = false;
41
41
  }
42
42
  async runAsync() {
43
+ var _a;
43
44
  const { flags: rawFlags } = this.parse(Build);
44
45
  if (rawFlags.json) {
45
46
  (0, json_1.enableJsonOutput)();
@@ -56,7 +57,7 @@ class Build extends EasCommand_1.default {
56
57
  type: 'build',
57
58
  projectDir,
58
59
  platforms,
59
- profileName: flags.profile,
60
+ profileName: (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined,
60
61
  });
61
62
  await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
62
63
  projectDir,
@@ -85,14 +86,22 @@ class Build extends EasCommand_1.default {
85
86
  log_1.default.newLine();
86
87
  const submissions = [];
87
88
  if (flags.autoSubmit) {
89
+ const submitProfiles = await (0, profiles_1.getProfilesAsync)({
90
+ projectDir,
91
+ platforms,
92
+ profileName: flags.submitProfile,
93
+ type: 'submit',
94
+ });
88
95
  for (const startedBuild of startedBuilds) {
96
+ const submitProfile = (0, nullthrows_1.default)(submitProfiles.find(({ platform }) => (0, AppPlatform_1.toAppPlatform)(platform) === startedBuild.build.platform)).profile;
89
97
  const submission = await this.prepareAndStartSubmissionAsync({
90
98
  build: startedBuild.build,
91
99
  buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
92
- flags,
93
100
  moreBuilds: startedBuilds.length > 1,
94
101
  projectDir,
95
- buildProfile: startedBuild.buildProfile,
102
+ buildProfile: startedBuild.buildProfile.profile,
103
+ submitProfile,
104
+ nonInteractive: flags.nonInteractive,
96
105
  });
97
106
  submissions.push(submission);
98
107
  }
@@ -144,7 +153,7 @@ class Build extends EasCommand_1.default {
144
153
  return {
145
154
  requestedPlatform,
146
155
  skipProjectConfiguration: flags['skip-project-configuration'],
147
- profile: profile !== null && profile !== void 0 ? profile : null,
156
+ profile,
148
157
  nonInteractive,
149
158
  local: flags['local'],
150
159
  wait: flags['wait'],
@@ -190,19 +199,17 @@ class Build extends EasCommand_1.default {
190
199
  }
191
200
  return await sendBuildRequestAsync();
192
201
  }
193
- async prepareAndStartSubmissionAsync({ build, buildCtx, flags, moreBuilds, projectDir, buildProfile, }) {
202
+ async prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, nonInteractive, }) {
194
203
  var _a, _b, _c;
195
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
196
204
  const platform = (0, AppPlatform_1.toPlatform)(build.platform);
197
- const submitProfile = await easJsonReader.readSubmitProfileAsync(platform, flags.submitProfile);
198
205
  const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
199
206
  platform,
200
207
  projectDir,
201
208
  projectId: build.project.id,
202
209
  profile: submitProfile,
203
210
  archiveFlags: { id: build.id },
204
- nonInteractive: flags.nonInteractive,
205
- env: buildProfile.profile.env,
211
+ nonInteractive,
212
+ env: buildProfile.env,
206
213
  credentialsCtx: buildCtx.credentialsCtx,
207
214
  applicationIdentifier: (_b = (_a = buildCtx.android) === null || _a === void 0 ? void 0 : _a.applicationId) !== null && _b !== void 0 ? _b : (_c = buildCtx.ios) === null || _c === void 0 ? void 0 : _c.bundleIdentifier,
208
215
  });
@@ -220,7 +227,7 @@ class Build extends EasCommand_1.default {
220
227
  }
221
228
  }
222
229
  exports.default = Build;
223
- Build.description = 'start a build';
230
+ Build.description = 'Start a build';
224
231
  Build.flags = {
225
232
  platform: command_1.flags.enum({
226
233
  char: 'p',
@@ -276,7 +283,7 @@ async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
276
283
  return;
277
284
  }
278
285
  const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
279
- const rawEasJson = await easJsonReader.readRawAsync();
286
+ const rawEasJson = await easJsonReader.readAsync();
280
287
  if (rawEasJson === null || rawEasJson === void 0 ? void 0 : rawEasJson.cli) {
281
288
  return;
282
289
  }
@@ -54,7 +54,7 @@ async function updateChannelBranchMappingAsync({ channelId, branchMapping, }) {
54
54
  .toPromise());
55
55
  const channel = data.updateChannel.editUpdateChannel;
56
56
  if (!channel) {
57
- throw new Error(`Could not fine channel with id ${channelId}`);
57
+ throw new Error(`Could not find a channel with id: ${channelId}`);
58
58
  }
59
59
  return data.updateChannel.editUpdateChannel;
60
60
  }
@@ -133,7 +133,7 @@ function logChannelDetails(channel) {
133
133
  : []),
134
134
  (0, utils_1.formatUpdate)(update),
135
135
  (_a = update === null || update === void 0 ? void 0 : update.runtimeVersion) !== null && _a !== void 0 ? _a : 'N/A',
136
- (_b = update === null || update === void 0 ? void 0 : update.group) !== null && _b !== void 0 ? _b : 'N/A,',
136
+ (_b = update === null || update === void 0 ? void 0 : update.group) !== null && _b !== void 0 ? _b : 'N/A',
137
137
  (0, utils_1.getPlatformsForGroup)({
138
138
  updates: branch.updates,
139
139
  group: (_c = branch.updates[0]) === null || _c === void 0 ? void 0 : _c.group,
@@ -168,7 +168,7 @@ class ChannelView extends EasCommand_1.default {
168
168
  });
169
169
  const channel = (_a = getUpdateChannelByNameForAppresult.app) === null || _a === void 0 ? void 0 : _a.byId.updateChannelByName;
170
170
  if (!channel) {
171
- throw new Error(`Could not fine channel with name ${channelName}`);
171
+ throw new Error(`Could not find a channel with name: ${channelName}`);
172
172
  }
173
173
  if (jsonFlag) {
174
174
  log_1.default.log(JSON.stringify(channel));
@@ -181,7 +181,7 @@ class ChannelView extends EasCommand_1.default {
181
181
  { label: 'ID', value: channel.id },
182
182
  ]));
183
183
  log_1.default.addNewLineIfNone();
184
- log_1.default.log((0, chalk_1.default) `{bold Branches, pointed at by this channel, and their most recent update group:}`);
184
+ log_1.default.log((0, chalk_1.default) `{bold Branches pointed at this channel and their most recent update group:}`);
185
185
  logChannelDetails(channel);
186
186
  }
187
187
  }
@@ -36,7 +36,7 @@ class Config extends EasCommand_1.default {
36
36
  value: eas_build_job_1.Platform.IOS,
37
37
  },
38
38
  ]));
39
- const profile = await reader.readBuildProfileAsync(platform, profileName);
39
+ const profile = await reader.getBuildProfileAsync(platform, profileName);
40
40
  const config = (0, expoConfig_1.getExpoConfig)(projectDir, { env: profile.env, isPublicConfig: true });
41
41
  log_1.default.log((0, config_1.getProjectConfigDescription)(projectDir));
42
42
  log_1.default.newLine();
@@ -2,16 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCommand"));
5
- const context_1 = require("../credentials/context");
6
5
  const SelectPlatform_1 = require("../credentials/manager/SelectPlatform");
7
- const actions_1 = require("../user/actions");
8
6
  class Credentials extends EasCommand_1.default {
9
7
  async runAsync() {
10
- const ctx = new context_1.CredentialsContext({
11
- projectDir: process.cwd(),
12
- user: await (0, actions_1.ensureLoggedInAsync)(),
13
- });
14
- await new SelectPlatform_1.SelectPlatform().runAsync(ctx);
8
+ await new SelectPlatform_1.SelectPlatform().runAsync();
15
9
  }
16
10
  }
17
11
  exports.default = Credentials;
@@ -3,4 +3,5 @@ export default class Diagnostics extends EasCommand {
3
3
  static description: string;
4
4
  protected requiresAuthentication: boolean;
5
5
  runAsync(): Promise<void>;
6
+ private printWorkflowAsync;
6
7
  }
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const envinfo_1 = (0, tslib_1.__importDefault)(require("envinfo"));
5
6
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../commandUtils/EasCommand"));
6
7
  const log_1 = (0, tslib_1.__importDefault)(require("../log"));
8
+ const projectUtils_1 = require("../project/projectUtils");
9
+ const workflow_1 = require("../project/workflow");
7
10
  const easCli_1 = require("../utils/easCli");
8
11
  class Diagnostics extends EasCommand_1.default {
9
12
  constructor() {
@@ -30,7 +33,22 @@ class Diagnostics extends EasCommand_1.default {
30
33
  }, {
31
34
  title: `EAS CLI ${easCli_1.easCliVersion} environment info`,
32
35
  });
33
- log_1.default.log(info);
36
+ log_1.default.log(info.trimEnd());
37
+ await this.printWorkflowAsync();
38
+ log_1.default.newLine();
39
+ }
40
+ async printWorkflowAsync() {
41
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
42
+ const androidWorkflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
43
+ const iosWorkflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
44
+ if (androidWorkflow === iosWorkflow) {
45
+ log_1.default.log(` Project workflow: ${androidWorkflow}`);
46
+ }
47
+ else {
48
+ log_1.default.log(` Project Workflow:`);
49
+ log_1.default.log(` Android: ${androidWorkflow}`);
50
+ log_1.default.log(` iOS: ${iosWorkflow}`);
51
+ }
34
52
  }
35
53
  }
36
54
  exports.default = Diagnostics;
@@ -74,7 +74,7 @@ class Submit extends EasCommand_1.default {
74
74
  }
75
75
  }
76
76
  exports.default = Submit;
77
- Submit.description = `submit build archive to app store
77
+ Submit.description = `Submit build archive to App Store Connect
78
78
  See how to configure submits with eas.json: ${(0, log_1.link)('https://docs.expo.dev/submit/eas-json/')}`;
79
79
  Submit.aliases = ['build:submit'];
80
80
  Submit.flags = {
@@ -0,0 +1,8 @@
1
+ import { ExpoConfig } from '@expo/config';
2
+ import EasCommand from '../../commandUtils/EasCommand';
3
+ export declare function getEASUpdateURLAsync(exp: ExpoConfig): Promise<string>;
4
+ export default class UpdateConfigure extends EasCommand {
5
+ static hidden: boolean;
6
+ static description: string;
7
+ runAsync(): Promise<void>;
8
+ }
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEASUpdateURLAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const config_1 = require("@expo/config");
6
+ const eas_build_job_1 = require("@expo/eas-build-job");
7
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
+ const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
9
+ const log_1 = (0, tslib_1.__importStar)(require("../../log"));
10
+ const projectUtils_1 = require("../../project/projectUtils");
11
+ const workflow_1 = require("../../project/workflow");
12
+ const EAS_UPDATE_URL = 'https://u.expo.dev';
13
+ const DEFAULT_RUNTIME_VERSION = { policy: 'sdkVersion' };
14
+ async function getEASUpdateURLAsync(exp) {
15
+ const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
16
+ return new URL(projectId, EAS_UPDATE_URL).href;
17
+ }
18
+ exports.getEASUpdateURLAsync = getEASUpdateURLAsync;
19
+ async function configureProjectForEASUpdateAsync(projectDir, exp) {
20
+ var _a, _b;
21
+ const easUpdateURL = await getEASUpdateURLAsync(exp);
22
+ const preexistingRuntimeVersion = exp.runtimeVersion;
23
+ const result = await (0, config_1.modifyConfigAsync)(projectDir, {
24
+ runtimeVersion: preexistingRuntimeVersion !== null && preexistingRuntimeVersion !== void 0 ? preexistingRuntimeVersion : DEFAULT_RUNTIME_VERSION,
25
+ updates: { ...exp.updates, url: easUpdateURL },
26
+ });
27
+ switch (result.type) {
28
+ case 'success':
29
+ if ((_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url) {
30
+ if (exp.updates.url !== easUpdateURL) {
31
+ log_1.default.withTick(`Overwrote "${(_b = exp.updates) === null || _b === void 0 ? void 0 : _b.url}" with "${easUpdateURL}" for the updates.url value in app.json`);
32
+ }
33
+ }
34
+ else {
35
+ log_1.default.withTick(`Set updates.url value, to "${easUpdateURL}" in app.json`);
36
+ }
37
+ if (!preexistingRuntimeVersion) {
38
+ log_1.default.withTick(`Set runtimeVersion to "${JSON.stringify(DEFAULT_RUNTIME_VERSION)}" in app.json`);
39
+ }
40
+ break;
41
+ case 'warn': {
42
+ log_1.default.addNewLineIfNone();
43
+ log_1.default.warn(`It looks like you are using a dynamic configuration! ${(0, log_1.learnMore)('https://docs.expo.dev/workflow/configuration/#dynamic-configuration-with-appconfigjs)')}`);
44
+ log_1.default.warn(`In order to finish configuring your project for EAS Update, you are going to need manually add the following to your app.config.js:\n${(0, log_1.learnMore)('https://expo.fyi/eas-update-config.md')}\n`);
45
+ log_1.default.log(chalk_1.default.bold(`{\n updates": {\n "url": "${easUpdateURL}"\n },\n "runtimeVersion": {\n "policy": "sdkVersion"\n }\n}`));
46
+ log_1.default.addNewLineIfNone();
47
+ throw new Error(result.message);
48
+ }
49
+ case 'fail':
50
+ throw new Error(result.message);
51
+ default:
52
+ throw new Error('Unexpected result type from modifyConfigAsync');
53
+ }
54
+ }
55
+ class UpdateConfigure extends EasCommand_1.default {
56
+ async runAsync() {
57
+ log_1.default.log('💡 The following process will configure your project to run EAS Update. These changes only apply to your local project files and you can safely revert them at any time.');
58
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
59
+ const { exp } = (0, config_1.getConfig)(projectDir, {
60
+ skipSDKVersionRequirement: true,
61
+ });
62
+ await configureProjectForEASUpdateAsync(projectDir, exp);
63
+ const hasAndroidNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID)) === eas_build_job_1.Workflow.GENERIC;
64
+ const hasIosNativeProject = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS)) === eas_build_job_1.Workflow.GENERIC;
65
+ log_1.default.addNewLineIfNone();
66
+ if (hasAndroidNativeProject || hasIosNativeProject) {
67
+ log_1.default.log(`🧐 It seems you are on the bare workflow! Please also update your native files. You can do this by either running ${chalk_1.default.bold('eas build:configure')} or manually editing Expo.plist/AndroidManifest.xml. ${(0, log_1.learnMore)('https://expo.fyi/eas-update-config.md#native-configuration')}`);
68
+ }
69
+ else {
70
+ log_1.default.log(`🎉 Your app is configured to run EAS Update!`);
71
+ }
72
+ }
73
+ }
74
+ exports.default = UpdateConfigure;
75
+ UpdateConfigure.hidden = true;
76
+ UpdateConfigure.description = 'Configure the project to support EAS Update.';