eas-cli 0.31.0 → 0.33.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.
Files changed (57) hide show
  1. package/README.md +29 -28
  2. package/build/build/android/UpdatesModule.js +4 -15
  3. package/build/build/android/configure.js +1 -1
  4. package/build/build/configure.js +12 -6
  5. package/build/build/ios/UpdatesModule.js +4 -16
  6. package/build/build/ios/configure.js +1 -1
  7. package/build/build/utils/appJson.d.ts +1 -0
  8. package/build/build/utils/appJson.js +13 -4
  9. package/build/build/utils/devClient.d.ts +4 -4
  10. package/build/build/utils/devClient.js +8 -16
  11. package/build/commands/branch/publish.js +14 -43
  12. package/build/commands/build/index.d.ts +1 -1
  13. package/build/commands/build/index.js +29 -24
  14. package/build/commands/submit.js +16 -11
  15. package/build/credentials/android/actions/SetupGoogleServiceAccountKey.js +3 -3
  16. package/build/credentials/context.d.ts +1 -1
  17. package/build/credentials/context.js +5 -5
  18. package/build/credentials/errors.d.ts +3 -0
  19. package/build/credentials/errors.js +7 -1
  20. package/build/credentials/ios/IosCredentialsProvider.js +1 -1
  21. package/build/credentials/ios/actions/AscApiKeyUtils.d.ts +5 -0
  22. package/build/credentials/ios/actions/AscApiKeyUtils.js +63 -0
  23. package/build/credentials/ios/actions/DistributionCertificateUtils.js +5 -5
  24. package/build/credentials/ios/actions/SetupTargetBuildCredentials.js +1 -1
  25. package/build/credentials/ios/appstore/AppStoreApi.d.ts +7 -1
  26. package/build/credentials/ios/appstore/AppStoreApi.js +17 -0
  27. package/build/credentials/ios/appstore/Credentials.js +3 -3
  28. package/build/credentials/ios/appstore/Credentials.types.d.ts +13 -0
  29. package/build/credentials/ios/appstore/ascApiKey.d.ts +9 -0
  30. package/build/credentials/ios/appstore/ascApiKey.js +99 -0
  31. package/build/credentials/ios/credentials.d.ts +17 -0
  32. package/build/credentials/ios/credentials.js +16 -1
  33. package/build/credentials/manager/ManageAndroid.js +1 -1
  34. package/build/credentials/manager/ManageIos.js +1 -1
  35. package/build/graphql/generated.d.ts +49 -113
  36. package/build/graphql/generated.js +24 -28
  37. package/build/log.d.ts +11 -1
  38. package/build/log.js +21 -10
  39. package/build/project/android/applicationId.d.ts +1 -1
  40. package/build/project/android/applicationId.js +7 -6
  41. package/build/project/ios/bundleIdentifier.d.ts +1 -1
  42. package/build/project/ios/bundleIdentifier.js +7 -6
  43. package/build/submit/ArchiveSource.d.ts +7 -2
  44. package/build/submit/ArchiveSource.js +94 -11
  45. package/build/submit/ios/AscApiKeySource.d.ts +28 -0
  46. package/build/submit/ios/AscApiKeySource.js +51 -0
  47. package/build/submit/ios/IosSubmitCommand.d.ts +2 -0
  48. package/build/submit/ios/IosSubmitCommand.js +55 -3
  49. package/build/submit/ios/IosSubmitter.d.ts +3 -1
  50. package/build/submit/ios/IosSubmitter.js +48 -4
  51. package/build/submit/submit.js +1 -1
  52. package/build/submit/utils/builds.d.ts +3 -1
  53. package/build/submit/utils/builds.js +6 -6
  54. package/build/utils/profiles.d.ts +11 -0
  55. package/build/utils/profiles.js +39 -0
  56. package/oclif.manifest.json +1 -1
  57. package/package.json +6 -6
package/README.md CHANGED
@@ -73,7 +73,7 @@ ALIASES
73
73
  $ eas login
74
74
  ```
75
75
 
76
- _See code: [src/commands/account/login.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/account/login.js)_
76
+ _See code: [src/commands/account/login.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/account/login.js)_
77
77
 
78
78
  ## `eas account:logout`
79
79
 
@@ -87,7 +87,7 @@ ALIASES
87
87
  $ eas logout
88
88
  ```
89
89
 
90
- _See code: [src/commands/account/logout.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/account/logout.js)_
90
+ _See code: [src/commands/account/logout.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/account/logout.js)_
91
91
 
92
92
  ## `eas account:view`
93
93
 
@@ -101,7 +101,7 @@ ALIASES
101
101
  $ eas whoami
102
102
  ```
103
103
 
104
- _See code: [src/commands/account/view.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/account/view.js)_
104
+ _See code: [src/commands/account/view.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/account/view.js)_
105
105
 
106
106
  ## `eas analytics [STATUS]`
107
107
 
@@ -112,7 +112,7 @@ USAGE
112
112
  $ eas analytics [STATUS]
113
113
  ```
114
114
 
115
- _See code: [src/commands/analytics.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/analytics.js)_
115
+ _See code: [src/commands/analytics.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/analytics.js)_
116
116
 
117
117
  ## `eas build`
118
118
 
@@ -138,14 +138,15 @@ OPTIONS
138
138
 
139
139
  --non-interactive Run command in non-interactive mode
140
140
 
141
- --profile=PROFILE_NAME [default: release] Name of the build profile from eas.json
141
+ --profile=PROFILE_NAME Name of the build profile from eas.json. Defaults to "production" if defined
142
+ in eas.json.
142
143
 
143
144
  --skip-project-configuration Skip project configuration
144
145
 
145
146
  --[no-]wait Wait for build(s) to complete
146
147
  ```
147
148
 
148
- _See code: [src/commands/build/index.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/build/index.js)_
149
+ _See code: [src/commands/build/index.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/build/index.js)_
149
150
 
150
151
  ## `eas build:cancel [BUILD_ID]`
151
152
 
@@ -156,7 +157,7 @@ USAGE
156
157
  $ eas build:cancel [BUILD_ID]
157
158
  ```
158
159
 
159
- _See code: [src/commands/build/cancel.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/build/cancel.js)_
160
+ _See code: [src/commands/build/cancel.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/build/cancel.js)_
160
161
 
161
162
  ## `eas build:configure`
162
163
 
@@ -170,7 +171,7 @@ OPTIONS
170
171
  -p, --platform=(android|ios|all) Platform to configure
171
172
  ```
172
173
 
173
- _See code: [src/commands/build/configure.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/build/configure.js)_
174
+ _See code: [src/commands/build/configure.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/build/configure.js)_
174
175
 
175
176
  ## `eas build:list`
176
177
 
@@ -203,7 +204,7 @@ OPTIONS
203
204
  --status=(new|in-queue|in-progress|errored|finished|canceled)
204
205
  ```
205
206
 
206
- _See code: [src/commands/build/list.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/build/list.js)_
207
+ _See code: [src/commands/build/list.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/build/list.js)_
207
208
 
208
209
  ## `eas build:view [BUILD_ID]`
209
210
 
@@ -217,7 +218,7 @@ OPTIONS
217
218
  --json Enable JSON output, non-JSON messages will be printed to stderr
218
219
  ```
219
220
 
220
- _See code: [src/commands/build/view.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/build/view.js)_
221
+ _See code: [src/commands/build/view.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/build/view.js)_
221
222
 
222
223
  ## `eas config`
223
224
 
@@ -232,7 +233,7 @@ OPTIONS
232
233
  --profile=profile
233
234
  ```
234
235
 
235
- _See code: [src/commands/config.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/config.js)_
236
+ _See code: [src/commands/config.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/config.js)_
236
237
 
237
238
  ## `eas credentials`
238
239
 
@@ -243,7 +244,7 @@ USAGE
243
244
  $ eas credentials
244
245
  ```
245
246
 
246
- _See code: [src/commands/credentials.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/credentials.js)_
247
+ _See code: [src/commands/credentials.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/credentials.js)_
247
248
 
248
249
  ## `eas device:create`
249
250
 
@@ -254,7 +255,7 @@ USAGE
254
255
  $ eas device:create
255
256
  ```
256
257
 
257
- _See code: [src/commands/device/create.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/device/create.js)_
258
+ _See code: [src/commands/device/create.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/device/create.js)_
258
259
 
259
260
  ## `eas device:list`
260
261
 
@@ -268,7 +269,7 @@ OPTIONS
268
269
  --apple-team-id=apple-team-id
269
270
  ```
270
271
 
271
- _See code: [src/commands/device/list.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/device/list.js)_
272
+ _See code: [src/commands/device/list.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/device/list.js)_
272
273
 
273
274
  ## `eas device:view [UDID]`
274
275
 
@@ -279,7 +280,7 @@ USAGE
279
280
  $ eas device:view [UDID]
280
281
  ```
281
282
 
282
- _See code: [src/commands/device/view.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/device/view.js)_
283
+ _See code: [src/commands/device/view.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/device/view.js)_
283
284
 
284
285
  ## `eas diagnostics`
285
286
 
@@ -290,7 +291,7 @@ USAGE
290
291
  $ eas diagnostics
291
292
  ```
292
293
 
293
- _See code: [src/commands/diagnostics.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/diagnostics.js)_
294
+ _See code: [src/commands/diagnostics.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/diagnostics.js)_
294
295
 
295
296
  ## `eas help [COMMAND]`
296
297
 
@@ -318,7 +319,7 @@ USAGE
318
319
  $ eas project:info
319
320
  ```
320
321
 
321
- _See code: [src/commands/project/info.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/project/info.js)_
322
+ _See code: [src/commands/project/info.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/project/info.js)_
322
323
 
323
324
  ## `eas project:init`
324
325
 
@@ -332,7 +333,7 @@ ALIASES
332
333
  $ eas init
333
334
  ```
334
335
 
335
- _See code: [src/commands/project/init.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/project/init.js)_
336
+ _See code: [src/commands/project/init.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/project/init.js)_
336
337
 
337
338
  ## `eas secret:create`
338
339
 
@@ -349,7 +350,7 @@ OPTIONS
349
350
  --value=value Value of the secret
350
351
  ```
351
352
 
352
- _See code: [src/commands/secret/create.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/secret/create.js)_
353
+ _See code: [src/commands/secret/create.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/secret/create.js)_
353
354
 
354
355
  ## `eas secret:delete`
355
356
 
@@ -366,7 +367,7 @@ DESCRIPTION
366
367
  Unsure where to find the secret's ID? Run eas secrets:list
367
368
  ```
368
369
 
369
- _See code: [src/commands/secret/delete.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/secret/delete.js)_
370
+ _See code: [src/commands/secret/delete.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/secret/delete.js)_
370
371
 
371
372
  ## `eas secret:list`
372
373
 
@@ -377,7 +378,7 @@ USAGE
377
378
  $ eas secret:list
378
379
  ```
379
380
 
380
- _See code: [src/commands/secret/list.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/secret/list.js)_
381
+ _See code: [src/commands/secret/list.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/secret/list.js)_
381
382
 
382
383
  ## `eas submit`
383
384
 
@@ -394,7 +395,7 @@ OPTIONS
394
395
  --non-interactive Run command in non-interactive mode
395
396
  --path=path Path to the .apk/.aab/.ipa file
396
397
 
397
- --profile=profile Name of the submit profile from eas.json. Defaults to "release" if defined in
398
+ --profile=profile Name of the submit profile from eas.json. Defaults to "production" if defined in
398
399
  eas.json.
399
400
 
400
401
  --url=url App archive url
@@ -410,7 +411,7 @@ ALIASES
410
411
  $ eas build:submit
411
412
  ```
412
413
 
413
- _See code: [src/commands/submit.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/submit.js)_
414
+ _See code: [src/commands/submit.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/submit.js)_
414
415
 
415
416
  ## `eas webhook:create`
416
417
 
@@ -429,7 +430,7 @@ OPTIONS
429
430
  --url=url Webhook URL
430
431
  ```
431
432
 
432
- _See code: [src/commands/webhook/create.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/webhook/create.js)_
433
+ _See code: [src/commands/webhook/create.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/webhook/create.js)_
433
434
 
434
435
  ## `eas webhook:delete [ID]`
435
436
 
@@ -443,7 +444,7 @@ ARGUMENTS
443
444
  ID ID of the webhook to delete
444
445
  ```
445
446
 
446
- _See code: [src/commands/webhook/delete.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/webhook/delete.js)_
447
+ _See code: [src/commands/webhook/delete.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/webhook/delete.js)_
447
448
 
448
449
  ## `eas webhook:list`
449
450
 
@@ -457,7 +458,7 @@ OPTIONS
457
458
  --event=(BUILD) Event type that triggers the webhook
458
459
  ```
459
460
 
460
- _See code: [src/commands/webhook/list.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/webhook/list.js)_
461
+ _See code: [src/commands/webhook/list.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/webhook/list.js)_
461
462
 
462
463
  ## `eas webhook:update`
463
464
 
@@ -477,7 +478,7 @@ OPTIONS
477
478
  --url=url Webhook URL
478
479
  ```
479
480
 
480
- _See code: [src/commands/webhook/update.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/webhook/update.js)_
481
+ _See code: [src/commands/webhook/update.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/webhook/update.js)_
481
482
 
482
483
  ## `eas webhook:view ID`
483
484
 
@@ -491,5 +492,5 @@ ARGUMENTS
491
492
  ID ID of the webhook to view
492
493
  ```
493
494
 
494
- _See code: [src/commands/webhook/view.js](https://github.com/expo/eas-cli/blob/v0.31.0/packages/eas-cli/src/commands/webhook/view.js)_
495
+ _See code: [src/commands/webhook/view.js](https://github.com/expo/eas-cli/blob/v0.33.1/packages/eas-cli/src/commands/webhook/view.js)_
495
496
  <!-- commandsstop -->
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports.syncUpdatesConfigurationAsync = exports.configureUpdatesAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
8
7
  const projectUtils_1 = require("../../project/projectUtils");
9
8
  const actions_1 = require("../../user/actions");
@@ -11,12 +10,6 @@ const updates_1 = require("../utils/updates");
11
10
  async function configureUpdatesAsync(projectDir, exp) {
12
11
  (0, updates_1.ensureValidVersions)(exp);
13
12
  const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
14
- const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
15
- const buildGradleContents = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
16
- if (!config_plugins_1.AndroidConfig.Updates.isBuildGradleConfigured(projectDir, buildGradleContents)) {
17
- const updatedBuildGradleContents = config_plugins_1.AndroidConfig.Updates.ensureBuildGradleContainsConfigurationScript(projectDir, buildGradleContents);
18
- await fs_extra_1.default.writeFile(buildGradlePath, updatedBuildGradleContents);
19
- }
20
13
  const androidManifestPath = await config_plugins_1.AndroidConfig.Paths.getAndroidManifestAsync(projectDir);
21
14
  const androidManifest = await getAndroidManifestAsync(projectDir);
22
15
  if (!config_plugins_1.AndroidConfig.Updates.isMainApplicationMetaDataSynced(exp, androidManifest, accountName)) {
@@ -29,7 +22,7 @@ async function syncUpdatesConfigurationAsync(projectDir, exp) {
29
22
  (0, updates_1.ensureValidVersions)(exp);
30
23
  const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
31
24
  try {
32
- await ensureUpdatesConfiguredAsync(projectDir, exp);
25
+ await ensureUpdatesConfiguredAsync(projectDir);
33
26
  }
34
27
  catch (error) {
35
28
  log_1.default.error('expo-updates module is not configured. Please run "eas build:configure" first to configure the project');
@@ -46,13 +39,9 @@ async function syncUpdatesConfigurationAsync(projectDir, exp) {
46
39
  }
47
40
  }
48
41
  exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
49
- async function ensureUpdatesConfiguredAsync(projectDir, exp) {
50
- const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
51
- const buildGradleContents = await fs_extra_1.default.readFile(buildGradlePath, 'utf8');
52
- if (!config_plugins_1.AndroidConfig.Updates.isBuildGradleConfigured(projectDir, buildGradleContents)) {
53
- const gradleScriptApply = config_plugins_1.AndroidConfig.Updates.formatApplyLineForBuildGradle(projectDir);
54
- throw new Error(`Missing ${gradleScriptApply} in ${buildGradlePath}`);
55
- }
42
+ // Note: we assume here that Expo modules are properly configured in the project. Aside from that,
43
+ // all that is needed on Expo SDK 43+ to configure expo-updates configuration in AndroidManifest.xml
44
+ async function ensureUpdatesConfiguredAsync(projectDir) {
56
45
  const androidManifest = await getAndroidManifestAsync(projectDir);
57
46
  if (!config_plugins_1.AndroidConfig.Updates.isMainApplicationMetaDataSet(androidManifest)) {
58
47
  throw new Error('Missing values in AndroidManifest.xml');
@@ -16,7 +16,7 @@ async function configureAndroidAsync(ctx) {
16
16
  await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
17
17
  return;
18
18
  }
19
- (0, applicationId_1.warnIfAndroidPackageDefinedInAppConfigForGenericProject)(ctx.projectDir, ctx.exp);
19
+ (0, applicationId_1.warnIfAndroidPackageDefinedInAppConfigForBareWorkflowProject)(ctx.projectDir, ctx.exp);
20
20
  await config_plugins_1.AndroidConfig.EasBuild.configureEasBuildAsync(ctx.projectDir);
21
21
  const easGradlePath = config_plugins_1.AndroidConfig.EasBuild.getEasBuildGradlePath(ctx.projectDir);
22
22
  await vcs_1.default.trackFileAsync(easGradlePath);
@@ -76,19 +76,21 @@ async function configureAsync(options) {
76
76
  exports.configureAsync = configureAsync;
77
77
  const EAS_JSON_MANAGED_DEFAULT = {
78
78
  build: {
79
- release: {},
80
79
  development: {
81
80
  developmentClient: true,
82
81
  distribution: 'internal',
83
82
  },
83
+ preview: {
84
+ distribution: 'internal',
85
+ },
86
+ production: {},
84
87
  },
85
88
  submit: {
86
- release: {},
89
+ production: {},
87
90
  },
88
91
  };
89
- const EAS_JSON_GENERIC_DEFAULT = {
92
+ const EAS_JSON_BARE_DEFAULT = {
90
93
  build: {
91
- release: {},
92
94
  development: {
93
95
  distribution: 'internal',
94
96
  android: {
@@ -98,9 +100,13 @@ const EAS_JSON_GENERIC_DEFAULT = {
98
100
  buildConfiguration: 'Debug',
99
101
  },
100
102
  },
103
+ preview: {
104
+ distribution: 'internal',
105
+ },
106
+ production: {},
101
107
  },
102
108
  submit: {
103
- release: {},
109
+ production: {},
104
110
  },
105
111
  };
106
112
  async function ensureEasJsonExistsAsync(ctx) {
@@ -112,7 +118,7 @@ async function ensureEasJsonExistsAsync(ctx) {
112
118
  return;
113
119
  }
114
120
  const easJson = ctx.hasAndroidNativeProject && ctx.hasIosNativeProject
115
- ? EAS_JSON_GENERIC_DEFAULT
121
+ ? EAS_JSON_BARE_DEFAULT
116
122
  : EAS_JSON_MANAGED_DEFAULT;
117
123
  await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
118
124
  await vcs_1.default.trackFileAsync(easJsonPath);
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readChannelSafelyAsync = exports.readReleaseChannelSafelyAsync = exports.syncUpdatesConfigurationAsync = exports.configureUpdatesAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_plugins_1 = require("@expo/config-plugins");
6
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
6
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
8
7
  const projectUtils_1 = require("../../project/projectUtils");
9
8
  const actions_1 = require("../../user/actions");
@@ -13,13 +12,6 @@ const plist_1 = require("./plist");
13
12
  async function configureUpdatesAsync(projectDir, exp) {
14
13
  (0, updates_1.ensureValidVersions)(exp);
15
14
  const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
16
- let xcodeProject = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(projectDir);
17
- if (!config_plugins_1.IOSConfig.Updates.isShellScriptBuildPhaseConfigured(projectDir, xcodeProject)) {
18
- xcodeProject = config_plugins_1.IOSConfig.Updates.ensureBundleReactNativePhaseContainsConfigurationScript(projectDir, xcodeProject);
19
- await fs_extra_1.default.writeFile(config_plugins_1.IOSConfig.Paths.getPBXProjectPath(projectDir),
20
- // eslint-disable-next-line node/no-sync
21
- xcodeProject.writeSync());
22
- }
23
15
  let expoPlist = await readExpoPlistAsync(projectDir);
24
16
  if (!config_plugins_1.IOSConfig.Updates.isPlistConfigurationSynced(exp, expoPlist, accountName)) {
25
17
  expoPlist = config_plugins_1.IOSConfig.Updates.setUpdatesConfig(exp, expoPlist, accountName);
@@ -32,7 +24,7 @@ async function syncUpdatesConfigurationAsync(projectDir, exp) {
32
24
  (0, updates_1.ensureValidVersions)(exp);
33
25
  const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
34
26
  try {
35
- await ensureUpdatesConfiguredAsync(projectDir, exp);
27
+ await ensureUpdatesConfiguredAsync(projectDir);
36
28
  }
37
29
  catch (error) {
38
30
  log_1.default.error('expo-updates module is not configured. Please run "eas build:configure" first to configure the project');
@@ -48,13 +40,9 @@ async function syncUpdatesConfigurationAsync(projectDir, exp) {
48
40
  }
49
41
  }
50
42
  exports.syncUpdatesConfigurationAsync = syncUpdatesConfigurationAsync;
51
- async function ensureUpdatesConfiguredAsync(projectDir, exp) {
52
- const xcodeProject = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(projectDir);
53
- if (!config_plugins_1.IOSConfig.Updates.isShellScriptBuildPhaseConfigured(projectDir, xcodeProject)) {
54
- const script = 'expo-updates/scripts/create-manifest-ios.sh';
55
- const buildPhase = '"Bundle React Native code and images"';
56
- throw new Error(`Path to ${script} is missing in a ${buildPhase} build phase.`);
57
- }
43
+ // Note: we assume here that Expo modules are properly configured in the project. Aside from that,
44
+ // all that is needed on Expo SDK 43+ to configure expo-updates configuration in Expo.plist
45
+ async function ensureUpdatesConfiguredAsync(projectDir) {
58
46
  const expoPlist = await readExpoPlistAsync(projectDir);
59
47
  if (!config_plugins_1.IOSConfig.Updates.isPlistConfigurationSet(expoPlist)) {
60
48
  throw new Error('Missing values in Expo.plist');
@@ -14,7 +14,7 @@ async function configureIosAsync(ctx) {
14
14
  await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
15
15
  return;
16
16
  }
17
- (0, bundleIdentifier_1.warnIfBundleIdentifierDefinedInAppConfigForGenericProject)(ctx.projectDir, ctx.exp);
17
+ (0, bundleIdentifier_1.warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject)(ctx.projectDir, ctx.exp);
18
18
  if ((0, updates_1.isExpoUpdatesInstalled)(ctx.projectDir)) {
19
19
  await (0, UpdatesModule_1.configureUpdatesAsync)(ctx.projectDir, ctx.exp);
20
20
  }
@@ -3,3 +3,4 @@ export declare function updateAppJsonConfigAsync({ projectDir, exp, }: {
3
3
  projectDir: string;
4
4
  exp: ExpoConfig.ExpoConfig;
5
5
  }, modifyConfig: (config: any) => void): Promise<void>;
6
+ export declare function readAppJson(appJsonPath: string): any;
@@ -1,18 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateAppJsonConfigAsync = void 0;
3
+ exports.readAppJson = exports.updateAppJsonConfigAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ExpoConfig = (0, tslib_1.__importStar)(require("@expo/config"));
6
+ const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
6
7
  const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
7
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
8
8
  async function updateAppJsonConfigAsync({ projectDir, exp, }, modifyConfig) {
9
9
  var _a;
10
10
  const paths = ExpoConfig.getConfigFilePaths(projectDir);
11
11
  (0, assert_1.default)(paths.staticConfigPath, "can't update dynamic config");
12
- const rawStaticConfig = await fs_extra_1.default.readJSON(paths.staticConfigPath);
12
+ const rawStaticConfig = readAppJson(paths.staticConfigPath);
13
13
  rawStaticConfig.expo = (_a = rawStaticConfig.expo) !== null && _a !== void 0 ? _a : {};
14
14
  modifyConfig(rawStaticConfig.expo);
15
- await fs_extra_1.default.writeJson(paths.staticConfigPath, rawStaticConfig, { spaces: 2 });
15
+ await json_file_1.default.writeAsync(paths.staticConfigPath, rawStaticConfig, { json5: false });
16
16
  modifyConfig(exp);
17
17
  }
18
18
  exports.updateAppJsonConfigAsync = updateAppJsonConfigAsync;
19
+ // TODO: remove this once @expo/config exports getStaticConfig
20
+ function readAppJson(appJsonPath) {
21
+ const config = json_file_1.default.read(appJsonPath, { json5: true });
22
+ if (config) {
23
+ return config;
24
+ }
25
+ throw new Error(`Failed to read app.json`);
26
+ }
27
+ exports.readAppJson = readAppJson;
@@ -1,7 +1,7 @@
1
- import { Platform } from '@expo/eas-build-job';
2
- export declare function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, platforms, profile, nonInteractive, }: {
1
+ import { BuildProfile } from '@expo/eas-json';
2
+ import { ProfileData } from '../../utils/profiles';
3
+ export declare function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive, buildProfiles, }: {
3
4
  projectDir: string;
4
- platforms: Platform[];
5
- profile: string;
6
5
  nonInteractive?: boolean;
6
+ buildProfiles?: ProfileData<BuildProfile>[];
7
7
  }): Promise<void>;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureExpoDevClientInstalledForDevClientBuildsAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
- const eas_json_1 = require("@expo/eas-json");
7
6
  const errors_1 = require("@oclif/errors");
8
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
9
8
  const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
@@ -13,24 +12,17 @@ const platform_1 = require("../../platform");
13
12
  const workflow_1 = require("../../project/workflow");
14
13
  const prompts_1 = require("../../prompts");
15
14
  const expoCommand_1 = require("../../utils/expoCommand");
16
- const zipObject_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/zipObject"));
17
15
  const repository_1 = require("./repository");
18
- async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, platforms, profile, nonInteractive = false, }) {
16
+ async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir, nonInteractive = false, buildProfiles = [], }) {
19
17
  if (await isExpoDevClientInstalledAsync(projectDir)) {
20
18
  return;
21
19
  }
22
- const easJsonReader = new eas_json_1.EasJsonReader(projectDir);
23
- const devClientPerPlatformList = await Promise.all(platforms.map(async (platform) => {
24
- var _a;
25
- const buildProfile = await easJsonReader.readBuildProfileAsync(platform, profile);
26
- return (_a = buildProfile.developmentClient) !== null && _a !== void 0 ? _a : false;
27
- }));
28
- const isDevClientRequired = devClientPerPlatformList.some(i => i);
29
- if (!isDevClientRequired) {
20
+ const buildProfilesWithDevelopmentClientRequired = buildProfiles.filter(buildProfile => buildProfile.profile.developmentClient);
21
+ const isDevelopmentClientRequired = buildProfilesWithDevelopmentClientRequired.some(Boolean);
22
+ if (!isDevelopmentClientRequired) {
30
23
  return;
31
24
  }
32
- const devClientPerPlatform = (0, zipObject_1.default)(platforms, devClientPerPlatformList);
33
- const platformsToCheck = platforms.filter(platform => devClientPerPlatform[platform]);
25
+ const platformsToCheck = buildProfilesWithDevelopmentClientRequired.map(({ platform }) => platform);
34
26
  const workflowPerPlatformList = await Promise.all(platformsToCheck.map(platform => (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)));
35
27
  log_1.default.newLine();
36
28
  log_1.default.error(`You want to build a development client build for platforms: ${platformsToCheck
@@ -47,15 +39,15 @@ async function ensureExpoDevClientInstalledForDevClientBuildsAsync({ projectDir,
47
39
  await installExpoDevClientAsync(projectDir, { nonInteractive });
48
40
  }
49
41
  else {
50
- (0, errors_1.error)(`Install ${chalk_1.default.bold('expo-dev-client')} on your own and come back later.`, {
42
+ (0, errors_1.error)(`Install ${chalk_1.default.bold('expo-dev-client')} manually and come back later.`, {
51
43
  exit: 1,
52
44
  });
53
45
  }
54
46
  }
55
47
  else {
56
- log_1.default.warn(`Unfortunately, you need to install ${chalk_1.default.bold('expo-dev-client')} on your own.`);
48
+ log_1.default.warn(`You'll need to install ${chalk_1.default.bold('expo-dev-client')} manually.`);
57
49
  log_1.default.warn((0, log_1.learnMore)('https://docs.expo.dev/clients/installation/', {
58
- learnMoreMessage: 'See installation instructions on how to do it',
50
+ learnMoreMessage: 'See installation instructions on how to do it.',
59
51
  dim: false,
60
52
  }));
61
53
  log_1.default.warn('If you proceed anyway, you might not get the build you want.');
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultPublishPlatforms = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const sdk_runtime_versions_1 = require("@expo/sdk-runtime-versions");
6
+ const config_plugins_1 = require("@expo/config-plugins");
7
+ const eas_build_job_1 = require("@expo/eas-build-job");
7
8
  const command_1 = require("@oclif/command");
8
9
  const assert_1 = (0, tslib_1.__importDefault)(require("assert"));
9
10
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
@@ -16,6 +17,7 @@ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
16
17
  const ora_1 = require("../../ora");
17
18
  const projectUtils_1 = require("../../project/projectUtils");
18
19
  const publish_1 = require("../../project/publish");
20
+ const workflow_1 = require("../../project/workflow");
19
21
  const prompts_1 = require("../../prompts");
20
22
  const utils_1 = require("../../update/utils");
21
23
  const uniqBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/uniqBy"));
@@ -69,7 +71,7 @@ class BranchPublish extends EasCommand_1.default {
69
71
  skipSDKVersionRequirement: true,
70
72
  isPublicConfig: true,
71
73
  });
72
- const runtimeVersions = getRuntimeVersionObject(exp, platformFlag, projectDir);
74
+ const runtimeVersions = await getRuntimeVersionObjectAsync(exp, platformFlag, projectDir);
73
75
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
74
76
  if (!branchName && autoFlag) {
75
77
  branchName =
@@ -295,50 +297,19 @@ BranchPublish.flags = {
295
297
  default: false,
296
298
  }),
297
299
  };
298
- function getRuntimeVersionObject(exp, platformFlag, projectDir) {
300
+ async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
299
301
  var _a, _b;
300
- let { runtimeVersion: defaultRuntimeVersion, sdkVersion } = exp;
301
- // When a SDK version is supplied instead of a runtime version and we're in the managed workflow
302
- // construct the runtimeVersion with special meaning indicating that the runtime is an
303
- // Expo SDK preset runtime that can be launched in Expo Go.
304
- const isManagedProject = (0, config_1.getDefaultTarget)(projectDir) === 'managed';
305
- if (!defaultRuntimeVersion && sdkVersion && isManagedProject) {
306
- log_1.default.withTick('Generating runtime version from sdk version');
307
- defaultRuntimeVersion = (0, sdk_runtime_versions_1.getRuntimeVersionForSDKVersion)(sdkVersion);
308
- }
309
- const iOSRuntimeVersion = (_a = exp.ios) === null || _a === void 0 ? void 0 : _a.runtimeVersion; // TODO-JJ remove cast to any
310
- const androidRuntimeVersion = (_b = exp.android) === null || _b === void 0 ? void 0 : _b.runtimeVersion; // TODO-JJ remove cast to any
311
- let runtimeVersions;
312
- switch (platformFlag) {
313
- case 'ios': {
314
- runtimeVersions = {
315
- ios: iOSRuntimeVersion !== null && iOSRuntimeVersion !== void 0 ? iOSRuntimeVersion : defaultRuntimeVersion,
316
- };
317
- break;
318
- }
319
- case 'android': {
320
- runtimeVersions = {
321
- android: androidRuntimeVersion !== null && androidRuntimeVersion !== void 0 ? androidRuntimeVersion : defaultRuntimeVersion,
322
- };
323
- break;
324
- }
325
- case 'all': {
326
- runtimeVersions = {
327
- ios: iOSRuntimeVersion !== null && iOSRuntimeVersion !== void 0 ? iOSRuntimeVersion : defaultRuntimeVersion,
328
- android: androidRuntimeVersion !== null && androidRuntimeVersion !== void 0 ? androidRuntimeVersion : defaultRuntimeVersion,
329
- };
330
- break;
302
+ const platforms = (platformFlag === 'all' ? ['android', 'ios'] : [platformFlag]);
303
+ for (const platform of platforms) {
304
+ const isPolicy = typeof ((_b = (_a = exp[platform]) === null || _a === void 0 ? void 0 : _a.runtimeVersion) !== null && _b !== void 0 ? _b : exp.runtimeVersion) === 'object';
305
+ if (isPolicy) {
306
+ const isManaged = (await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform)) === eas_build_job_1.Workflow.MANAGED;
307
+ if (!isManaged) {
308
+ throw new Error('Runtime version policies are only supported in the managed workflow.');
309
+ }
331
310
  }
332
- default:
333
- throw new Error('Platform flag must be "ios", "android", or "all"');
334
- }
335
- if (Object.values(runtimeVersions).some(runtime => !runtime)) {
336
- throw new Error("Couldn't find a 'runtimeVersion' for every platform. Please specify it under the 'expo' key in 'app.json'");
337
- }
338
- if (Object.values(runtimeVersions).some(runtime => typeof runtime !== 'string')) {
339
- throw new Error(`Please ensure that all of the runtime versions defined in the app.json are strings.`);
340
311
  }
341
- return runtimeVersions;
312
+ return Object.fromEntries(platforms.map(platform => [platform, config_plugins_1.Updates.getRuntimeVersion(exp, platform)]));
342
313
  }
343
314
  function formatUpdateTitle(update) {
344
315
  const { message, createdAt, actor, runtimeVersion } = update;
@@ -7,7 +7,7 @@ export default class Build extends EasCommand {
7
7
  'skip-credentials-check': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
8
  json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
9
  'skip-project-configuration': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- profile: flags.IOptionFlag<string>;
10
+ profile: flags.IOptionFlag<string | undefined>;
11
11
  'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
12
  local: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
13
  wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;