eas-cli 0.40.0 → 0.41.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.
package/README.md CHANGED
@@ -40,6 +40,7 @@ eas --help COMMAND
40
40
  * [`eas build`](#eas-build)
41
41
  * [`eas build:cancel [BUILD_ID]`](#eas-buildcancel-build_id)
42
42
  * [`eas build:configure`](#eas-buildconfigure)
43
+ * [`eas build:inspect`](#eas-buildinspect)
43
44
  * [`eas build:list`](#eas-buildlist)
44
45
  * [`eas build:view [BUILD_ID]`](#eas-buildview-build_id)
45
46
  * [`eas config`](#eas-config)
@@ -73,7 +74,7 @@ ALIASES
73
74
  $ eas login
74
75
  ```
75
76
 
76
- _See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/account/login.ts)_
77
+ _See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/account/login.ts)_
77
78
 
78
79
  ## `eas account:logout`
79
80
 
@@ -87,7 +88,7 @@ ALIASES
87
88
  $ eas logout
88
89
  ```
89
90
 
90
- _See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/account/logout.ts)_
91
+ _See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/account/logout.ts)_
91
92
 
92
93
  ## `eas account:view`
93
94
 
@@ -101,7 +102,7 @@ ALIASES
101
102
  $ eas whoami
102
103
  ```
103
104
 
104
- _See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/account/view.ts)_
105
+ _See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/account/view.ts)_
105
106
 
106
107
  ## `eas analytics [STATUS]`
107
108
 
@@ -112,7 +113,7 @@ USAGE
112
113
  $ eas analytics [STATUS]
113
114
  ```
114
115
 
115
- _See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/analytics.ts)_
116
+ _See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/analytics.ts)_
116
117
 
117
118
  ## `eas build`
118
119
 
@@ -146,7 +147,7 @@ OPTIONS
146
147
  --[no-]wait Wait for build(s) to complete
147
148
  ```
148
149
 
149
- _See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/index.ts)_
150
+ _See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/build/index.ts)_
150
151
 
151
152
  ## `eas build:cancel [BUILD_ID]`
152
153
 
@@ -157,7 +158,7 @@ USAGE
157
158
  $ eas build:cancel [BUILD_ID]
158
159
  ```
159
160
 
160
- _See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/cancel.ts)_
161
+ _See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/build/cancel.ts)_
161
162
 
162
163
  ## `eas build:configure`
163
164
 
@@ -171,7 +172,39 @@ OPTIONS
171
172
  -p, --platform=(android|ios|all) Platform to configure
172
173
  ```
173
174
 
174
- _See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/configure.ts)_
175
+ _See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/build/configure.ts)_
176
+
177
+ ## `eas build:inspect`
178
+
179
+ Inspect the state of the project at specific build stages. Useful for troubleshooting.
180
+
181
+ ```
182
+ USAGE
183
+ $ eas build:inspect
184
+
185
+ OPTIONS
186
+ -p, --platform=(android|ios)
187
+ (required)
188
+
189
+ -s, --stage=(archive|pre-build|post-build)
190
+ (required) Stage of the build you want to inspect.
191
+ archive - builds the project archive that would be uploaded to EAS when building
192
+ pre-build - prepares the project to be built with Gradle/Xcode. Does not run the native build.
193
+ post-build - builds the native project and leaves the output directory for inspection
194
+
195
+ --force
196
+ Delete OUTPUT_DIRECTORY if it already exists.
197
+
198
+ --output=OUTPUT_DIRECTORY
199
+ (required) Output directory.
200
+
201
+ --profile=PROFILE_NAME
202
+ Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.
203
+
204
+ --verbose
205
+ ```
206
+
207
+ _See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/build/inspect.ts)_
175
208
 
176
209
  ## `eas build:list`
177
210
 
@@ -204,7 +237,7 @@ OPTIONS
204
237
  --status=(new|in-queue|in-progress|errored|finished|canceled)
205
238
  ```
206
239
 
207
- _See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/list.ts)_
240
+ _See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/build/list.ts)_
208
241
 
209
242
  ## `eas build:view [BUILD_ID]`
210
243
 
@@ -218,7 +251,7 @@ OPTIONS
218
251
  --json Enable JSON output, non-JSON messages will be printed to stderr
219
252
  ```
220
253
 
221
- _See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/view.ts)_
254
+ _See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/build/view.ts)_
222
255
 
223
256
  ## `eas config`
224
257
 
@@ -233,7 +266,7 @@ OPTIONS
233
266
  --profile=profile
234
267
  ```
235
268
 
236
- _See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/config.ts)_
269
+ _See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/config.ts)_
237
270
 
238
271
  ## `eas credentials`
239
272
 
@@ -244,7 +277,7 @@ USAGE
244
277
  $ eas credentials
245
278
  ```
246
279
 
247
- _See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/credentials.ts)_
280
+ _See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/credentials.ts)_
248
281
 
249
282
  ## `eas device:create`
250
283
 
@@ -255,7 +288,7 @@ USAGE
255
288
  $ eas device:create
256
289
  ```
257
290
 
258
- _See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/device/create.ts)_
291
+ _See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/device/create.ts)_
259
292
 
260
293
  ## `eas device:list`
261
294
 
@@ -269,7 +302,7 @@ OPTIONS
269
302
  --apple-team-id=apple-team-id
270
303
  ```
271
304
 
272
- _See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/device/list.ts)_
305
+ _See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/device/list.ts)_
273
306
 
274
307
  ## `eas device:view [UDID]`
275
308
 
@@ -280,7 +313,7 @@ USAGE
280
313
  $ eas device:view [UDID]
281
314
  ```
282
315
 
283
- _See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/device/view.ts)_
316
+ _See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/device/view.ts)_
284
317
 
285
318
  ## `eas diagnostics`
286
319
 
@@ -291,7 +324,7 @@ USAGE
291
324
  $ eas diagnostics
292
325
  ```
293
326
 
294
- _See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/diagnostics.ts)_
327
+ _See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/diagnostics.ts)_
295
328
 
296
329
  ## `eas help [COMMAND]`
297
330
 
@@ -319,7 +352,7 @@ USAGE
319
352
  $ eas project:info
320
353
  ```
321
354
 
322
- _See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/project/info.ts)_
355
+ _See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/project/info.ts)_
323
356
 
324
357
  ## `eas project:init`
325
358
 
@@ -333,7 +366,7 @@ ALIASES
333
366
  $ eas init
334
367
  ```
335
368
 
336
- _See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/project/init.ts)_
369
+ _See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/project/init.ts)_
337
370
 
338
371
  ## `eas secret:create`
339
372
 
@@ -350,7 +383,7 @@ OPTIONS
350
383
  --value=value Value of the secret
351
384
  ```
352
385
 
353
- _See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/secret/create.ts)_
386
+ _See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/secret/create.ts)_
354
387
 
355
388
  ## `eas secret:delete`
356
389
 
@@ -367,7 +400,7 @@ DESCRIPTION
367
400
  Unsure where to find the secret's ID? Run eas secret:list
368
401
  ```
369
402
 
370
- _See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/secret/delete.ts)_
403
+ _See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/secret/delete.ts)_
371
404
 
372
405
  ## `eas secret:list`
373
406
 
@@ -378,7 +411,7 @@ USAGE
378
411
  $ eas secret:list
379
412
  ```
380
413
 
381
- _See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/secret/list.ts)_
414
+ _See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/secret/list.ts)_
382
415
 
383
416
  ## `eas submit`
384
417
 
@@ -411,7 +444,7 @@ ALIASES
411
444
  $ eas build:submit
412
445
  ```
413
446
 
414
- _See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/submit.ts)_
447
+ _See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/submit.ts)_
415
448
 
416
449
  ## `eas webhook:create`
417
450
 
@@ -430,7 +463,7 @@ OPTIONS
430
463
  --url=url Webhook URL
431
464
  ```
432
465
 
433
- _See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/create.ts)_
466
+ _See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/webhook/create.ts)_
434
467
 
435
468
  ## `eas webhook:delete [ID]`
436
469
 
@@ -444,7 +477,7 @@ ARGUMENTS
444
477
  ID ID of the webhook to delete
445
478
  ```
446
479
 
447
- _See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/delete.ts)_
480
+ _See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/webhook/delete.ts)_
448
481
 
449
482
  ## `eas webhook:list`
450
483
 
@@ -458,7 +491,7 @@ OPTIONS
458
491
  --event=(BUILD|SUBMIT) Event type that triggers the webhook
459
492
  ```
460
493
 
461
- _See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/list.ts)_
494
+ _See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/webhook/list.ts)_
462
495
 
463
496
  ## `eas webhook:update`
464
497
 
@@ -478,7 +511,7 @@ OPTIONS
478
511
  --url=url Webhook URL
479
512
  ```
480
513
 
481
- _See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/update.ts)_
514
+ _See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/webhook/update.ts)_
482
515
 
483
516
  ## `eas webhook:view ID`
484
517
 
@@ -492,5 +525,5 @@ ARGUMENTS
492
525
  ID ID of the webhook to view
493
526
  ```
494
527
 
495
- _See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/view.ts)_
528
+ _See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.41.0/packages/eas-cli/src/commands/webhook/view.ts)_
496
529
  <!-- commandsstop -->
@@ -41,7 +41,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
41
41
  log_1.default.addNewLineIfNone();
42
42
  await (0, repository_1.reviewAndCommitChangesAsync)(`[EAS Build] Run EAS Build for ${platform_1.requestedPlatformDisplayNames[ctx.platform]}`, { nonInteractive: ctx.nonInteractive });
43
43
  }
44
- const projectArchive = ctx.local
44
+ const projectArchive = ctx.localBuildOptions.enable
45
45
  ? {
46
46
  type: eas_build_job_1.ArchiveSourceType.PATH,
47
47
  path: (await (0, repository_1.makeProjectTarballAsync)()).path,
@@ -57,8 +57,8 @@ async function prepareBuildRequestForPlatformAsync(builder) {
57
57
  });
58
58
  return async () => {
59
59
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
60
- if (ctx.local) {
61
- await (0, local_1.runLocalBuildAsync)(job);
60
+ if (ctx.localBuildOptions.enable) {
61
+ await (0, local_1.runLocalBuildAsync)(job, ctx.localBuildOptions);
62
62
  return undefined;
63
63
  }
64
64
  else {
@@ -9,6 +9,7 @@ import { RequestedPlatform } from '../platform';
9
9
  import { GradleBuildContext } from '../project/android/gradle';
10
10
  import { XcodeBuildContext } from '../project/ios/scheme';
11
11
  import { Actor } from '../user/User';
12
+ import { LocalBuildOptions } from './local';
12
13
  export interface ConfigureContext {
13
14
  user: Actor;
14
15
  projectDir: string;
@@ -38,7 +39,7 @@ export interface BuildContext<T extends Platform> {
38
39
  clearCache: boolean;
39
40
  credentialsCtx: CredentialsContext;
40
41
  exp: ExpoConfig;
41
- local: boolean;
42
+ localBuildOptions: LocalBuildOptions;
42
43
  nonInteractive: boolean;
43
44
  platform: T;
44
45
  projectDir: string;
@@ -1,11 +1,12 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { BuildProfile } from '@expo/eas-json';
3
3
  import { BuildContext } from './context';
4
- export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, local, nonInteractive, platform, projectDir, skipProjectConfiguration, }: {
4
+ import { LocalBuildOptions } from './local';
5
+ export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, localBuildOptions, nonInteractive, platform, projectDir, skipProjectConfiguration, }: {
5
6
  buildProfileName: string;
6
7
  buildProfile: BuildProfile<T>;
7
8
  clearCache: boolean;
8
- local: boolean;
9
+ localBuildOptions: LocalBuildOptions;
9
10
  nonInteractive: boolean;
10
11
  platform: T;
11
12
  projectDir: string;
@@ -15,7 +15,7 @@ const Account_1 = require("../user/Account");
15
15
  const actions_1 = require("../user/actions");
16
16
  const build_1 = require("./android/build");
17
17
  const build_2 = require("./ios/build");
18
- async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, local, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
18
+ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, localBuildOptions, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
19
19
  var _a;
20
20
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
21
21
  const user = await (0, actions_1.ensureLoggedInAsync)();
@@ -52,7 +52,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
52
52
  clearCache,
53
53
  credentialsCtx,
54
54
  exp,
55
- local,
55
+ localBuildOptions,
56
56
  nonInteractive,
57
57
  platform,
58
58
  projectDir,
@@ -1,2 +1,10 @@
1
1
  import { Job } from '@expo/eas-build-job';
2
- export declare function runLocalBuildAsync(job: Job): Promise<void>;
2
+ export interface LocalBuildOptions {
3
+ enable: boolean;
4
+ skipCleanup?: boolean;
5
+ skipNativeBuild?: boolean;
6
+ artifactsDir?: string;
7
+ workingdir?: string;
8
+ verbose?: boolean;
9
+ }
10
+ export declare function runLocalBuildAsync(job: Job, options: LocalBuildOptions): Promise<void>;
@@ -4,13 +4,43 @@ exports.runLocalBuildAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"));
6
6
  const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
7
+ const ora_1 = require("../ora");
7
8
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
8
- const PLUGIN_PACKAGE_VERSION = '0.0.54';
9
- async function runLocalBuildAsync(job) {
9
+ const PLUGIN_PACKAGE_VERSION = '0.0.56';
10
+ async function runLocalBuildAsync(job, options) {
11
+ var _a;
10
12
  const { command, args } = await getCommandAndArgsAsync(job);
11
- await (0, spawn_async_1.default)(command, args, {
12
- stdio: 'inherit',
13
- });
13
+ let spinner;
14
+ if (!options.verbose) {
15
+ spinner = (0, ora_1.ora)().start(options.skipNativeBuild ? 'Preparing project' : 'Building project');
16
+ }
17
+ let childProcess;
18
+ const interruptHandler = () => {
19
+ if (childProcess) {
20
+ childProcess.kill();
21
+ }
22
+ };
23
+ process.on('SIGINT', interruptHandler);
24
+ try {
25
+ const spawnPromise = (0, spawn_async_1.default)(command, args, {
26
+ stdio: options.verbose ? 'inherit' : 'pipe',
27
+ env: {
28
+ ...process.env,
29
+ EAS_LOCAL_BUILD_WORKINGDIR: (_a = options.workingdir) !== null && _a !== void 0 ? _a : process.env.EAS_LOCAL_BUILD_WORKINGDIR,
30
+ ...(options.skipCleanup || options.skipNativeBuild
31
+ ? { EAS_LOCAL_BUILD_SKIP_CLEANUP: '1' }
32
+ : {}),
33
+ ...(options.skipNativeBuild ? { EAS_LOCAL_BUILD_SKIP_NATIVE_BUILD: '1' } : {}),
34
+ ...(options.artifactsDir ? { EAS_LOCAL_BUILD_ARTIFACTS_DIR: options.artifactsDir } : {}),
35
+ },
36
+ });
37
+ childProcess = spawnPromise.child;
38
+ await spawnPromise;
39
+ }
40
+ finally {
41
+ process.removeListener('SIGINT', interruptHandler);
42
+ spinner === null || spinner === void 0 ? void 0 : spinner.stop();
43
+ }
14
44
  }
15
45
  exports.runLocalBuildAsync = runLocalBuildAsync;
16
46
  async function getCommandAndArgsAsync(job) {
@@ -0,0 +1,15 @@
1
+ import { RequestedPlatform } from '../platform';
2
+ import { LocalBuildOptions } from './local';
3
+ export interface BuildFlags {
4
+ requestedPlatform: RequestedPlatform;
5
+ skipProjectConfiguration: boolean;
6
+ profile?: string;
7
+ nonInteractive: boolean;
8
+ wait: boolean;
9
+ clearCache: boolean;
10
+ json: boolean;
11
+ autoSubmit: boolean;
12
+ submitProfile?: string;
13
+ localBuildOptions: LocalBuildOptions;
14
+ }
15
+ export declare function runBuildAndSubmitAsync(projectDir: string, flags: BuildFlags): Promise<void>;
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runBuildAndSubmitAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
+ const nullthrows_1 = (0, tslib_1.__importDefault)(require("nullthrows"));
8
+ const generated_1 = require("../graphql/generated");
9
+ const AppPlatform_1 = require("../graphql/types/AppPlatform");
10
+ const log_1 = (0, tslib_1.__importDefault)(require("../log"));
11
+ const platform_1 = require("../platform");
12
+ const expoSdk_1 = require("../project/expoSdk");
13
+ const metroConfig_1 = require("../project/metroConfig");
14
+ const context_1 = require("../submit/context");
15
+ const submit_1 = require("../submit/submit");
16
+ const urls_1 = require("../submit/utils/urls");
17
+ const profiles_1 = require("../utils/profiles");
18
+ const vcs_1 = require("../vcs");
19
+ const build_1 = require("./android/build");
20
+ const build_2 = require("./build");
21
+ const configure_1 = require("./configure");
22
+ const createContext_1 = require("./createContext");
23
+ const build_3 = require("./ios/build");
24
+ const devClient_1 = require("./utils/devClient");
25
+ const printBuildInfo_1 = require("./utils/printBuildInfo");
26
+ const repository_1 = require("./utils/repository");
27
+ let metroConfigValidated = false;
28
+ let sdkVersionChecked = false;
29
+ async function runBuildAndSubmitAsync(projectDir, flags) {
30
+ var _a;
31
+ await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
32
+ await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
33
+ await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, flags.requestedPlatform);
34
+ const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
35
+ const buildProfiles = await (0, profiles_1.getProfilesAsync)({
36
+ type: 'build',
37
+ projectDir,
38
+ platforms,
39
+ profileName: (_a = flags.profile) !== null && _a !== void 0 ? _a : undefined,
40
+ });
41
+ await (0, devClient_1.ensureExpoDevClientInstalledForDevClientBuildsAsync)({
42
+ projectDir,
43
+ nonInteractive: flags.nonInteractive,
44
+ buildProfiles,
45
+ });
46
+ const startedBuilds = [];
47
+ const buildCtxByPlatform = {};
48
+ for (const buildProfile of buildProfiles) {
49
+ const { build: maybeBuild, buildCtx } = await prepareAndStartBuildAsync({
50
+ projectDir,
51
+ flags,
52
+ moreBuilds: platforms.length > 1,
53
+ buildProfile,
54
+ });
55
+ if (maybeBuild) {
56
+ startedBuilds.push({ build: maybeBuild, buildProfile });
57
+ }
58
+ buildCtxByPlatform[(0, AppPlatform_1.toAppPlatform)(buildProfile.platform)] = buildCtx;
59
+ }
60
+ if (flags.localBuildOptions.enable) {
61
+ return;
62
+ }
63
+ log_1.default.newLine();
64
+ (0, printBuildInfo_1.printLogsUrls)(startedBuilds.map(startedBuild => startedBuild.build));
65
+ log_1.default.newLine();
66
+ const submissions = [];
67
+ if (flags.autoSubmit) {
68
+ const submitProfiles = await (0, profiles_1.getProfilesAsync)({
69
+ projectDir,
70
+ platforms,
71
+ profileName: flags.submitProfile,
72
+ type: 'submit',
73
+ });
74
+ for (const startedBuild of startedBuilds) {
75
+ const submitProfile = (0, nullthrows_1.default)(submitProfiles.find(({ platform }) => (0, AppPlatform_1.toAppPlatform)(platform) === startedBuild.build.platform)).profile;
76
+ const submission = await prepareAndStartSubmissionAsync({
77
+ build: startedBuild.build,
78
+ buildCtx: (0, nullthrows_1.default)(buildCtxByPlatform[startedBuild.build.platform]),
79
+ moreBuilds: startedBuilds.length > 1,
80
+ projectDir,
81
+ buildProfile: startedBuild.buildProfile.profile,
82
+ submitProfile,
83
+ nonInteractive: flags.nonInteractive,
84
+ });
85
+ submissions.push(submission);
86
+ }
87
+ log_1.default.newLine();
88
+ (0, urls_1.printSubmissionDetailsUrls)(submissions);
89
+ log_1.default.newLine();
90
+ }
91
+ if (!flags.wait) {
92
+ return;
93
+ }
94
+ const builds = await (0, build_2.waitForBuildEndAsync)(startedBuilds.map(({ build }) => build.id));
95
+ (0, printBuildInfo_1.printBuildResults)(builds, flags.json);
96
+ const haveAllBuildsFailedOrCanceled = builds.every(build => (build === null || build === void 0 ? void 0 : build.status) && [generated_1.BuildStatus.Errored, generated_1.BuildStatus.Canceled].includes(build === null || build === void 0 ? void 0 : build.status));
97
+ if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
98
+ exitWithNonZeroCodeIfSomeBuildsFailed(builds);
99
+ }
100
+ else {
101
+ // the following function also exits with non zero code if any of the submissions failed
102
+ await (0, submit_1.waitToCompleteAsync)(submissions);
103
+ }
104
+ }
105
+ exports.runBuildAndSubmitAsync = runBuildAndSubmitAsync;
106
+ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildProfile, }) {
107
+ const buildCtx = await (0, createContext_1.createBuildContextAsync)({
108
+ buildProfileName: buildProfile.profileName,
109
+ clearCache: flags.clearCache,
110
+ buildProfile: buildProfile.profile,
111
+ nonInteractive: flags.nonInteractive,
112
+ platform: buildProfile.platform,
113
+ projectDir,
114
+ skipProjectConfiguration: flags.skipProjectConfiguration,
115
+ localBuildOptions: flags.localBuildOptions,
116
+ });
117
+ if (moreBuilds) {
118
+ log_1.default.newLine();
119
+ const appPlatform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
120
+ log_1.default.log(`${platform_1.appPlatformEmojis[appPlatform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[appPlatform]} build`)}`);
121
+ }
122
+ if (buildCtx.workflow === eas_build_job_1.Workflow.MANAGED) {
123
+ if (!sdkVersionChecked) {
124
+ await (0, expoSdk_1.checkExpoSdkIsSupportedAsync)(buildCtx);
125
+ sdkVersionChecked = true;
126
+ }
127
+ if (!metroConfigValidated) {
128
+ await (0, metroConfig_1.validateMetroConfigForManagedWorkflowAsync)(buildCtx);
129
+ metroConfigValidated = true;
130
+ }
131
+ }
132
+ const build = await startBuildAsync(buildCtx);
133
+ return {
134
+ build,
135
+ buildCtx,
136
+ };
137
+ }
138
+ async function startBuildAsync(ctx) {
139
+ let sendBuildRequestAsync;
140
+ if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
141
+ sendBuildRequestAsync = await (0, build_1.prepareAndroidBuildAsync)(ctx);
142
+ }
143
+ else {
144
+ sendBuildRequestAsync = await (0, build_3.prepareIosBuildAsync)(ctx);
145
+ }
146
+ return await sendBuildRequestAsync();
147
+ }
148
+ async function prepareAndStartSubmissionAsync({ build, buildCtx, moreBuilds, projectDir, buildProfile, submitProfile, nonInteractive, }) {
149
+ var _a, _b, _c;
150
+ const platform = (0, AppPlatform_1.toPlatform)(build.platform);
151
+ const submissionCtx = await (0, context_1.createSubmissionContextAsync)({
152
+ platform,
153
+ projectDir,
154
+ projectId: build.project.id,
155
+ profile: submitProfile,
156
+ archiveFlags: { id: build.id },
157
+ nonInteractive,
158
+ env: buildProfile.env,
159
+ credentialsCtx: buildCtx.credentialsCtx,
160
+ 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,
161
+ });
162
+ if (moreBuilds) {
163
+ log_1.default.newLine();
164
+ log_1.default.log(`${platform_1.appPlatformEmojis[build.platform]} ${chalk_1.default.bold(`${platform_1.appPlatformDisplayNames[build.platform]} submission`)}`);
165
+ }
166
+ return await (0, submit_1.submitAsync)(submissionCtx);
167
+ }
168
+ function exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds) {
169
+ const failedBuilds = maybeBuilds.filter(i => i).filter(i => i.status === generated_1.BuildStatus.Errored);
170
+ if (failedBuilds.length > 0) {
171
+ process.exit(1);
172
+ }
173
+ }
@@ -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 => {
@@ -15,12 +15,7 @@ export default class Build extends EasCommand {
15
15
  'auto-submit': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
16
  'auto-submit-with-profile': flags.IOptionFlag<string | undefined>;
17
17
  };
18
- private metroConfigValidated;
19
18
  runAsync(): Promise<void>;
20
19
  private sanitizeFlagsAsync;
21
- private prepareAndStartBuildAsync;
22
- private startBuildAsync;
23
- private prepareAndStartSubmissionAsync;
24
- private exitWithNonZeroCodeIfSomeBuildsFailed;
25
20
  }
26
21
  export declare function handleDeprecatedEasJsonAsync(projectDir: string, nonInteractive: boolean): Promise<void>;