eas-cli 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/README.md +26 -26
  2. package/build/analytics/common.d.ts +8 -0
  3. package/build/analytics/common.js +19 -0
  4. package/build/analytics/events.d.ts +43 -0
  5. package/build/analytics/events.js +51 -0
  6. package/build/{analytics.d.ts → analytics/rudderstackClient.d.ts} +0 -0
  7. package/build/{analytics.js → analytics/rudderstackClient.js} +2 -2
  8. package/build/build/build.js +18 -27
  9. package/build/build/context.d.ts +1 -1
  10. package/build/build/context.js +2 -2
  11. package/build/build/ios/credentials.js +3 -3
  12. package/build/build/local.js +18 -27
  13. package/build/build/types.d.ts +0 -1
  14. package/build/commandUtils/EasCommand.js +4 -4
  15. package/build/commands/build/index.js +1 -1
  16. package/build/credentials/android/actions/RemoveFcm.js +4 -4
  17. package/build/credentials/android/utils/keystore.js +67 -32
  18. package/build/credentials/ios/actions/AscApiKeyUtils.js +8 -7
  19. package/build/credentials/ios/actions/AssignAscApiKey.js +1 -1
  20. package/build/credentials/ios/actions/CreateAscApiKey.js +2 -2
  21. package/build/credentials/ios/actions/RemoveAscApiKey.js +6 -6
  22. package/build/credentials/ios/actions/SetUpAscApiKey.js +8 -8
  23. package/build/credentials/ios/actions/SetUpSubmissionCredentials.js +3 -3
  24. package/build/credentials/ios/appstore/ascApiKey.js +12 -12
  25. package/build/credentials/ios/appstore/entitlements.d.ts +2 -2
  26. package/build/credentials/ios/appstore/entitlements.js +20 -10
  27. package/build/credentials/ios/credentials.js +2 -2
  28. package/build/credentials/ios/utils/printCredentials.js +1 -1
  29. package/build/credentials/manager/AndroidActions.js +3 -3
  30. package/build/credentials/manager/IosActions.js +5 -5
  31. package/build/credentials/manager/ManageIos.js +4 -4
  32. package/build/graphql/generated.d.ts +144 -53
  33. package/build/graphql/mutations/KeystoreGenerationUrlMutation.d.ts +3 -0
  34. package/build/graphql/mutations/KeystoreGenerationUrlMutation.js +23 -0
  35. package/build/submit/BaseSubmitter.d.ts +20 -4
  36. package/build/submit/BaseSubmitter.js +34 -1
  37. package/build/submit/android/AndroidSubmitter.d.ts +12 -6
  38. package/build/submit/android/AndroidSubmitter.js +31 -20
  39. package/build/submit/context.d.ts +2 -0
  40. package/build/submit/context.js +14 -0
  41. package/build/submit/ios/AppSpecificPasswordSource.d.ts +8 -1
  42. package/build/submit/ios/AppSpecificPasswordSource.js +44 -4
  43. package/build/submit/ios/CredentialsServiceSource.d.ts +3 -2
  44. package/build/submit/ios/CredentialsServiceSource.js +9 -3
  45. package/build/submit/ios/IosSubmitCommand.d.ts +1 -2
  46. package/build/submit/ios/IosSubmitCommand.js +2 -39
  47. package/build/submit/ios/IosSubmitter.d.ts +17 -7
  48. package/build/submit/ios/IosSubmitter.js +55 -29
  49. package/build/submit/submit.js +13 -4
  50. package/build/user/User.js +1 -1
  51. package/oclif.manifest.json +1 -1
  52. package/package.json +3 -3
  53. package/build/build/utils/analytics.d.ts +0 -22
  54. package/build/build/utils/analytics.js +0 -28
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.35.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.36.0/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.35.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.36.0/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.35.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.36.0/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.35.0/packages/eas-cli/src/commands/analytics.js)_
115
+ _See code: [src/commands/analytics.js](https://github.com/expo/eas-cli/blob/v0.36.0/packages/eas-cli/src/commands/analytics.js)_
116
116
 
117
117
  ## `eas build`
118
118
 
@@ -146,7 +146,7 @@ OPTIONS
146
146
  --[no-]wait Wait for build(s) to complete
147
147
  ```
148
148
 
149
- _See code: [src/commands/build/index.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/build/index.js)_
150
150
 
151
151
  ## `eas build:cancel [BUILD_ID]`
152
152
 
@@ -157,7 +157,7 @@ USAGE
157
157
  $ eas build:cancel [BUILD_ID]
158
158
  ```
159
159
 
160
- _See code: [src/commands/build/cancel.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/build/cancel.js)_
161
161
 
162
162
  ## `eas build:configure`
163
163
 
@@ -171,7 +171,7 @@ OPTIONS
171
171
  -p, --platform=(android|ios|all) Platform to configure
172
172
  ```
173
173
 
174
- _See code: [src/commands/build/configure.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/build/configure.js)_
175
175
 
176
176
  ## `eas build:list`
177
177
 
@@ -204,7 +204,7 @@ OPTIONS
204
204
  --status=(new|in-queue|in-progress|errored|finished|canceled)
205
205
  ```
206
206
 
207
- _See code: [src/commands/build/list.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/build/list.js)_
208
208
 
209
209
  ## `eas build:view [BUILD_ID]`
210
210
 
@@ -218,7 +218,7 @@ OPTIONS
218
218
  --json Enable JSON output, non-JSON messages will be printed to stderr
219
219
  ```
220
220
 
221
- _See code: [src/commands/build/view.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/build/view.js)_
222
222
 
223
223
  ## `eas config`
224
224
 
@@ -233,7 +233,7 @@ OPTIONS
233
233
  --profile=profile
234
234
  ```
235
235
 
236
- _See code: [src/commands/config.js](https://github.com/expo/eas-cli/blob/v0.35.0/packages/eas-cli/src/commands/config.js)_
236
+ _See code: [src/commands/config.js](https://github.com/expo/eas-cli/blob/v0.36.0/packages/eas-cli/src/commands/config.js)_
237
237
 
238
238
  ## `eas credentials`
239
239
 
@@ -244,7 +244,7 @@ USAGE
244
244
  $ eas credentials
245
245
  ```
246
246
 
247
- _See code: [src/commands/credentials.js](https://github.com/expo/eas-cli/blob/v0.35.0/packages/eas-cli/src/commands/credentials.js)_
247
+ _See code: [src/commands/credentials.js](https://github.com/expo/eas-cli/blob/v0.36.0/packages/eas-cli/src/commands/credentials.js)_
248
248
 
249
249
  ## `eas device:create`
250
250
 
@@ -255,7 +255,7 @@ USAGE
255
255
  $ eas device:create
256
256
  ```
257
257
 
258
- _See code: [src/commands/device/create.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/device/create.js)_
259
259
 
260
260
  ## `eas device:list`
261
261
 
@@ -269,7 +269,7 @@ OPTIONS
269
269
  --apple-team-id=apple-team-id
270
270
  ```
271
271
 
272
- _See code: [src/commands/device/list.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/device/list.js)_
273
273
 
274
274
  ## `eas device:view [UDID]`
275
275
 
@@ -280,7 +280,7 @@ USAGE
280
280
  $ eas device:view [UDID]
281
281
  ```
282
282
 
283
- _See code: [src/commands/device/view.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/device/view.js)_
284
284
 
285
285
  ## `eas diagnostics`
286
286
 
@@ -291,7 +291,7 @@ USAGE
291
291
  $ eas diagnostics
292
292
  ```
293
293
 
294
- _See code: [src/commands/diagnostics.js](https://github.com/expo/eas-cli/blob/v0.35.0/packages/eas-cli/src/commands/diagnostics.js)_
294
+ _See code: [src/commands/diagnostics.js](https://github.com/expo/eas-cli/blob/v0.36.0/packages/eas-cli/src/commands/diagnostics.js)_
295
295
 
296
296
  ## `eas help [COMMAND]`
297
297
 
@@ -319,7 +319,7 @@ USAGE
319
319
  $ eas project:info
320
320
  ```
321
321
 
322
- _See code: [src/commands/project/info.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/project/info.js)_
323
323
 
324
324
  ## `eas project:init`
325
325
 
@@ -333,7 +333,7 @@ ALIASES
333
333
  $ eas init
334
334
  ```
335
335
 
336
- _See code: [src/commands/project/init.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/project/init.js)_
337
337
 
338
338
  ## `eas secret:create`
339
339
 
@@ -350,7 +350,7 @@ OPTIONS
350
350
  --value=value Value of the secret
351
351
  ```
352
352
 
353
- _See code: [src/commands/secret/create.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/secret/create.js)_
354
354
 
355
355
  ## `eas secret:delete`
356
356
 
@@ -367,7 +367,7 @@ DESCRIPTION
367
367
  Unsure where to find the secret's ID? Run eas secret:list
368
368
  ```
369
369
 
370
- _See code: [src/commands/secret/delete.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/secret/delete.js)_
371
371
 
372
372
  ## `eas secret:list`
373
373
 
@@ -378,7 +378,7 @@ USAGE
378
378
  $ eas secret:list
379
379
  ```
380
380
 
381
- _See code: [src/commands/secret/list.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/secret/list.js)_
382
382
 
383
383
  ## `eas submit`
384
384
 
@@ -411,7 +411,7 @@ ALIASES
411
411
  $ eas build:submit
412
412
  ```
413
413
 
414
- _See code: [src/commands/submit.js](https://github.com/expo/eas-cli/blob/v0.35.0/packages/eas-cli/src/commands/submit.js)_
414
+ _See code: [src/commands/submit.js](https://github.com/expo/eas-cli/blob/v0.36.0/packages/eas-cli/src/commands/submit.js)_
415
415
 
416
416
  ## `eas webhook:create`
417
417
 
@@ -430,7 +430,7 @@ OPTIONS
430
430
  --url=url Webhook URL
431
431
  ```
432
432
 
433
- _See code: [src/commands/webhook/create.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/webhook/create.js)_
434
434
 
435
435
  ## `eas webhook:delete [ID]`
436
436
 
@@ -444,7 +444,7 @@ ARGUMENTS
444
444
  ID ID of the webhook to delete
445
445
  ```
446
446
 
447
- _See code: [src/commands/webhook/delete.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/webhook/delete.js)_
448
448
 
449
449
  ## `eas webhook:list`
450
450
 
@@ -458,7 +458,7 @@ OPTIONS
458
458
  --event=(BUILD) Event type that triggers the webhook
459
459
  ```
460
460
 
461
- _See code: [src/commands/webhook/list.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/webhook/list.js)_
462
462
 
463
463
  ## `eas webhook:update`
464
464
 
@@ -478,7 +478,7 @@ OPTIONS
478
478
  --url=url Webhook URL
479
479
  ```
480
480
 
481
- _See code: [src/commands/webhook/update.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/webhook/update.js)_
482
482
 
483
483
  ## `eas webhook:view ID`
484
484
 
@@ -492,5 +492,5 @@ ARGUMENTS
492
492
  ID ID of the webhook to view
493
493
  ```
494
494
 
495
- _See code: [src/commands/webhook/view.js](https://github.com/expo/eas-cli/blob/v0.35.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.36.0/packages/eas-cli/src/commands/webhook/view.js)_
496
496
  <!-- commandsstop -->
@@ -0,0 +1,8 @@
1
+ import { Event } from './events';
2
+ export declare type TrackingContext = Record<string, string | number | boolean>;
3
+ export declare function withAnalyticsAsync<Result>(fn: () => Promise<Result>, analytics: {
4
+ attemptEvent: Event;
5
+ successEvent: Event;
6
+ failureEvent: Event;
7
+ trackingCtx: TrackingContext;
8
+ }): Promise<Result>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.withAnalyticsAsync = void 0;
4
+ const events_1 = require("./events");
5
+ async function withAnalyticsAsync(fn, analytics) {
6
+ try {
7
+ const result = await fn();
8
+ events_1.Analytics.logEvent(analytics.successEvent, analytics.trackingCtx);
9
+ return result;
10
+ }
11
+ catch (error) {
12
+ events_1.Analytics.logEvent(analytics.failureEvent, {
13
+ ...analytics.trackingCtx,
14
+ reason: error.message,
15
+ });
16
+ throw error;
17
+ }
18
+ }
19
+ exports.withAnalyticsAsync = withAnalyticsAsync;
@@ -0,0 +1,43 @@
1
+ export declare type Event = BuildEvent | SubmissionEvent;
2
+ export declare enum SubmissionEvent {
3
+ SUBMIT_COMMAND = "submit cli submit command",
4
+ SUBMIT_COMMAND_ATTEMPT = "submit cli attempt",
5
+ SUBMIT_COMMAND_SUCCESS = "submit cli success",
6
+ SUBMIT_COMMAND_FAIL = "submit cli fail",
7
+ GATHER_CREDENTIALS_ATTEMPT = "submit cli gather credentials attempt",
8
+ GATHER_CREDENTIALS_SUCCESS = "submit cli gather credentials success",
9
+ GATHER_CREDENTIALS_FAIL = "submit cli gather credentials fail",
10
+ GATHER_ARCHIVE_ATTEMPT = "submit cli gather archive attempt",
11
+ GATHER_ARCHIVE_SUCCESS = "submit cli gather archive success",
12
+ GATHER_ARCHIVE_FAIL = "submit cli gather archive fail",
13
+ SUBMIT_REQUEST_ATTEMPT = "submit cli request attempt",
14
+ SUBMIT_REQUEST_SUCCESS = "submit cli request success",
15
+ SUBMIT_REQUEST_FAIL = "submit cli request fail"
16
+ }
17
+ export declare enum BuildEvent {
18
+ BUILD_COMMAND = "build cli build command",
19
+ PROJECT_UPLOAD_ATTEMPT = "build cli project upload attempt",
20
+ PROJECT_UPLOAD_SUCCESS = "build cli project upload success",
21
+ PROJECT_UPLOAD_FAIL = "build cli project upload fail",
22
+ GATHER_CREDENTIALS_ATTEMPT = "build cli gather credentials attempt",
23
+ GATHER_CREDENTIALS_SUCCESS = "build cli gather credentials success",
24
+ GATHER_CREDENTIALS_FAIL = "build cli gather credentials fail",
25
+ CONFIGURE_PROJECT_ATTEMPT = "build cli configure project attempt",
26
+ CONFIGURE_PROJECT_SUCCESS = "build cli configure project success",
27
+ CONFIGURE_PROJECT_FAIL = "build cli configure project fail",
28
+ BUILD_REQUEST_ATTEMPT = "build cli build request attempt",
29
+ BUILD_REQUEST_SUCCESS = "build cli build request success",
30
+ BUILD_REQUEST_FAIL = "build cli build request fail",
31
+ BUILD_STATUS_COMMAND = "build cli build status",
32
+ CREDENTIALS_SYNC_COMMAND = "build cli credentials sync command",
33
+ CREDENTIALS_SYNC_UPDATE_LOCAL_ATTEMPT = "build cli credentials sync update local attempt",
34
+ CREDENTIALS_SYNC_UPDATE_LOCAL_SUCCESS = "build cli credentials sync update local success",
35
+ CREDENTIALS_SYNC_UPDATE_LOCAL_FAIL = "build cli credentials sync update local fail",
36
+ CREDENTIALS_SYNC_UPDATE_REMOTE_ATTEMPT = "build cli credentials sync update remote attempt",
37
+ CREDENTIALS_SYNC_UPDATE_REMOTE_SUCCESS = "build cli credentials sync update remote success",
38
+ CREDENTIALS_SYNC_UPDATE_REMOTE_FAIL = "build cli credentials sync update remote fail",
39
+ ANDROID_KEYSTORE_CREATE = "build cli credentials keystore create"
40
+ }
41
+ export declare class Analytics {
42
+ static logEvent(name: Event, properties: Record<string, any>): void;
43
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Analytics = exports.BuildEvent = exports.SubmissionEvent = void 0;
4
+ const rudderstackClient_1 = require("./rudderstackClient");
5
+ var SubmissionEvent;
6
+ (function (SubmissionEvent) {
7
+ SubmissionEvent["SUBMIT_COMMAND"] = "submit cli submit command";
8
+ SubmissionEvent["SUBMIT_COMMAND_ATTEMPT"] = "submit cli attempt";
9
+ SubmissionEvent["SUBMIT_COMMAND_SUCCESS"] = "submit cli success";
10
+ SubmissionEvent["SUBMIT_COMMAND_FAIL"] = "submit cli fail";
11
+ SubmissionEvent["GATHER_CREDENTIALS_ATTEMPT"] = "submit cli gather credentials attempt";
12
+ SubmissionEvent["GATHER_CREDENTIALS_SUCCESS"] = "submit cli gather credentials success";
13
+ SubmissionEvent["GATHER_CREDENTIALS_FAIL"] = "submit cli gather credentials fail";
14
+ SubmissionEvent["GATHER_ARCHIVE_ATTEMPT"] = "submit cli gather archive attempt";
15
+ SubmissionEvent["GATHER_ARCHIVE_SUCCESS"] = "submit cli gather archive success";
16
+ SubmissionEvent["GATHER_ARCHIVE_FAIL"] = "submit cli gather archive fail";
17
+ SubmissionEvent["SUBMIT_REQUEST_ATTEMPT"] = "submit cli request attempt";
18
+ SubmissionEvent["SUBMIT_REQUEST_SUCCESS"] = "submit cli request success";
19
+ SubmissionEvent["SUBMIT_REQUEST_FAIL"] = "submit cli request fail";
20
+ })(SubmissionEvent = exports.SubmissionEvent || (exports.SubmissionEvent = {}));
21
+ var BuildEvent;
22
+ (function (BuildEvent) {
23
+ BuildEvent["BUILD_COMMAND"] = "build cli build command";
24
+ BuildEvent["PROJECT_UPLOAD_ATTEMPT"] = "build cli project upload attempt";
25
+ BuildEvent["PROJECT_UPLOAD_SUCCESS"] = "build cli project upload success";
26
+ BuildEvent["PROJECT_UPLOAD_FAIL"] = "build cli project upload fail";
27
+ BuildEvent["GATHER_CREDENTIALS_ATTEMPT"] = "build cli gather credentials attempt";
28
+ BuildEvent["GATHER_CREDENTIALS_SUCCESS"] = "build cli gather credentials success";
29
+ BuildEvent["GATHER_CREDENTIALS_FAIL"] = "build cli gather credentials fail";
30
+ BuildEvent["CONFIGURE_PROJECT_ATTEMPT"] = "build cli configure project attempt";
31
+ BuildEvent["CONFIGURE_PROJECT_SUCCESS"] = "build cli configure project success";
32
+ BuildEvent["CONFIGURE_PROJECT_FAIL"] = "build cli configure project fail";
33
+ BuildEvent["BUILD_REQUEST_ATTEMPT"] = "build cli build request attempt";
34
+ BuildEvent["BUILD_REQUEST_SUCCESS"] = "build cli build request success";
35
+ BuildEvent["BUILD_REQUEST_FAIL"] = "build cli build request fail";
36
+ BuildEvent["BUILD_STATUS_COMMAND"] = "build cli build status";
37
+ BuildEvent["CREDENTIALS_SYNC_COMMAND"] = "build cli credentials sync command";
38
+ BuildEvent["CREDENTIALS_SYNC_UPDATE_LOCAL_ATTEMPT"] = "build cli credentials sync update local attempt";
39
+ BuildEvent["CREDENTIALS_SYNC_UPDATE_LOCAL_SUCCESS"] = "build cli credentials sync update local success";
40
+ BuildEvent["CREDENTIALS_SYNC_UPDATE_LOCAL_FAIL"] = "build cli credentials sync update local fail";
41
+ BuildEvent["CREDENTIALS_SYNC_UPDATE_REMOTE_ATTEMPT"] = "build cli credentials sync update remote attempt";
42
+ BuildEvent["CREDENTIALS_SYNC_UPDATE_REMOTE_SUCCESS"] = "build cli credentials sync update remote success";
43
+ BuildEvent["CREDENTIALS_SYNC_UPDATE_REMOTE_FAIL"] = "build cli credentials sync update remote fail";
44
+ BuildEvent["ANDROID_KEYSTORE_CREATE"] = "build cli credentials keystore create";
45
+ })(BuildEvent = exports.BuildEvent || (exports.BuildEvent = {}));
46
+ class Analytics {
47
+ static logEvent(name, properties) {
48
+ (0, rudderstackClient_1.logEvent)(name, properties);
49
+ }
50
+ }
51
+ exports.Analytics = Analytics;
@@ -6,8 +6,8 @@ const rudder_sdk_node_1 = (0, tslib_1.__importDefault)(require("@expo/rudder-sdk
6
6
  const os_1 = (0, tslib_1.__importDefault)(require("os"));
7
7
  const url_1 = require("url");
8
8
  const uuid_1 = require("uuid");
9
- const UserSettings_1 = (0, tslib_1.__importDefault)(require("./user/UserSettings"));
10
- const easCli_1 = require("./utils/easCli");
9
+ const UserSettings_1 = (0, tslib_1.__importDefault)(require("../user/UserSettings"));
10
+ const easCli_1 = require("../utils/easCli");
11
11
  const PLATFORM_TO_ANALYTICS_PLATFORM = {
12
12
  darwin: 'Mac',
13
13
  win32: 'Windows',
@@ -5,6 +5,8 @@ const tslib_1 = require("tslib");
5
5
  const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
7
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
8
+ const common_1 = require("../analytics/common");
9
+ const events_1 = require("../analytics/events");
8
10
  const generated_1 = require("../graphql/generated");
9
11
  const BuildQuery_1 = require("../graphql/queries/BuildQuery");
10
12
  const log_1 = (0, tslib_1.__importStar)(require("../log"));
@@ -17,20 +19,21 @@ const promise_1 = require("../utils/promise");
17
19
  const vcs_1 = require("../vcs");
18
20
  const local_1 = require("./local");
19
21
  const metadata_1 = require("./metadata");
20
- const analytics_1 = (0, tslib_1.__importStar)(require("./utils/analytics"));
21
22
  const printBuildInfo_1 = require("./utils/printBuildInfo");
22
23
  const repository_1 = require("./utils/repository");
23
24
  async function prepareBuildRequestForPlatformAsync(builder) {
24
25
  const { ctx } = builder;
25
- const credentialsResult = await withAnalyticsAsync(async () => await builder.ensureCredentialsAsync(ctx), {
26
- successEvent: analytics_1.Event.GATHER_CREDENTIALS_SUCCESS,
27
- failureEvent: analytics_1.Event.GATHER_CREDENTIALS_FAIL,
26
+ const credentialsResult = await (0, common_1.withAnalyticsAsync)(async () => await builder.ensureCredentialsAsync(ctx), {
27
+ attemptEvent: events_1.BuildEvent.GATHER_CREDENTIALS_ATTEMPT,
28
+ successEvent: events_1.BuildEvent.GATHER_CREDENTIALS_SUCCESS,
29
+ failureEvent: events_1.BuildEvent.GATHER_CREDENTIALS_FAIL,
28
30
  trackingCtx: ctx.trackingCtx,
29
31
  });
30
32
  if (!ctx.skipProjectConfiguration) {
31
- await withAnalyticsAsync(async () => await builder.ensureProjectConfiguredAsync(ctx), {
32
- successEvent: analytics_1.Event.CONFIGURE_PROJECT_SUCCESS,
33
- failureEvent: analytics_1.Event.CONFIGURE_PROJECT_FAIL,
33
+ await (0, common_1.withAnalyticsAsync)(async () => await builder.ensureProjectConfiguredAsync(ctx), {
34
+ attemptEvent: events_1.BuildEvent.CONFIGURE_PROJECT_ATTEMPT,
35
+ successEvent: events_1.BuildEvent.CONFIGURE_PROJECT_SUCCESS,
36
+ failureEvent: events_1.BuildEvent.CONFIGURE_PROJECT_FAIL,
34
37
  trackingCtx: ctx.trackingCtx,
35
38
  });
36
39
  }
@@ -92,7 +95,7 @@ exports.prepareBuildRequestForPlatformAsync = prepareBuildRequestForPlatformAsyn
92
95
  async function uploadProjectAsync(ctx) {
93
96
  let projectTarballPath;
94
97
  try {
95
- return await withAnalyticsAsync(async () => {
98
+ return await (0, common_1.withAnalyticsAsync)(async () => {
96
99
  const projectTarball = await (0, repository_1.makeProjectTarballAsync)();
97
100
  projectTarballPath = projectTarball.path;
98
101
  const { bucketKey } = await (0, uploads_1.uploadAsync)(generated_1.UploadSessionType.EasBuildProjectSources, projectTarball.path, (0, progress_1.createProgressTracker)({
@@ -102,8 +105,9 @@ async function uploadProjectAsync(ctx) {
102
105
  }));
103
106
  return bucketKey;
104
107
  }, {
105
- successEvent: analytics_1.Event.PROJECT_UPLOAD_SUCCESS,
106
- failureEvent: analytics_1.Event.PROJECT_UPLOAD_FAIL,
108
+ attemptEvent: events_1.BuildEvent.PROJECT_UPLOAD_ATTEMPT,
109
+ successEvent: events_1.BuildEvent.PROJECT_UPLOAD_SUCCESS,
110
+ failureEvent: events_1.BuildEvent.PROJECT_UPLOAD_FAIL,
107
111
  trackingCtx: ctx.trackingCtx,
108
112
  });
109
113
  }
@@ -115,7 +119,7 @@ async function uploadProjectAsync(ctx) {
115
119
  }
116
120
  async function sendBuildRequestAsync(builder, job, metadata) {
117
121
  const { ctx } = builder;
118
- return await withAnalyticsAsync(async () => {
122
+ return await (0, common_1.withAnalyticsAsync)(async () => {
119
123
  if (log_1.default.isDebug) {
120
124
  log_1.default.log(`Starting ${platform_1.requestedPlatformDisplayNames[job.platform]} build`);
121
125
  }
@@ -123,25 +127,12 @@ async function sendBuildRequestAsync(builder, job, metadata) {
123
127
  (0, printBuildInfo_1.printDeprecationWarnings)(deprecationInfo);
124
128
  return build;
125
129
  }, {
126
- successEvent: analytics_1.Event.BUILD_REQUEST_SUCCESS,
127
- failureEvent: analytics_1.Event.BUILD_REQUEST_FAIL,
130
+ attemptEvent: events_1.BuildEvent.BUILD_REQUEST_ATTEMPT,
131
+ successEvent: events_1.BuildEvent.BUILD_REQUEST_SUCCESS,
132
+ failureEvent: events_1.BuildEvent.BUILD_REQUEST_FAIL,
128
133
  trackingCtx: ctx.trackingCtx,
129
134
  });
130
135
  }
131
- async function withAnalyticsAsync(fn, analytics) {
132
- try {
133
- const result = await fn();
134
- analytics_1.default.logEvent(analytics.successEvent, analytics.trackingCtx);
135
- return result;
136
- }
137
- catch (error) {
138
- analytics_1.default.logEvent(analytics.failureEvent, {
139
- ...analytics.trackingCtx,
140
- reason: error.message,
141
- });
142
- throw error;
143
- }
144
- }
145
136
  async function waitForBuildEndAsync(buildIds, { timeoutSec = 3600, intervalSec = 30 } = {}) {
146
137
  log_1.default.log(`Waiting for build${buildIds.length > 1 ? 's' : ''} to complete. You can press Ctrl+C to exit.`);
147
138
  const spinner = (0, ora_1.ora)().start();
@@ -1,10 +1,10 @@
1
1
  import { ExpoConfig } from '@expo/config';
2
2
  import { Platform, Workflow } from '@expo/eas-build-job';
3
3
  import { BuildProfile } from '@expo/eas-json';
4
+ import { TrackingContext } from '../analytics/common';
4
5
  import { CredentialsContext } from '../credentials/context';
5
6
  import { RequestedPlatform } from '../platform';
6
7
  import { Actor } from '../user/User';
7
- import { TrackingContext } from './types';
8
8
  export interface ConfigureContext {
9
9
  user: Actor;
10
10
  projectDir: string;
@@ -6,13 +6,13 @@ const eas_build_job_1 = require("@expo/eas-build-job");
6
6
  const json_file_1 = (0, tslib_1.__importDefault)(require("@expo/json-file"));
7
7
  const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
8
8
  const uuid_1 = require("uuid");
9
+ const events_1 = require("../analytics/events");
9
10
  const context_1 = require("../credentials/context");
10
11
  const expoConfig_1 = require("../project/expoConfig");
11
12
  const projectUtils_1 = require("../project/projectUtils");
12
13
  const workflow_1 = require("../project/workflow");
13
14
  const Account_1 = require("../user/Account");
14
15
  const actions_1 = require("../user/actions");
15
- const analytics_1 = (0, tslib_1.__importStar)(require("./utils/analytics"));
16
16
  async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, local, nonInteractive = false, platform, projectDir, skipProjectConfiguration = false, }) {
17
17
  var _a;
18
18
  const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
@@ -42,7 +42,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
42
42
  project_type: workflow,
43
43
  ...devClientProperties,
44
44
  };
45
- analytics_1.default.logEvent(analytics_1.Event.BUILD_COMMAND, trackingCtx);
45
+ events_1.Analytics.logEvent(events_1.BuildEvent.BUILD_COMMAND, trackingCtx);
46
46
  return {
47
47
  accountName,
48
48
  buildProfile,
@@ -8,7 +8,7 @@ const BuildCredentialsUtils_1 = require("../../credentials/ios/actions/BuildCred
8
8
  const entitlements_1 = require("../../credentials/ios/appstore/entitlements");
9
9
  const credentials_1 = require("../utils/credentials");
10
10
  async function ensureIosCredentialsAsync(buildCtx, targets) {
11
- var _a;
11
+ var _a, _b;
12
12
  if (!shouldProvideCredentials(buildCtx)) {
13
13
  return;
14
14
  }
@@ -16,9 +16,9 @@ async function ensureIosCredentialsAsync(buildCtx, targets) {
16
16
  app: (0, BuildCredentialsUtils_1.getAppFromContext)(buildCtx.credentialsCtx),
17
17
  targets,
18
18
  iosCapabilitiesOptions: {
19
- entitlements: await (0, entitlements_1.resolveEntitlementsJsonAsync)(buildCtx.projectDir, buildCtx.workflow),
19
+ entitlements: await (0, entitlements_1.resolveEntitlementsJsonAsync)(buildCtx.projectDir, buildCtx.workflow, (_a = buildCtx.buildProfile.env) !== null && _a !== void 0 ? _a : {}),
20
20
  },
21
- distribution: (_a = buildCtx.buildProfile.distribution) !== null && _a !== void 0 ? _a : 'store',
21
+ distribution: (_b = buildCtx.buildProfile.distribution) !== null && _b !== void 0 ? _b : 'store',
22
22
  enterpriseProvisioning: buildCtx.buildProfile.enterpriseProvisioning,
23
23
  });
24
24
  const { credentialsSource } = buildCtx.buildProfile;
@@ -3,36 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  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
- const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
8
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
9
- const log_1 = (0, tslib_1.__importDefault)(require("../log"));
10
6
  const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
7
+ const PLUGIN_PACKAGE_VERSION = '0.0.47';
11
8
  async function runLocalBuildAsync(job) {
12
- var _a, _b;
13
- const execNameOrPath = (_b = (_a = process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) !== null && _a !== void 0 ? _a : (await findWithNodeResolutionAsync())) !== null && _b !== void 0 ? _b : PLUGIN_PACKAGE_NAME;
14
- try {
15
- const arg = Buffer.from(JSON.stringify({ job })).toString('base64');
16
- await (0, spawn_async_1.default)(execNameOrPath, [arg], {
17
- stdio: 'inherit',
18
- });
19
- }
20
- catch (err) {
21
- if (err.code === 'ENOENT') {
22
- log_1.default.warn(`Could not resolve executable ${execNameOrPath}.`);
23
- log_1.default.warn(`Install ${PLUGIN_PACKAGE_NAME} package from npm e.g. ${chalk_1.default.bold(`npm install -g ${PLUGIN_PACKAGE_NAME}`)} and make sure it's in PATH.`);
24
- throw err;
25
- }
26
- }
9
+ const { command, args } = getCommandAndArgs(job);
10
+ await (0, spawn_async_1.default)(command, args, {
11
+ stdio: 'inherit',
12
+ });
27
13
  }
28
14
  exports.runLocalBuildAsync = runLocalBuildAsync;
29
- async function findWithNodeResolutionAsync() {
30
- try {
31
- const resolvedPath = path_1.default.resolve(path_1.default.dirname(require.resolve(PLUGIN_PACKAGE_NAME)), '../bin/run');
32
- if (await fs_extra_1.default.pathExists(resolvedPath)) {
33
- return resolvedPath;
34
- }
15
+ function getCommandAndArgs(job) {
16
+ const jobBase64 = Buffer.from(JSON.stringify({ job })).toString('base64');
17
+ if (process.env.EAS_LOCAL_BUILD_PLUGIN_PATH) {
18
+ return {
19
+ command: process.env.EAS_LOCAL_BUILD_PLUGIN_PATH,
20
+ args: [jobBase64],
21
+ };
22
+ }
23
+ else {
24
+ return {
25
+ command: 'npx',
26
+ args: ['-y', `${PLUGIN_PACKAGE_NAME}@${PLUGIN_PACKAGE_VERSION}`, jobBase64],
27
+ };
35
28
  }
36
- catch { }
37
- return undefined;
38
29
  }
@@ -11,4 +11,3 @@ export declare enum BuildDistributionType {
11
11
  INTERNAL = "internal",
12
12
  SIMULATOR = "simulator"
13
13
  }
14
- export declare type TrackingContext = Record<string, string | number | boolean>;
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
4
4
  const eas_json_1 = require("@expo/eas-json");
5
5
  const command_1 = require("@oclif/command");
6
6
  const semver_1 = (0, tslib_1.__importDefault)(require("semver"));
7
- const analytics_1 = require("../analytics");
7
+ const rudderstackClient_1 = require("../analytics/rudderstackClient");
8
8
  const log_1 = (0, tslib_1.__importDefault)(require("../log"));
9
9
  const projectUtils_1 = require("../project/projectUtils");
10
10
  const User_1 = require("../user/User");
@@ -25,7 +25,7 @@ class EasCommand extends command_1.Command {
25
25
  async run() {
26
26
  var _a;
27
27
  eas_json_1.EasJsonReader.setLog(log_1.default);
28
- await (0, analytics_1.initAsync)();
28
+ await (0, rudderstackClient_1.initAsync)();
29
29
  await this.applyCliConfigAsync();
30
30
  if (this.requiresAuthentication) {
31
31
  const { flags } = this.parse();
@@ -35,7 +35,7 @@ class EasCommand extends command_1.Command {
35
35
  else {
36
36
  await (0, User_1.getUserAsync)();
37
37
  }
38
- (0, analytics_1.logEvent)(analytics_1.AnalyticsEvent.ACTION, {
38
+ (0, rudderstackClient_1.logEvent)(rudderstackClient_1.AnalyticsEvent.ACTION, {
39
39
  // id is assigned by oclif in constructor based on the filepath:
40
40
  // commands/submit === submit, commands/build/list === build:list
41
41
  action: `eas ${this.id}`,
@@ -44,7 +44,7 @@ class EasCommand extends command_1.Command {
44
44
  }
45
45
  // eslint-disable-next-line async-protect/async-suffix
46
46
  async finally(err) {
47
- await (0, analytics_1.flushAsync)();
47
+ await (0, rudderstackClient_1.flushAsync)();
48
48
  return super.finally(err);
49
49
  }
50
50
  async applyCliConfigAsync() {
@@ -154,7 +154,7 @@ class Build extends EasCommand_1.default {
154
154
  wait: flags['wait'],
155
155
  clearCache: flags['clear-cache'],
156
156
  json: flags['json'],
157
- autoSubmit: flags['auto-submit'],
157
+ autoSubmit: flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined,
158
158
  submitProfile: (_a = flags['auto-submit-with-profile']) !== null && _a !== void 0 ? _a : profile,
159
159
  };
160
160
  }