eas-cli 0.39.0 → 0.42.3

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 (117) hide show
  1. package/README.md +457 -104
  2. package/bin/run +3 -4
  3. package/build/api.d.ts +1 -0
  4. package/build/api.js +13 -1
  5. package/build/build/build.js +3 -3
  6. package/build/build/configure.js +3 -3
  7. package/build/build/context.d.ts +2 -1
  8. package/build/build/createContext.d.ts +3 -2
  9. package/build/build/createContext.js +3 -3
  10. package/build/build/local.d.ts +9 -1
  11. package/build/build/local.js +35 -5
  12. package/build/build/runBuildAndSubmit.d.ts +15 -0
  13. package/build/build/runBuildAndSubmit.js +173 -0
  14. package/build/build/utils/devClient.js +3 -3
  15. package/build/commandUtils/EasCommand.d.ts +2 -1
  16. package/build/commandUtils/EasCommand.js +7 -4
  17. package/build/commands/account/login.d.ts +1 -0
  18. package/build/commands/account/login.js +1 -0
  19. package/build/commands/account/logout.d.ts +1 -0
  20. package/build/commands/account/logout.js +1 -0
  21. package/build/commands/account/view.d.ts +1 -0
  22. package/build/commands/account/view.js +1 -0
  23. package/build/commands/analytics.js +1 -1
  24. package/build/commands/branch/create.d.ts +1 -2
  25. package/build/commands/branch/create.js +3 -4
  26. package/build/commands/branch/delete.d.ts +1 -2
  27. package/build/commands/branch/delete.js +4 -5
  28. package/build/commands/branch/list.d.ts +1 -2
  29. package/build/commands/branch/list.js +4 -5
  30. package/build/commands/branch/publish.d.ts +1 -18
  31. package/build/commands/branch/publish.js +2 -354
  32. package/build/commands/branch/rename.d.ts +3 -5
  33. package/build/commands/branch/rename.js +5 -6
  34. package/build/commands/branch/view.d.ts +1 -2
  35. package/build/commands/branch/view.js +3 -4
  36. package/build/commands/build/cancel.js +1 -1
  37. package/build/commands/build/configure.d.ts +1 -2
  38. package/build/commands/build/configure.js +3 -3
  39. package/build/commands/build/index.d.ts +11 -17
  40. package/build/commands/build/index.js +28 -178
  41. package/build/commands/build/inspect.d.ts +21 -0
  42. package/build/commands/build/inspect.js +129 -0
  43. package/build/commands/build/list.d.ts +13 -14
  44. package/build/commands/build/list.js +15 -15
  45. package/build/commands/build/view.d.ts +1 -1
  46. package/build/commands/build/view.js +3 -3
  47. package/build/commands/channel/create.d.ts +1 -2
  48. package/build/commands/channel/create.js +3 -4
  49. package/build/commands/channel/edit.d.ts +2 -4
  50. package/build/commands/channel/edit.js +4 -5
  51. package/build/commands/channel/list.d.ts +1 -2
  52. package/build/commands/channel/list.js +3 -4
  53. package/build/commands/channel/rollout.d.ts +4 -5
  54. package/build/commands/channel/rollout.js +6 -7
  55. package/build/commands/channel/view.d.ts +1 -2
  56. package/build/commands/channel/view.js +3 -4
  57. package/build/commands/config.d.ts +2 -3
  58. package/build/commands/config.js +4 -4
  59. package/build/commands/credentials.js +1 -7
  60. package/build/commands/device/list.d.ts +1 -2
  61. package/build/commands/device/list.js +3 -3
  62. package/build/commands/device/view.js +1 -1
  63. package/build/commands/diagnostics.js +1 -0
  64. package/build/commands/secret/create.d.ts +4 -5
  65. package/build/commands/secret/create.js +6 -6
  66. package/build/commands/secret/delete.d.ts +1 -2
  67. package/build/commands/secret/delete.js +3 -3
  68. package/build/commands/submit.d.ts +9 -10
  69. package/build/commands/submit.js +14 -15
  70. package/build/commands/update/configure.d.ts +0 -2
  71. package/build/commands/update/configure.js +14 -14
  72. package/build/commands/update/delete.d.ts +1 -2
  73. package/build/commands/update/delete.js +3 -4
  74. package/build/commands/update/index.d.ts +18 -0
  75. package/build/commands/update/index.js +392 -0
  76. package/build/commands/update/view.d.ts +1 -2
  77. package/build/commands/update/view.js +3 -4
  78. package/build/commands/webhook/create.d.ts +3 -4
  79. package/build/commands/webhook/create.js +5 -5
  80. package/build/commands/webhook/delete.js +1 -1
  81. package/build/commands/webhook/list.d.ts +1 -2
  82. package/build/commands/webhook/list.js +3 -3
  83. package/build/commands/webhook/update.d.ts +4 -5
  84. package/build/commands/webhook/update.js +6 -6
  85. package/build/commands/webhook/view.js +1 -1
  86. package/build/credentials/context.d.ts +5 -0
  87. package/build/credentials/context.js +12 -7
  88. package/build/credentials/manager/ManageAndroid.d.ts +3 -3
  89. package/build/credentials/manager/ManageAndroid.js +21 -13
  90. package/build/credentials/manager/ManageIos.d.ts +3 -3
  91. package/build/credentials/manager/ManageIos.js +23 -13
  92. package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -3
  93. package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -6
  94. package/build/credentials/manager/SelectPlatform.d.ts +1 -2
  95. package/build/credentials/manager/SelectPlatform.js +3 -3
  96. package/build/graphql/generated.d.ts +31 -11
  97. package/build/graphql/generated.js +6 -1
  98. package/build/graphql/types/Submission.js +1 -0
  99. package/build/index.d.ts +1 -1
  100. package/build/index.js +2 -2
  101. package/build/project/expoSdk.d.ts +3 -0
  102. package/build/project/expoSdk.js +30 -0
  103. package/build/project/metroConfig.js +2 -2
  104. package/build/project/publish.js +1 -3
  105. package/build/prompts.d.ts +3 -3
  106. package/build/submit/context.js +0 -1
  107. package/build/submit/ios/IosSubmitCommand.js +6 -1
  108. package/build/submit/utils/urls.js +1 -1
  109. package/build/update/utils.js +4 -4
  110. package/build/user/actions.js +2 -2
  111. package/build/utils/expoCli.d.ts +3 -1
  112. package/build/utils/expoCli.js +13 -11
  113. package/build/utils/profiles.d.ts +1 -1
  114. package/build/utils/profiles.js +80 -30
  115. package/build/vcs/clients/git.js +2 -2
  116. package/oclif.manifest.json +1 -1
  117. package/package.json +16 -12
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
7
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -50,7 +50,7 @@ async function deleteBranchOnAppAsync({ branchId, }) {
50
50
  class BranchDelete extends EasCommand_1.default {
51
51
  async runAsync() {
52
52
  var _a, _b;
53
- let { args: { name }, flags: { json: jsonFlag }, } = this.parse(BranchDelete);
53
+ let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchDelete);
54
54
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
55
55
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
56
56
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -93,8 +93,7 @@ class BranchDelete extends EasCommand_1.default {
93
93
  }
94
94
  }
95
95
  exports.default = BranchDelete;
96
- BranchDelete.hidden = true;
97
- BranchDelete.description = 'Republish an update group';
96
+ BranchDelete.description = 'Delete a branch on the current project';
98
97
  BranchDelete.args = [
99
98
  {
100
99
  name: 'name',
@@ -103,7 +102,7 @@ BranchDelete.args = [
103
102
  },
104
103
  ];
105
104
  BranchDelete.flags = {
106
- json: command_1.flags.boolean({
105
+ json: core_1.Flags.boolean({
107
106
  description: `return JSON with the edited branch's ID and name.`,
108
107
  default: false,
109
108
  }),
@@ -4,10 +4,9 @@ export declare function listBranchesAsync({ projectId, }: {
4
4
  projectId: string;
5
5
  }): Promise<UpdateBranchFragment[]>;
6
6
  export default class BranchList extends EasCommand {
7
- static hidden: boolean;
8
7
  static description: string;
9
8
  static flags: {
10
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
10
  };
12
11
  runAsync(): Promise<void>;
13
12
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.listBranchesAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
9
9
  const graphql_1 = require("graphql");
@@ -41,7 +41,7 @@ async function listBranchesAsync({ projectId, }) {
41
41
  exports.listBranchesAsync = listBranchesAsync;
42
42
  class BranchList extends EasCommand_1.default {
43
43
  async runAsync() {
44
- const { flags } = this.parse(BranchList);
44
+ const { flags } = await this.parse(BranchList);
45
45
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
46
46
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
47
47
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -51,7 +51,7 @@ class BranchList extends EasCommand_1.default {
51
51
  }
52
52
  else {
53
53
  const table = new cli_table3_1.default({
54
- head: ['branch', ...utils_1.UPDATE_COLUMNS],
54
+ head: ['Branch', ...utils_1.UPDATE_COLUMNS],
55
55
  wordWrap: true,
56
56
  });
57
57
  table.push(...branches.map(branch => {
@@ -77,10 +77,9 @@ class BranchList extends EasCommand_1.default {
77
77
  }
78
78
  }
79
79
  exports.default = BranchList;
80
- BranchList.hidden = true;
81
80
  BranchList.description = 'List all branches on this project.';
82
81
  BranchList.flags = {
83
- json: command_1.flags.boolean({
82
+ json: core_1.Flags.boolean({
84
83
  description: 'return output as JSON',
85
84
  default: false,
86
85
  }),
@@ -1,23 +1,6 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
- import { PublishPlatform } from '../../project/publish';
4
- export declare const defaultPublishPlatforms: PublishPlatform[];
5
2
  export default class BranchPublish extends EasCommand {
6
- static hidden: boolean;
7
3
  static description: string;
8
- static args: {
9
- name: string;
10
- description: string;
11
- }[];
12
- static flags: {
13
- message: flags.IOptionFlag<string | undefined>;
14
- republish: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- group: flags.IOptionFlag<string | undefined>;
16
- 'input-dir': flags.IOptionFlag<string>;
17
- 'skip-bundler': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
18
- platform: flags.IOptionFlag<string>;
19
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
20
- auto: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
21
- };
4
+ static hidden: boolean;
22
5
  runAsync(): Promise<void>;
23
6
  }
@@ -1,364 +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 configure_1 = require("../update/configure");
28
- const create_2 = require("./create");
29
- const list_1 = require("./list");
30
- const view_1 = require("./view");
31
- exports.defaultPublishPlatforms = ['android', 'ios'];
32
- async function getUpdateGroupAsync({ group, }) {
33
- const { updatesByGroup } = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
34
- .query((0, graphql_tag_1.default) `
35
- query getUpdateGroupAsync($group: ID!) {
36
- updatesByGroup(group: $group) {
37
- id
38
- group
39
- runtimeVersion
40
- manifestFragment
41
- platform
42
- message
43
- }
44
- }
45
- `, {
46
- group,
47
- }, { additionalTypenames: ['Update'] })
48
- .toPromise());
49
- return updatesByGroup;
50
- }
51
- async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
52
- var _a;
53
- try {
54
- await (0, create_1.createUpdateChannelOnAppAsync)({
55
- appId,
56
- channelName,
57
- branchId,
58
- });
59
- log_1.default.withTick(`Created a channel: ${chalk_1.default.bold(channelName)} pointed at branch: ${chalk_1.default.bold(channelName)}.`);
60
- }
61
- catch (e) {
62
- const isIgnorableError = ((_a = e.graphQLErrors) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
63
- e.graphQLErrors[0].extensions.errorCode === 'CHANNEL_ALREADY_EXISTS';
64
- if (!isIgnorableError) {
65
- throw e;
66
- }
67
- }
68
- }
69
- async function ensureBranchExistsAsync({ appId, name: branchName, }) {
70
- const { app } = await (0, view_1.viewUpdateBranchAsync)({
71
- appId,
72
- name: branchName,
73
- });
74
- const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
75
- if (updateBranch) {
76
- const { id, updates } = updateBranch;
77
- await ensureChannelExistsAsync({ appId, branchId: id, channelName: branchName });
78
- return { id, updates };
79
- }
80
- const newUpdateBranch = await (0, create_2.createUpdateBranchOnAppAsync)({ appId, name: branchName });
81
- log_1.default.withTick(`Created branch: ${chalk_1.default.bold(branchName)}`);
82
- await ensureChannelExistsAsync({ appId, branchId: newUpdateBranch.id, channelName: branchName });
83
- return { id: newUpdateBranch.id, updates: [] };
84
- }
85
5
  class BranchPublish extends EasCommand_1.default {
86
6
  async runAsync() {
87
- var _a, _b, _c;
88
- let { args: { name: branchName }, flags: { json: jsonFlag, auto: autoFlag, message, republish, group, 'input-dir': inputDir, 'skip-bundler': skipBundler, }, } = this.parse(BranchPublish);
89
- const platformFlag = this.parse(BranchPublish).flags.platform;
90
- // If a group was specified, that means we are republishing it.
91
- republish = group ? true : republish;
92
- const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
93
- const { exp } = (0, config_1.getConfig)(projectDir, {
94
- skipSDKVersionRequirement: true,
95
- isPublicConfig: true,
96
- });
97
- const runtimeVersions = await getRuntimeVersionObjectAsync(exp, platformFlag, projectDir);
98
- const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
99
- await checkEASUpdateURLIsSetAsync(exp);
100
- if (!branchName && autoFlag) {
101
- branchName =
102
- (await (0, vcs_1.getVcsClient)().getBranchNameAsync()) ||
103
- `branch-${Math.random().toString(36).substr(2, 4)}`;
104
- }
105
- if (!branchName) {
106
- const validationMessage = 'branch name may not be empty.';
107
- if (jsonFlag) {
108
- throw new Error(validationMessage);
109
- }
110
- const branches = await (0, list_1.listBranchesAsync)({ projectId });
111
- branchName = await (0, prompts_1.selectAsync)('which branch would you like to publish on?', branches.map(branch => {
112
- return {
113
- title: `${branch.name} ${chalk_1.default.grey(`- current update: ${(0, utils_1.formatUpdate)(branch.updates[0])}`)}`,
114
- value: branch.name,
115
- };
116
- }));
117
- (0, assert_1.default)(branchName, 'branch name must be specified.');
118
- }
119
- const { id: branchId, updates } = await ensureBranchExistsAsync({
120
- appId: projectId,
121
- name: branchName,
122
- });
123
- let unsortedUpdateInfoGroups = {};
124
- let oldMessage, oldRuntimeVersion;
125
- if (republish) {
126
- // If we are republishing, we don't need to worry about building the bundle or uploading the assets.
127
- // Instead we get the `updateInfoGroup` from the update we wish to republish.
128
- let updatesToRepublish;
129
- if (group) {
130
- updatesToRepublish = await getUpdateGroupAsync({ group });
131
- }
132
- else {
133
- // Drop into interactive mode if the user has not specified an update group to republish.
134
- if (jsonFlag) {
135
- throw new Error('You must specify the update group to republish.');
136
- }
137
- const updateGroups = (0, uniqBy_1.default)(updates, u => u.group)
138
- .filter(update => {
139
- // Only show groups that have updates on the specified platform(s).
140
- return platformFlag === 'all' || update.platform === platformFlag;
141
- })
142
- .map(update => ({
143
- title: formatUpdateTitle(update),
144
- value: update.group,
145
- }));
146
- if (updateGroups.length === 0) {
147
- 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?`);
148
- }
149
- const selectedUpdateGroup = await (0, prompts_1.selectAsync)('which update would you like to republish?', updateGroups);
150
- updatesToRepublish = updates.filter(update => update.group === selectedUpdateGroup);
151
- }
152
- const updatesToRepublishFilteredByPlatform = updatesToRepublish.filter(
153
- // Only republish to the specified platforms
154
- update => platformFlag === 'all' || update.platform === platformFlag);
155
- if (updatesToRepublishFilteredByPlatform.length === 0) {
156
- 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?`);
157
- }
158
- let publicationPlatformMessage;
159
- if (platformFlag === 'all') {
160
- if (updatesToRepublishFilteredByPlatform.length !== exports.defaultPublishPlatforms.length) {
161
- log_1.default.warn(`You are republishing an update that wasn't published for all platforms.`);
162
- }
163
- publicationPlatformMessage = `The republished update will appear on the same plaforms it was originally published on: ${updatesToRepublishFilteredByPlatform
164
- .map(update => update.platform)
165
- .join(',')}`;
166
- }
167
- else {
168
- publicationPlatformMessage = `The republished update will appear only on: ${platformFlag}`;
169
- }
170
- log_1.default.withTick(publicationPlatformMessage);
171
- for (const update of updatesToRepublishFilteredByPlatform) {
172
- const { manifestFragment } = update;
173
- const platform = update.platform;
174
- unsortedUpdateInfoGroups[platform] = JSON.parse(manifestFragment);
175
- }
176
- // These are the same for each member of an update group
177
- group = updatesToRepublishFilteredByPlatform[0].group;
178
- oldMessage = (_a = updatesToRepublishFilteredByPlatform[0].message) !== null && _a !== void 0 ? _a : '';
179
- oldRuntimeVersion = updatesToRepublishFilteredByPlatform[0].runtimeVersion;
180
- }
181
- else {
182
- // build bundle and upload assets for a new publish
183
- if (!skipBundler) {
184
- await (0, publish_1.buildBundlesAsync)({ projectDir, inputDir });
185
- }
186
- const assetSpinner = (0, ora_1.ora)('Uploading assets...').start();
187
- try {
188
- const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
189
- const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
190
- await (0, publish_1.uploadAssetsAsync)(assets);
191
- unsortedUpdateInfoGroups = await (0, publish_1.buildUnsortedUpdateInfoGroupAsync)(assets, exp);
192
- assetSpinner.succeed('Uploaded assets!');
193
- }
194
- catch (e) {
195
- assetSpinner.fail('Failed to upload assets');
196
- throw e;
197
- }
198
- }
199
- if (!message && autoFlag) {
200
- message = (_b = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _b === void 0 ? void 0 : _b.trim();
201
- }
202
- if (!message) {
203
- const validationMessage = 'publish message may not be empty.';
204
- if (jsonFlag) {
205
- throw new Error(validationMessage);
206
- }
207
- ({ publishMessage: message } = await (0, prompts_1.promptAsync)({
208
- type: 'text',
209
- name: 'publishMessage',
210
- message: `Please enter a publication message.`,
211
- initial: republish
212
- ? `Republish "${oldMessage}" - group: ${group}`
213
- : (_c = (await (0, vcs_1.getVcsClient)().getLastCommitMessageAsync())) === null || _c === void 0 ? void 0 : _c.trim(),
214
- validate: value => (value ? true : validationMessage),
215
- }));
216
- }
217
- const runtimeToPlatformMapping = {};
218
- for (const runtime of new Set(Object.values(runtimeVersions))) {
219
- runtimeToPlatformMapping[runtime] = Object.entries(runtimeVersions)
220
- .filter(pair => pair[1] === runtime)
221
- .map(pair => pair[0]);
222
- }
223
- // Sort the updates into different groups based on their platform specific runtime versions
224
- const updateGroups = Object.entries(runtimeToPlatformMapping).map(([runtime, platforms]) => {
225
- const localUpdateInfoGroup = Object.fromEntries(platforms.map(platform => [
226
- platform,
227
- unsortedUpdateInfoGroups[platform],
228
- ]));
229
- if (republish && !oldRuntimeVersion) {
230
- throw new Error('Can not find the runtime version of the update group that is being republished.');
231
- }
232
- return {
233
- branchId,
234
- updateInfoGroup: localUpdateInfoGroup,
235
- runtimeVersion: republish ? oldRuntimeVersion : runtime,
236
- message,
237
- };
238
- });
239
- let newUpdates;
240
- const publishSpinner = (0, ora_1.ora)('Publishing...').start();
241
- try {
242
- newUpdates = await PublishMutation_1.PublishMutation.publishUpdateGroupAsync(updateGroups);
243
- publishSpinner.succeed('Published!');
244
- }
245
- catch (e) {
246
- publishSpinner.fail('Failed to published updates');
247
- throw e;
248
- }
249
- if (jsonFlag) {
250
- log_1.default.log(JSON.stringify(newUpdates));
251
- }
252
- else {
253
- if (new Set(newUpdates.map(update => update.group)).size > 1) {
254
- log_1.default.addNewLineIfNone();
255
- log_1.default.log('👉 Since multiple runtime versions are defined, multiple update groups have been published.');
256
- }
257
- log_1.default.addNewLineIfNone();
258
- for (const runtime of new Set(Object.values(runtimeVersions))) {
259
- const platforms = newUpdates
260
- .filter(update => update.runtimeVersion === runtime)
261
- .map(update => update.platform);
262
- const newUpdate = newUpdates.find(update => update.runtimeVersion === runtime);
263
- if (!newUpdate) {
264
- throw new Error(`Publish response is missing updates with runtime ${runtime}.`);
265
- }
266
- log_1.default.log((0, formatFields_1.default)([
267
- { label: 'branch', value: branchName },
268
- { label: 'runtime version', value: runtime },
269
- { label: 'platform', value: platforms.join(',') },
270
- { label: 'update group ID', value: newUpdate.group },
271
- { label: 'message', value: message },
272
- ]));
273
- log_1.default.addNewLineIfNone();
274
- }
275
- }
7
+ throw new Error(BranchPublish.description);
276
8
  }
277
9
  }
278
10
  exports.default = BranchPublish;
11
+ BranchPublish.description = 'deprecated, use "eas update"';
279
12
  BranchPublish.hidden = true;
280
- BranchPublish.description = 'Publish an update group to a branch.';
281
- BranchPublish.args = [
282
- {
283
- name: 'name',
284
- description: 'Name of the branch to publish on',
285
- },
286
- ];
287
- BranchPublish.flags = {
288
- message: command_1.flags.string({
289
- description: 'short message describing the updates.',
290
- required: false,
291
- }),
292
- republish: command_1.flags.boolean({
293
- description: 'republish an update group',
294
- exclusive: ['input-dir', 'skip-bundler'],
295
- }),
296
- group: command_1.flags.string({
297
- description: 'update group to republish',
298
- exclusive: ['input-dir', 'skip-bundler'],
299
- }),
300
- 'input-dir': command_1.flags.string({
301
- description: 'location of the bundle',
302
- default: 'dist',
303
- required: false,
304
- }),
305
- 'skip-bundler': command_1.flags.boolean({
306
- description: `skip running Expo CLI to bundle the app before publishing`,
307
- default: false,
308
- }),
309
- platform: command_1.flags.enum({
310
- char: 'p',
311
- description: `only publish to a single platform`,
312
- options: [...exports.defaultPublishPlatforms, 'all'],
313
- default: 'all',
314
- required: false,
315
- }),
316
- json: command_1.flags.boolean({
317
- description: `return a json with the new update group.`,
318
- default: false,
319
- }),
320
- auto: command_1.flags.boolean({
321
- description: 'use the current git branch and commit message for the EAS branch and update message',
322
- default: false,
323
- }),
324
- };
325
- async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
326
- var _a, _b;
327
- const platforms = (platformFlag === 'all' ? ['android', 'ios'] : [platformFlag]);
328
- for (const platform of platforms) {
329
- const isPolicy = typeof ((_b = (_a = exp[platform]) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion) === 'object';
330
- if (isPolicy) {
331
- const isManaged = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)) === eas_build_job_1.Workflow.MANAGED;
332
- if (!isManaged) {
333
- throw new Error('Runtime version policies are only supported in the managed workflow.');
334
- }
335
- }
336
- }
337
- return Object.fromEntries(platforms.map(platform => [platform, config_plugins_1.Updates.getRuntimeVersion(exp, platform)]));
338
- }
339
- function formatUpdateTitle(update) {
340
- const { message, createdAt, actor, runtimeVersion } = update;
341
- let actorName;
342
- switch (actor === null || actor === void 0 ? void 0 : actor.__typename) {
343
- case 'User': {
344
- actorName = actor.username;
345
- break;
346
- }
347
- case 'Robot': {
348
- const { firstName, id } = actor;
349
- actorName = firstName !== null && firstName !== void 0 ? firstName : `robot: ${id.slice(0, 4)}...`;
350
- break;
351
- }
352
- default:
353
- actorName = 'unknown';
354
- }
355
- return `[${(0, dateformat_1.default)(createdAt, 'mmm dd HH:MM')} by ${actorName}, runtimeVersion: ${runtimeVersion}] ${message}`;
356
- }
357
- async function checkEASUpdateURLIsSetAsync(exp) {
358
- var _a;
359
- const configuredURL = (_a = exp.updates) === null || _a === void 0 ? void 0 : _a.url;
360
- const expectedURL = await (0, configure_1.getEASUpdateURLAsync)(exp);
361
- if (configuredURL !== expectedURL) {
362
- throw new Error(`The update URL is incorrectly configured for EAS Update. Please set updates.url to ${expectedURL} in your app.json.`);
363
- }
364
- }
@@ -1,12 +1,10 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class BranchRename extends EasCommand {
4
- static hidden: boolean;
5
3
  static description: string;
6
4
  static flags: {
7
- from: flags.IOptionFlag<string | undefined>;
8
- to: flags.IOptionFlag<string | undefined>;
9
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
5
+ from: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
6
+ to: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
8
  };
11
9
  runAsync(): Promise<void>;
12
10
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
7
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
8
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -33,7 +33,7 @@ async function renameUpdateBranchOnAppAsync({ appId, name, newName, }) {
33
33
  }
34
34
  class BranchRename extends EasCommand_1.default {
35
35
  async runAsync() {
36
- let { flags: { json: jsonFlag, from: currentName, to: newName }, } = this.parse(BranchRename);
36
+ let { flags: { json: jsonFlag, from: currentName, to: newName }, } = await this.parse(BranchRename);
37
37
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
38
38
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
39
39
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -75,18 +75,17 @@ class BranchRename extends EasCommand_1.default {
75
75
  }
76
76
  }
77
77
  exports.default = BranchRename;
78
- BranchRename.hidden = true;
79
78
  BranchRename.description = 'Rename a branch.';
80
79
  BranchRename.flags = {
81
- from: command_1.flags.string({
80
+ from: core_1.Flags.string({
82
81
  description: 'current name of the branch.',
83
82
  required: false,
84
83
  }),
85
- to: command_1.flags.string({
84
+ to: core_1.Flags.string({
86
85
  description: 'new name of the branch.',
87
86
  required: false,
88
87
  }),
89
- json: command_1.flags.boolean({
88
+ json: core_1.Flags.boolean({
90
89
  description: `return a json with the edited branch's ID and name.`,
91
90
  default: false,
92
91
  }),
@@ -2,7 +2,6 @@ import EasCommand from '../../commandUtils/EasCommand';
2
2
  import { ViewBranchQuery, ViewBranchQueryVariables } from '../../graphql/generated';
3
3
  export declare function viewUpdateBranchAsync({ appId, name, }: Pick<ViewBranchQueryVariables, 'appId' | 'name'>): Promise<ViewBranchQuery>;
4
4
  export default class BranchView extends EasCommand {
5
- static hidden: boolean;
6
5
  static description: string;
7
6
  static args: {
8
7
  name: string;
@@ -10,7 +9,7 @@ export default class BranchView extends EasCommand {
10
9
  description: string;
11
10
  }[];
12
11
  static flags: {
13
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
13
  };
15
14
  runAsync(): Promise<void>;
16
15
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.viewUpdateBranchAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
9
9
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
@@ -59,7 +59,7 @@ async function viewUpdateBranchAsync({ appId, name, }) {
59
59
  exports.viewUpdateBranchAsync = viewUpdateBranchAsync;
60
60
  class BranchView extends EasCommand_1.default {
61
61
  async runAsync() {
62
- let { args: { name }, flags: { json: jsonFlag }, } = this.parse(BranchView);
62
+ let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchView);
63
63
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
64
64
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
65
65
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -115,7 +115,6 @@ class BranchView extends EasCommand_1.default {
115
115
  }
116
116
  }
117
117
  exports.default = BranchView;
118
- BranchView.hidden = true;
119
118
  BranchView.description = 'View a branch.';
120
119
  BranchView.args = [
121
120
  {
@@ -125,7 +124,7 @@ BranchView.args = [
125
124
  },
126
125
  ];
127
126
  BranchView.flags = {
128
- json: command_1.flags.boolean({
127
+ json: core_1.Flags.boolean({
129
128
  description: `return a json with the branch's ID name and recent update groups.`,
130
129
  default: false,
131
130
  }),
@@ -90,7 +90,7 @@ async function ensureBuildExistsAsync(buildId) {
90
90
  }
91
91
  class BuildCancel extends EasCommand_1.default {
92
92
  async runAsync() {
93
- const { BUILD_ID: buildIdFromArg } = this.parse(BuildCancel).args;
93
+ const { BUILD_ID: buildIdFromArg } = (await this.parse(BuildCancel)).args;
94
94
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
95
95
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
96
96
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -1,9 +1,8 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class BuildConfigure extends EasCommand {
4
3
  static description: string;
5
4
  static flags: {
6
- platform: flags.IOptionFlag<string>;
5
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
7
6
  };
8
7
  runAsync(): Promise<void>;
9
8
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const command_1 = require("@oclif/command");
4
+ const core_1 = require("@oclif/core");
5
5
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
6
  const configure_1 = require("../../build/configure");
7
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -13,7 +13,7 @@ const vcs_1 = require("../../vcs");
13
13
  class BuildConfigure extends EasCommand_1.default {
14
14
  async runAsync() {
15
15
  var _a;
16
- const { flags } = this.parse(BuildConfigure);
16
+ const { flags } = await this.parse(BuildConfigure);
17
17
  log_1.default.log('💡 The following process will configure your iOS and/or Android project to be compatible with EAS Build. These changes only apply to your local project files and you can safely revert them at any time.');
18
18
  log_1.default.newLine();
19
19
  await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
@@ -29,7 +29,7 @@ class BuildConfigure extends EasCommand_1.default {
29
29
  exports.default = BuildConfigure;
30
30
  BuildConfigure.description = 'Configure the project to support EAS Build.';
31
31
  BuildConfigure.flags = {
32
- platform: command_1.flags.enum({
32
+ platform: core_1.Flags.enum({
33
33
  description: 'Platform to configure',
34
34
  char: 'p',
35
35
  options: ['android', 'ios', 'all'],