eas-cli 2.6.0 → 2.7.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 (41) hide show
  1. package/README.md +6 -1133
  2. package/build/branch/queries.d.ts +8 -1
  3. package/build/branch/queries.js +50 -1
  4. package/build/build/android/build.js +1 -0
  5. package/build/build/ios/build.js +1 -0
  6. package/build/build/local.js +1 -1
  7. package/build/build/validate.d.ts +1 -0
  8. package/build/build/validate.js +121 -1
  9. package/build/channel/queries.d.ts +11 -0
  10. package/build/channel/queries.js +46 -1
  11. package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +1 -1
  12. package/build/commands/branch/create.d.ts +0 -3
  13. package/build/commands/branch/create.js +2 -27
  14. package/build/commands/channel/create.d.ts +0 -7
  15. package/build/commands/channel/create.js +4 -31
  16. package/build/commands/update/configure.d.ts +1 -0
  17. package/build/commands/update/configure.js +10 -218
  18. package/build/commands/update/index.d.ts +3 -9
  19. package/build/commands/update/index.js +136 -143
  20. package/build/graphql/generated.d.ts +26 -17
  21. package/build/graphql/types/Build.js +1 -0
  22. package/build/log.d.ts +1 -0
  23. package/build/log.js +3 -0
  24. package/build/project/projectUtils.d.ts +3 -1
  25. package/build/project/projectUtils.js +10 -3
  26. package/build/project/publish.d.ts +13 -10
  27. package/build/project/publish.js +68 -38
  28. package/build/project/workflow.d.ts +1 -0
  29. package/build/project/workflow.js +9 -1
  30. package/build/submit/ArchiveSource.js +12 -16
  31. package/build/update/configure.d.ts +22 -0
  32. package/build/update/configure.js +200 -0
  33. package/build/utils/expoCli.d.ts +6 -0
  34. package/build/utils/expoCli.js +46 -1
  35. package/build/utils/expodash/memoize.d.ts +2 -0
  36. package/build/utils/expodash/memoize.js +17 -0
  37. package/build/utils/image.d.ts +6 -0
  38. package/build/utils/image.js +107 -0
  39. package/build/utils/statuspageService.js +1 -0
  40. package/oclif.manifest.json +1 -1
  41. package/package.json +7 -3
@@ -2,61 +2,25 @@
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
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
5
  const core_1 = require("@oclif/core");
8
- const assert_1 = tslib_1.__importDefault(require("assert"));
9
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
- const api_1 = require("../../api");
11
6
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
12
- const generated_1 = require("../../graphql/generated");
13
- const log_1 = tslib_1.__importStar(require("../../log"));
14
- const platform_1 = require("../../platform");
15
- const projectUtils_1 = require("../../project/projectUtils");
16
- const workflow_1 = require("../../project/workflow");
17
- const UpdatesModule_1 = require("../../update/android/UpdatesModule");
18
- const UpdatesModule_2 = require("../../update/ios/UpdatesModule");
19
- const DEFAULT_MANAGED_RUNTIME_VERSION = { policy: 'sdkVersion' };
20
- const DEFAULT_BARE_RUNTIME_VERSION = '1.0.0';
7
+ const flags_1 = require("../../commandUtils/flags");
8
+ const log_1 = tslib_1.__importDefault(require("../../log"));
9
+ const configure_1 = require("../../update/configure");
21
10
  class UpdateConfigure extends EasCommand_1.default {
22
11
  async runAsync() {
23
- 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.');
24
12
  const { flags } = await this.parse(UpdateConfigure);
13
+ const platform = flags.platform;
25
14
  const { projectConfig: { projectId, exp, projectDir }, loggedIn: { graphqlClient }, } = await this.getContextAsync(UpdateConfigure, {
26
- nonInteractive: true,
15
+ nonInteractive: flags['non-interactive'],
27
16
  });
28
- const platform = flags.platform;
29
- if (!(0, projectUtils_1.isExpoUpdatesInstalledOrAvailable)(projectDir, exp.sdkVersion)) {
30
- await (0, projectUtils_1.installExpoUpdatesAsync)(projectDir);
31
- }
32
- const [androidWorkflow, iosWorkflow] = await Promise.all([
33
- (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID),
34
- (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS),
35
- ]);
36
- const updatedExp = await configureAppJSONForEASUpdateAsync({
37
- projectDir,
17
+ 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.');
18
+ await (0, configure_1.ensureEASUpdatesIsConfiguredAsync)(graphqlClient, {
38
19
  exp,
39
- platform,
40
- workflows: {
41
- android: androidWorkflow,
42
- ios: iosWorkflow,
43
- },
44
20
  projectId,
21
+ projectDir,
22
+ platform,
45
23
  });
46
- log_1.default.withTick(`Configured ${chalk_1.default.bold('app.json')} for EAS Update`);
47
- // configure native files for EAS Update
48
- if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform) &&
49
- androidWorkflow === eas_build_job_1.Workflow.GENERIC) {
50
- await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(graphqlClient, projectDir, updatedExp, projectId);
51
- log_1.default.withTick(`Configured ${chalk_1.default.bold('AndroidManifest.xml')} for EAS Update`);
52
- }
53
- if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform) &&
54
- iosWorkflow === eas_build_job_1.Workflow.GENERIC) {
55
- await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(graphqlClient, projectDir, updatedExp, projectId);
56
- log_1.default.withTick(`Configured ${chalk_1.default.bold('Expo.plist')} for EAS Update`);
57
- }
58
- log_1.default.addNewLineIfNone();
59
- log_1.default.warn(`All builds of your app going forward will be eligible to receive updates published with EAS Update.`);
60
24
  log_1.default.addNewLineIfNone();
61
25
  log_1.default.log(`🎉 Your app is configured to run EAS Update!`);
62
26
  }
@@ -71,181 +35,9 @@ UpdateConfigure.flags = {
71
35
  options: ['android', 'ios', 'all'],
72
36
  default: 'all',
73
37
  }),
38
+ ...flags_1.EASNonInteractiveFlag,
74
39
  };
75
40
  UpdateConfigure.contextDefinition = {
76
41
  ..._a.ContextOptions.ProjectConfig,
77
42
  ..._a.ContextOptions.LoggedIn,
78
43
  };
79
- async function configureAppJSONForEASUpdateAsync({ projectDir, exp, platform, workflows, projectId, }) {
80
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
81
- // this command is non-interactive in the way it was designed
82
- const easUpdateURL = (0, api_1.getEASUpdateURL)(projectId);
83
- const updates = { ...exp.updates, url: easUpdateURL };
84
- const androidDefaultRuntimeVersion = workflows['android'] === eas_build_job_1.Workflow.GENERIC
85
- ? DEFAULT_BARE_RUNTIME_VERSION
86
- : DEFAULT_MANAGED_RUNTIME_VERSION;
87
- const iosDefaultRuntimeVersion = workflows['ios'] === eas_build_job_1.Workflow.GENERIC
88
- ? DEFAULT_BARE_RUNTIME_VERSION
89
- : DEFAULT_MANAGED_RUNTIME_VERSION;
90
- const newAndroidRuntimeVersion = (_d = (_c = (_b = exp.android) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== null && _c !== void 0 ? _c : exp.runtimeVersion) !== null && _d !== void 0 ? _d : androidDefaultRuntimeVersion;
91
- const newIosRuntimeVersion = (_g = (_f = (_e = exp.ios) === null || _e === void 0 ? void 0 : _e.runtimeVersion) !== null && _f !== void 0 ? _f : exp.runtimeVersion) !== null && _g !== void 0 ? _g : iosDefaultRuntimeVersion;
92
- let newConfig;
93
- let newConfigOnlyAddedValues;
94
- switch (platform) {
95
- case platform_1.RequestedPlatform.All: {
96
- if (isRuntimeEqual(newAndroidRuntimeVersion, newIosRuntimeVersion)) {
97
- newConfig = {
98
- runtimeVersion: newAndroidRuntimeVersion,
99
- android: {
100
- ...exp.android,
101
- runtimeVersion: undefined,
102
- },
103
- ios: { ...exp.ios, runtimeVersion: undefined },
104
- updates,
105
- };
106
- newConfigOnlyAddedValues = {
107
- runtimeVersion: newAndroidRuntimeVersion,
108
- ...(exp.android && 'runtimeVersion' in exp.android
109
- ? {
110
- android: {
111
- runtimeVersion: '<remove this key>',
112
- },
113
- }
114
- : {}),
115
- ...(exp.ios && 'runtimeVersion' in exp.ios
116
- ? {
117
- ios: {
118
- runtimeVersion: '<remove this key>',
119
- },
120
- }
121
- : {}),
122
- updates: {
123
- url: easUpdateURL,
124
- },
125
- };
126
- }
127
- else {
128
- newConfig = {
129
- runtimeVersion: undefined,
130
- android: {
131
- ...exp.android,
132
- runtimeVersion: newAndroidRuntimeVersion,
133
- },
134
- ios: {
135
- ...exp.ios,
136
- runtimeVersion: newIosRuntimeVersion,
137
- },
138
- updates,
139
- };
140
- newConfigOnlyAddedValues = {
141
- ...('runtimeVersion' in exp
142
- ? {
143
- runtimeVersion: '<remove this key>', // top level runtime is redundant if it is specified in both android and ios
144
- }
145
- : {}),
146
- android: {
147
- runtimeVersion: newAndroidRuntimeVersion,
148
- },
149
- ios: {
150
- runtimeVersion: newIosRuntimeVersion,
151
- },
152
- updates: {
153
- url: easUpdateURL,
154
- },
155
- };
156
- }
157
- break;
158
- }
159
- case platform_1.RequestedPlatform.Android: {
160
- newConfig = {
161
- android: {
162
- ...exp.android,
163
- runtimeVersion: newAndroidRuntimeVersion,
164
- },
165
- updates,
166
- };
167
- newConfigOnlyAddedValues = {
168
- android: {
169
- runtimeVersion: newAndroidRuntimeVersion,
170
- },
171
- updates: {
172
- url: easUpdateURL,
173
- },
174
- };
175
- break;
176
- }
177
- case platform_1.RequestedPlatform.Ios: {
178
- newConfig = {
179
- ios: {
180
- ...exp.ios,
181
- runtimeVersion: newIosRuntimeVersion,
182
- },
183
- updates,
184
- };
185
- newConfigOnlyAddedValues = {
186
- ios: {
187
- runtimeVersion: newIosRuntimeVersion,
188
- },
189
- updates: {
190
- url: easUpdateURL,
191
- },
192
- };
193
- break;
194
- }
195
- default: {
196
- throw new Error(`Unsupported platform: ${platform}`);
197
- }
198
- }
199
- const result = await (0, config_1.modifyConfigAsync)(projectDir, newConfig);
200
- const preexistingAndroidRuntimeVersion = (_j = (_h = exp.android) === null || _h === void 0 ? void 0 : _h.runtimeVersion) !== null && _j !== void 0 ? _j : exp.runtimeVersion;
201
- const preexistingIosRuntimeVersion = (_l = (_k = exp.ios) === null || _k === void 0 ? void 0 : _k.runtimeVersion) !== null && _l !== void 0 ? _l : exp.runtimeVersion;
202
- switch (result.type) {
203
- case 'success':
204
- if ((_m = exp.updates) === null || _m === void 0 ? void 0 : _m.url) {
205
- if (exp.updates.url !== easUpdateURL) {
206
- log_1.default.withTick(`Overwrote "${(_o = exp.updates) === null || _o === void 0 ? void 0 : _o.url}" with "${easUpdateURL}" for the updates.url value in app.json`);
207
- }
208
- }
209
- else {
210
- log_1.default.withTick(`Set updates.url value, to "${easUpdateURL}" in app.json`);
211
- }
212
- if (!preexistingAndroidRuntimeVersion &&
213
- [platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
214
- log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Android]} runtimeVersion to "${JSON.stringify((_q = (_p = newConfig.android) === null || _p === void 0 ? void 0 : _p.runtimeVersion) !== null && _q !== void 0 ? _q : newConfig.runtimeVersion)}" in app.json`);
215
- }
216
- if (!preexistingIosRuntimeVersion &&
217
- [platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
218
- log_1.default.withTick(`Set ${platform_1.appPlatformDisplayNames[generated_1.AppPlatform.Ios]} runtimeVersion to "${JSON.stringify((_s = (_r = newConfig.ios) === null || _r === void 0 ? void 0 : _r.runtimeVersion) !== null && _s !== void 0 ? _s : newConfig.runtimeVersion)}" in app.json`);
219
- }
220
- break;
221
- case 'warn': {
222
- log_1.default.addNewLineIfNone();
223
- 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)')}`);
224
- 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`);
225
- log_1.default.log(chalk_1.default.bold(JSON.stringify(newConfigOnlyAddedValues, null, 2)));
226
- log_1.default.addNewLineIfNone();
227
- if (workflows['android'] === eas_build_job_1.Workflow.GENERIC || workflows['ios'] === eas_build_job_1.Workflow.GENERIC) {
228
- log_1.default.warn(`You will also have to manually edit the projects ${chalk_1.default.bold('Expo.plist/AndroidManifest.xml')}. ${(0, log_1.learnMore)('https://expo.fyi/eas-update-config.md#native-configuration')}`);
229
- }
230
- log_1.default.addNewLineIfNone();
231
- throw new Error(result.message);
232
- }
233
- case 'fail':
234
- throw new Error(result.message);
235
- default:
236
- throw new Error('Unexpected result type from modifyConfigAsync');
237
- }
238
- (0, assert_1.default)(result.config, 'A successful result should have a config');
239
- return result.config.expo;
240
- }
241
- function isRuntimeEqual(runtimeVersionA, runtimeVersionB) {
242
- if (typeof runtimeVersionA === 'string' && typeof runtimeVersionB === 'string') {
243
- return runtimeVersionA === runtimeVersionB;
244
- }
245
- else if (typeof runtimeVersionA === 'object' && typeof runtimeVersionB === 'object') {
246
- return runtimeVersionA.policy === runtimeVersionB.policy;
247
- }
248
- else {
249
- return false;
250
- }
251
- }
@@ -1,12 +1,6 @@
1
+ import { Platform as PublishPlatform } from '@expo/config';
1
2
  import EasCommand from '../../commandUtils/EasCommand';
2
- import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
3
- import { ViewBranchQueryVariables } from '../../graphql/generated';
4
- import { PublishPlatform } from '../../project/publish';
5
- export declare const defaultPublishPlatforms: PublishPlatform[];
6
- export declare type PublishPlatformFlag = PublishPlatform | 'all';
7
- export declare function ensureBranchExistsAsync(graphqlClient: ExpoGraphqlClient, { appId, name: branchName }: ViewBranchQueryVariables): Promise<{
8
- branchId: string;
9
- }>;
3
+ export declare const defaultPublishPlatforms: Partial<PublishPlatform>[];
10
4
  export default class UpdatePublish extends EasCommand {
11
5
  static description: string;
12
6
  static flags: {
@@ -27,5 +21,5 @@ export default class UpdatePublish extends EasCommand {
27
21
  getDynamicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicProjectConfigContextField;
28
22
  };
29
23
  runAsync(): Promise<void>;
24
+ private sanitizeFlags;
30
25
  }
31
- export declare const truncatePublishUpdateMessage: (originalMessage: string) => string;