eas-cli 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -40
- package/build/build/createContext.js +1 -1
- package/build/commands/branch/publish.d.ts +1 -18
- package/build/commands/branch/publish.js +2 -354
- package/build/commands/build/index.js +1 -1
- package/build/commands/credentials.js +1 -7
- package/build/commands/submit.js +1 -1
- package/build/commands/update/configure.d.ts +1 -0
- package/build/commands/update/configure.js +1 -0
- package/build/commands/update/index.d.ts +20 -0
- package/build/commands/update/index.js +361 -0
- package/build/credentials/context.d.ts +5 -0
- package/build/credentials/context.js +12 -7
- package/build/credentials/manager/ManageAndroid.d.ts +3 -3
- package/build/credentials/manager/ManageAndroid.js +21 -13
- package/build/credentials/manager/ManageIos.d.ts +3 -3
- package/build/credentials/manager/ManageIos.js +23 -13
- package/build/credentials/manager/SelectBuildProfileFromEasJson.d.ts +2 -3
- package/build/credentials/manager/SelectBuildProfileFromEasJson.js +3 -6
- package/build/credentials/manager/SelectPlatform.d.ts +1 -2
- package/build/credentials/manager/SelectPlatform.js +3 -3
- package/build/submit/context.js +0 -1
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -55,7 +55,6 @@ eas --help COMMAND
|
|
|
55
55
|
* [`eas secret:delete`](#eas-secretdelete)
|
|
56
56
|
* [`eas secret:list`](#eas-secretlist)
|
|
57
57
|
* [`eas submit`](#eas-submit)
|
|
58
|
-
* [`eas update:configure`](#eas-updateconfigure)
|
|
59
58
|
* [`eas webhook:create`](#eas-webhookcreate)
|
|
60
59
|
* [`eas webhook:delete [ID]`](#eas-webhookdelete-id)
|
|
61
60
|
* [`eas webhook:list`](#eas-webhooklist)
|
|
@@ -74,7 +73,7 @@ ALIASES
|
|
|
74
73
|
$ eas login
|
|
75
74
|
```
|
|
76
75
|
|
|
77
|
-
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
78
77
|
|
|
79
78
|
## `eas account:logout`
|
|
80
79
|
|
|
@@ -88,7 +87,7 @@ ALIASES
|
|
|
88
87
|
$ eas logout
|
|
89
88
|
```
|
|
90
89
|
|
|
91
|
-
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
92
91
|
|
|
93
92
|
## `eas account:view`
|
|
94
93
|
|
|
@@ -102,7 +101,7 @@ ALIASES
|
|
|
102
101
|
$ eas whoami
|
|
103
102
|
```
|
|
104
103
|
|
|
105
|
-
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
106
105
|
|
|
107
106
|
## `eas analytics [STATUS]`
|
|
108
107
|
|
|
@@ -113,11 +112,11 @@ USAGE
|
|
|
113
112
|
$ eas analytics [STATUS]
|
|
114
113
|
```
|
|
115
114
|
|
|
116
|
-
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
115
|
+
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/analytics.ts)_
|
|
117
116
|
|
|
118
117
|
## `eas build`
|
|
119
118
|
|
|
120
|
-
|
|
119
|
+
Start a build
|
|
121
120
|
|
|
122
121
|
```
|
|
123
122
|
USAGE
|
|
@@ -147,7 +146,7 @@ OPTIONS
|
|
|
147
146
|
--[no-]wait Wait for build(s) to complete
|
|
148
147
|
```
|
|
149
148
|
|
|
150
|
-
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
151
150
|
|
|
152
151
|
## `eas build:cancel [BUILD_ID]`
|
|
153
152
|
|
|
@@ -158,7 +157,7 @@ USAGE
|
|
|
158
157
|
$ eas build:cancel [BUILD_ID]
|
|
159
158
|
```
|
|
160
159
|
|
|
161
|
-
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
162
161
|
|
|
163
162
|
## `eas build:configure`
|
|
164
163
|
|
|
@@ -172,7 +171,7 @@ OPTIONS
|
|
|
172
171
|
-p, --platform=(android|ios|all) Platform to configure
|
|
173
172
|
```
|
|
174
173
|
|
|
175
|
-
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
176
175
|
|
|
177
176
|
## `eas build:list`
|
|
178
177
|
|
|
@@ -205,7 +204,7 @@ OPTIONS
|
|
|
205
204
|
--status=(new|in-queue|in-progress|errored|finished|canceled)
|
|
206
205
|
```
|
|
207
206
|
|
|
208
|
-
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
209
208
|
|
|
210
209
|
## `eas build:view [BUILD_ID]`
|
|
211
210
|
|
|
@@ -219,7 +218,7 @@ OPTIONS
|
|
|
219
218
|
--json Enable JSON output, non-JSON messages will be printed to stderr
|
|
220
219
|
```
|
|
221
220
|
|
|
222
|
-
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
223
222
|
|
|
224
223
|
## `eas config`
|
|
225
224
|
|
|
@@ -234,7 +233,7 @@ OPTIONS
|
|
|
234
233
|
--profile=profile
|
|
235
234
|
```
|
|
236
235
|
|
|
237
|
-
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
236
|
+
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/config.ts)_
|
|
238
237
|
|
|
239
238
|
## `eas credentials`
|
|
240
239
|
|
|
@@ -245,7 +244,7 @@ USAGE
|
|
|
245
244
|
$ eas credentials
|
|
246
245
|
```
|
|
247
246
|
|
|
248
|
-
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
247
|
+
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/credentials.ts)_
|
|
249
248
|
|
|
250
249
|
## `eas device:create`
|
|
251
250
|
|
|
@@ -256,7 +255,7 @@ USAGE
|
|
|
256
255
|
$ eas device:create
|
|
257
256
|
```
|
|
258
257
|
|
|
259
|
-
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
260
259
|
|
|
261
260
|
## `eas device:list`
|
|
262
261
|
|
|
@@ -270,7 +269,7 @@ OPTIONS
|
|
|
270
269
|
--apple-team-id=apple-team-id
|
|
271
270
|
```
|
|
272
271
|
|
|
273
|
-
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
274
273
|
|
|
275
274
|
## `eas device:view [UDID]`
|
|
276
275
|
|
|
@@ -281,7 +280,7 @@ USAGE
|
|
|
281
280
|
$ eas device:view [UDID]
|
|
282
281
|
```
|
|
283
282
|
|
|
284
|
-
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
285
284
|
|
|
286
285
|
## `eas diagnostics`
|
|
287
286
|
|
|
@@ -292,7 +291,7 @@ USAGE
|
|
|
292
291
|
$ eas diagnostics
|
|
293
292
|
```
|
|
294
293
|
|
|
295
|
-
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
294
|
+
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/diagnostics.ts)_
|
|
296
295
|
|
|
297
296
|
## `eas help [COMMAND]`
|
|
298
297
|
|
|
@@ -320,7 +319,7 @@ USAGE
|
|
|
320
319
|
$ eas project:info
|
|
321
320
|
```
|
|
322
321
|
|
|
323
|
-
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
324
323
|
|
|
325
324
|
## `eas project:init`
|
|
326
325
|
|
|
@@ -334,7 +333,7 @@ ALIASES
|
|
|
334
333
|
$ eas init
|
|
335
334
|
```
|
|
336
335
|
|
|
337
|
-
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
338
337
|
|
|
339
338
|
## `eas secret:create`
|
|
340
339
|
|
|
@@ -351,7 +350,7 @@ OPTIONS
|
|
|
351
350
|
--value=value Value of the secret
|
|
352
351
|
```
|
|
353
352
|
|
|
354
|
-
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
355
354
|
|
|
356
355
|
## `eas secret:delete`
|
|
357
356
|
|
|
@@ -368,7 +367,7 @@ DESCRIPTION
|
|
|
368
367
|
Unsure where to find the secret's ID? Run eas secret:list
|
|
369
368
|
```
|
|
370
369
|
|
|
371
|
-
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
372
371
|
|
|
373
372
|
## `eas secret:list`
|
|
374
373
|
|
|
@@ -379,11 +378,11 @@ USAGE
|
|
|
379
378
|
$ eas secret:list
|
|
380
379
|
```
|
|
381
380
|
|
|
382
|
-
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
383
382
|
|
|
384
383
|
## `eas submit`
|
|
385
384
|
|
|
386
|
-
|
|
385
|
+
Submit build archive to App Store Connect
|
|
387
386
|
|
|
388
387
|
```
|
|
389
388
|
USAGE
|
|
@@ -412,18 +411,7 @@ ALIASES
|
|
|
412
411
|
$ eas build:submit
|
|
413
412
|
```
|
|
414
413
|
|
|
415
|
-
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
416
|
-
|
|
417
|
-
## `eas update:configure`
|
|
418
|
-
|
|
419
|
-
Configure the project to support EAS Update.
|
|
420
|
-
|
|
421
|
-
```
|
|
422
|
-
USAGE
|
|
423
|
-
$ eas update:configure
|
|
424
|
-
```
|
|
425
|
-
|
|
426
|
-
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v0.39.0/packages/eas-cli/src/commands/update/configure.ts)_
|
|
414
|
+
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/submit.ts)_
|
|
427
415
|
|
|
428
416
|
## `eas webhook:create`
|
|
429
417
|
|
|
@@ -442,7 +430,7 @@ OPTIONS
|
|
|
442
430
|
--url=url Webhook URL
|
|
443
431
|
```
|
|
444
432
|
|
|
445
|
-
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
446
434
|
|
|
447
435
|
## `eas webhook:delete [ID]`
|
|
448
436
|
|
|
@@ -456,7 +444,7 @@ ARGUMENTS
|
|
|
456
444
|
ID ID of the webhook to delete
|
|
457
445
|
```
|
|
458
446
|
|
|
459
|
-
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
460
448
|
|
|
461
449
|
## `eas webhook:list`
|
|
462
450
|
|
|
@@ -470,7 +458,7 @@ OPTIONS
|
|
|
470
458
|
--event=(BUILD|SUBMIT) Event type that triggers the webhook
|
|
471
459
|
```
|
|
472
460
|
|
|
473
|
-
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
474
462
|
|
|
475
463
|
## `eas webhook:update`
|
|
476
464
|
|
|
@@ -490,7 +478,7 @@ OPTIONS
|
|
|
490
478
|
--url=url Webhook URL
|
|
491
479
|
```
|
|
492
480
|
|
|
493
|
-
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
494
482
|
|
|
495
483
|
## `eas webhook:view ID`
|
|
496
484
|
|
|
@@ -504,5 +492,5 @@ ARGUMENTS
|
|
|
504
492
|
ID ID of the webhook to view
|
|
505
493
|
```
|
|
506
494
|
|
|
507
|
-
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.
|
|
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)_
|
|
508
496
|
<!-- commandsstop -->
|
|
@@ -29,6 +29,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
29
29
|
nonInteractive,
|
|
30
30
|
projectDir,
|
|
31
31
|
user,
|
|
32
|
+
env: buildProfile.env,
|
|
32
33
|
});
|
|
33
34
|
const devClientProperties = getDevClientEventProperties({
|
|
34
35
|
platform,
|
|
@@ -39,7 +40,6 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
39
40
|
tracking_id: (0, uuid_1.v4)(),
|
|
40
41
|
platform,
|
|
41
42
|
...(accountId && { account_id: accountId }),
|
|
42
|
-
account_name: accountName,
|
|
43
43
|
project_id: projectId,
|
|
44
44
|
project_type: workflow,
|
|
45
45
|
...devClientProperties,
|
|
@@ -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
|
|
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
|
-
|
|
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
|
-
}
|