mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-14 10:08:06 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20ebf24a20 | ||
|
|
427ececb0b | ||
|
|
f65670e18f | ||
|
|
41a0a4554d | ||
|
|
c1da053f8c | ||
|
|
57da02af9d | ||
|
|
b9c505bbdc | ||
|
|
633e6a6721 | ||
|
|
f7ddb4ba8f | ||
|
|
91eb2c467b | ||
|
|
f237a7e074 | ||
|
|
242c3cffb6 | ||
|
|
eee54af6ee | ||
|
|
86f86dbe86 | ||
|
|
cc99bb3326 | ||
|
|
08dc52c631 | ||
|
|
51db45a861 | ||
|
|
790853b3b2 | ||
|
|
23479acabc |
No files matched your search
+28
-1
@@ -8,12 +8,39 @@ This is the log of notable changes to EAS CLI and related packages.
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Add custom metadata validation command with more complex rules. ([#1416](https://github.com/expo/eas-cli/pull/1416) by [@byCedric](https://github.com/byCedric))
|
||||
- Add `eas build:run` command which runs iOS simulator builds from the CLI. ([#1447](https://github.com/expo/eas-cli/pull/1447) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
- Add feature gate support. ([#1475](https://github.com/expo/eas-cli/pull/1475) by [@wschurman](https://github.com/wschurman))
|
||||
- Warn about outdated build deployment when configuring EAS Update.
|
||||
([#1467](https://github.com/expo/eas-cli/pull/1467) by [@fiberjw](https://github.com/fiberjw))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
### 🧹 Chores
|
||||
|
||||
- Replace `secret:list` table with formatted fields. ([#1464](https://github.com/expo/eas-cli/pull/1464) by [@byCedric](https://github.com/byCedric))
|
||||
- Replace `device:create` input table with formatted fields. ([#1465](https://github.com/expo/eas-cli/pull/1465) by [@byCedric](https://github.com/byCedric))
|
||||
- Replace `channel:view` table with formatted fields. ([#1466](https://github.com/expo/eas-cli/pull/1466) by [@byCedric](https://github.com/byCedric))
|
||||
- Upgrade dependencies. ([#1480](https://github.com/expo/eas-cli/pull/1480) by [@dsokal](https://github.com/dsokal))
|
||||
- Replace all remaining tables with formatted fields. ([#1481](https://github.com/expo/eas-cli/pull/1481) by [@byCedric](https://github.com/byCedric))
|
||||
|
||||
## [2.5.1](https://github.com/expo/eas-cli/releases/tag/v2.5.1) - 2022-10-24
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Revert using local CLI for `expo export` ([#1460](https://github.com/expo/eas-cli/pull/1460)). ([#1472](https://github.com/expo/eas-cli/pull/1472) by [@dsokal](https://github.com/dsokal))
|
||||
|
||||
## [2.5.0](https://github.com/expo/eas-cli/releases/tag/v2.5.0) - 2022-10-24
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Update init command to handle slug and owner. ([#1452](https://github.com/expo/eas-cli/pull/1452) by [@wschurman](https://github.com/wschurman))
|
||||
- Add `eas secret:push`. ([#1457](https://github.com/expo/eas-cli/pull/1457) by [@dsokal](https://github.com/dsokal))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Initialize analytics consistently and move analytics into context. ([#1444](https://github.com/expo/eas-cli/pull/1444) by [@wschurman](https://github.com/wschurman))
|
||||
- Skip using `--non-interactive` and `--experimental-bundle` flags when local Expo CLI is installed. ([#1460](https://github.com/expo/eas-cli/pull/1460) by [@EvanBacon](https://github.com/EvanBacon))
|
||||
- - Skip using `--non-interactive` and `--experimental-bundle` flags when local Expo CLI is installed. ([#1460](https://github.com/expo/eas-cli/pull/1460) by [@EvanBacon](https://github.com/EvanBacon))
|
||||
|
||||
### 🧹 Chores
|
||||
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ packages/eas-cli/src/commands/build @dsokal @wkozyra95
|
||||
packages/eas-cli/src/submit @dsokal
|
||||
packages/eas-cli/src/commands/submit.ts @dsokal
|
||||
|
||||
packages/eas-cli/src/update @kgc00 @wschurman
|
||||
packages/eas-cli/src/commands/update @kgc00 @wschurman
|
||||
packages/eas-cli/src/update @EvanBacon @byCedric @wschurman
|
||||
packages/eas-cli/src/commands/update @EvanBacon @byCedric @wschurman
|
||||
|
||||
packages/eas-cli/schema @bycedric
|
||||
packages/eas-cli/src/metadata @bycedric
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"version": "2.5.0"
|
||||
"version": "2.6.0"
|
||||
}
|
||||
+9
-9
@@ -18,19 +18,19 @@
|
||||
"clean": "lerna run clean && rm -rf node_modules coverage"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "28.1.6",
|
||||
"@types/node": "18.6.5",
|
||||
"eslint": "8.21.0",
|
||||
"@types/jest": "29.2.0",
|
||||
"@types/node": "18.11.5",
|
||||
"eslint": "8.26.0",
|
||||
"eslint-config-universe": "11.1.0",
|
||||
"eslint-plugin-async-protect": "2.1.0",
|
||||
"eslint-plugin-node": "11.1.0",
|
||||
"jest": "28.1.3",
|
||||
"jest-watch-typeahead": "2.0.0",
|
||||
"lerna": "4.0.0",
|
||||
"oclif": "3.1.2",
|
||||
"jest": "29.2.2",
|
||||
"jest-watch-typeahead": "2.2.0",
|
||||
"lerna": "6.0.1",
|
||||
"oclif": "3.2.22",
|
||||
"prettier": "2.7.1",
|
||||
"ts-jest": "28.0.7",
|
||||
"typescript": "4.7.4"
|
||||
"ts-jest": "29.0.3",
|
||||
"typescript": "4.8.4"
|
||||
},
|
||||
"volta": {
|
||||
"node": "18.6.0",
|
||||
|
||||
+89
-49
@@ -89,6 +89,7 @@ eas --help COMMAND
|
||||
* [`eas init`](#eas-init)
|
||||
* [`eas login`](#eas-login)
|
||||
* [`eas logout`](#eas-logout)
|
||||
* [`eas metadata:lint`](#eas-metadatalint)
|
||||
* [`eas metadata:pull`](#eas-metadatapull)
|
||||
* [`eas metadata:push`](#eas-metadatapush)
|
||||
* [`eas open`](#eas-open)
|
||||
@@ -97,6 +98,7 @@ eas --help COMMAND
|
||||
* [`eas secret:create`](#eas-secretcreate)
|
||||
* [`eas secret:delete`](#eas-secretdelete)
|
||||
* [`eas secret:list`](#eas-secretlist)
|
||||
* [`eas secret:push`](#eas-secretpush)
|
||||
* [`eas submit`](#eas-submit)
|
||||
* [`eas update`](#eas-update)
|
||||
* [`eas update:configure`](#eas-updateconfigure)
|
||||
@@ -125,7 +127,7 @@ ALIASES
|
||||
$ eas login
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/account/login.ts)_
|
||||
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/account/login.ts)_
|
||||
|
||||
## `eas account:logout`
|
||||
|
||||
@@ -142,7 +144,7 @@ ALIASES
|
||||
$ eas logout
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/account/logout.ts)_
|
||||
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/account/logout.ts)_
|
||||
|
||||
## `eas account:view`
|
||||
|
||||
@@ -159,7 +161,7 @@ ALIASES
|
||||
$ eas whoami
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/account/view.ts)_
|
||||
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/account/view.ts)_
|
||||
|
||||
## `eas analytics [STATUS]`
|
||||
|
||||
@@ -173,7 +175,7 @@ DESCRIPTION
|
||||
display or change analytics settings
|
||||
```
|
||||
|
||||
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/analytics.ts)_
|
||||
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/analytics.ts)_
|
||||
|
||||
## `eas autocomplete [SHELL]`
|
||||
|
||||
@@ -202,7 +204,7 @@ EXAMPLES
|
||||
$ eas autocomplete --refresh-cache
|
||||
```
|
||||
|
||||
_See code: [@expo/plugin-autocomplete](https://github.com/expo/plugin-autocomplete/blob/v1.4.0/src/commands/autocomplete/index.ts)_
|
||||
_See code: [@oclif/plugin-autocomplete](https://github.com/oclif/plugin-autocomplete/blob/v1.3.4/src/commands/autocomplete/index.ts)_
|
||||
|
||||
## `eas branch:create [NAME]`
|
||||
|
||||
@@ -223,7 +225,7 @@ DESCRIPTION
|
||||
create a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/branch/create.ts)_
|
||||
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/branch/create.ts)_
|
||||
|
||||
## `eas branch:delete [NAME]`
|
||||
|
||||
@@ -244,7 +246,7 @@ DESCRIPTION
|
||||
delete a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/branch/delete.ts)_
|
||||
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/branch/delete.ts)_
|
||||
|
||||
## `eas branch:list`
|
||||
|
||||
@@ -264,7 +266,7 @@ DESCRIPTION
|
||||
list all branches
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/branch/list.ts)_
|
||||
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/branch/list.ts)_
|
||||
|
||||
## `eas branch:rename`
|
||||
|
||||
@@ -284,7 +286,7 @@ DESCRIPTION
|
||||
rename a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/branch/rename.ts)_
|
||||
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/branch/rename.ts)_
|
||||
|
||||
## `eas branch:view [NAME]`
|
||||
|
||||
@@ -307,7 +309,7 @@ DESCRIPTION
|
||||
view a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/branch/view.ts)_
|
||||
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/branch/view.ts)_
|
||||
|
||||
## `eas build`
|
||||
|
||||
@@ -337,7 +339,7 @@ DESCRIPTION
|
||||
start a build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/index.ts)_
|
||||
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/index.ts)_
|
||||
|
||||
## `eas build:cancel [BUILD_ID]`
|
||||
|
||||
@@ -354,7 +356,7 @@ DESCRIPTION
|
||||
cancel a build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/cancel.ts)_
|
||||
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/cancel.ts)_
|
||||
|
||||
## `eas build:configure`
|
||||
|
||||
@@ -371,7 +373,7 @@ DESCRIPTION
|
||||
configure the project to support EAS Build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/configure.ts)_
|
||||
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/configure.ts)_
|
||||
|
||||
## `eas build:inspect`
|
||||
|
||||
@@ -406,7 +408,7 @@ DESCRIPTION
|
||||
inspect the state of the project at specific build stages, useful for troubleshooting
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/inspect.ts)_
|
||||
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/inspect.ts)_
|
||||
|
||||
## `eas build:list`
|
||||
|
||||
@@ -443,7 +445,7 @@ DESCRIPTION
|
||||
list all builds for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/list.ts)_
|
||||
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/list.ts)_
|
||||
|
||||
## `eas build:submit`
|
||||
|
||||
@@ -490,7 +492,7 @@ DESCRIPTION
|
||||
Update version of an app.
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/version/set.ts)_
|
||||
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/version/set.ts)_
|
||||
|
||||
## `eas build:version:sync`
|
||||
|
||||
@@ -509,7 +511,7 @@ DESCRIPTION
|
||||
Update a version in native code with a value stored on EAS servers
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/version/sync.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/version/sync.ts)_
|
||||
_See code: [src/commands/build/version/sync.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/version/sync.ts)_
|
||||
|
||||
## `eas build:view [BUILD_ID]`
|
||||
|
||||
@@ -526,7 +528,7 @@ DESCRIPTION
|
||||
view a build for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/build/view.ts)_
|
||||
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/build/view.ts)_
|
||||
|
||||
## `eas channel:create [NAME]`
|
||||
|
||||
@@ -547,7 +549,7 @@ DESCRIPTION
|
||||
create a channel
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/channel/create.ts)_
|
||||
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/channel/create.ts)_
|
||||
|
||||
## `eas channel:edit [NAME]`
|
||||
|
||||
@@ -569,7 +571,7 @@ DESCRIPTION
|
||||
point a channel at a new branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/channel/edit.ts)_
|
||||
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/channel/edit.ts)_
|
||||
|
||||
## `eas channel:list`
|
||||
|
||||
@@ -589,7 +591,7 @@ DESCRIPTION
|
||||
list all channels
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/channel/list.ts)_
|
||||
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/channel/list.ts)_
|
||||
|
||||
## `eas channel:view [NAME]`
|
||||
|
||||
@@ -612,7 +614,7 @@ DESCRIPTION
|
||||
view a channel
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/channel/view.ts)_
|
||||
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/channel/view.ts)_
|
||||
|
||||
## `eas config`
|
||||
|
||||
@@ -631,7 +633,7 @@ DESCRIPTION
|
||||
display project configuration (app.json + eas.json)
|
||||
```
|
||||
|
||||
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/config.ts)_
|
||||
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/config.ts)_
|
||||
|
||||
## `eas credentials`
|
||||
|
||||
@@ -648,7 +650,7 @@ DESCRIPTION
|
||||
manage credentials
|
||||
```
|
||||
|
||||
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/credentials.ts)_
|
||||
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/credentials.ts)_
|
||||
|
||||
## `eas device:create`
|
||||
|
||||
@@ -662,7 +664,7 @@ DESCRIPTION
|
||||
register new Apple Devices to use for internal distribution
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/device/create.ts)_
|
||||
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/device/create.ts)_
|
||||
|
||||
## `eas device:delete`
|
||||
|
||||
@@ -682,7 +684,7 @@ DESCRIPTION
|
||||
remove a registered device from your account
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/device/delete.ts)_
|
||||
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/device/delete.ts)_
|
||||
|
||||
## `eas device:list`
|
||||
|
||||
@@ -703,7 +705,7 @@ DESCRIPTION
|
||||
list all registered devices for your account
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/device/list.ts)_
|
||||
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/device/list.ts)_
|
||||
|
||||
## `eas device:view [UDID]`
|
||||
|
||||
@@ -717,7 +719,7 @@ DESCRIPTION
|
||||
view a device for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/device/view.ts)_
|
||||
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/device/view.ts)_
|
||||
|
||||
## `eas diagnostics`
|
||||
|
||||
@@ -731,7 +733,7 @@ DESCRIPTION
|
||||
display environment info
|
||||
```
|
||||
|
||||
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/diagnostics.ts)_
|
||||
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/diagnostics.ts)_
|
||||
|
||||
## `eas help [COMMAND]`
|
||||
|
||||
@@ -751,7 +753,7 @@ DESCRIPTION
|
||||
display help for eas-cli
|
||||
```
|
||||
|
||||
_See code: [@expo/plugin-help](https://github.com/expo/oclif-plugin-help/blob/v5.3.0/src/commands/help.ts)_
|
||||
_See code: [@expo/plugin-help](https://github.com/expo/oclif-plugin-help/blob/v5.1.16/src/commands/help.ts)_
|
||||
|
||||
## `eas init`
|
||||
|
||||
@@ -803,6 +805,24 @@ ALIASES
|
||||
$ eas logout
|
||||
```
|
||||
|
||||
## `eas metadata:lint`
|
||||
|
||||
validate the local store configuration
|
||||
|
||||
```
|
||||
USAGE
|
||||
$ eas metadata:lint [--json] [--profile <value>]
|
||||
|
||||
FLAGS
|
||||
--json Enable JSON output, non-JSON messages will be printed to stderr
|
||||
--profile=<value> Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.
|
||||
|
||||
DESCRIPTION
|
||||
validate the local store configuration
|
||||
```
|
||||
|
||||
_See code: [src/commands/metadata/lint.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/metadata/lint.ts)_
|
||||
|
||||
## `eas metadata:pull`
|
||||
|
||||
generate the local store configuration from the app stores
|
||||
@@ -818,7 +838,7 @@ DESCRIPTION
|
||||
generate the local store configuration from the app stores
|
||||
```
|
||||
|
||||
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/metadata/pull.ts)_
|
||||
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/metadata/pull.ts)_
|
||||
|
||||
## `eas metadata:push`
|
||||
|
||||
@@ -835,7 +855,7 @@ DESCRIPTION
|
||||
sync the local store configuration to the app stores
|
||||
```
|
||||
|
||||
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/metadata/push.ts)_
|
||||
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/metadata/push.ts)_
|
||||
|
||||
## `eas open`
|
||||
|
||||
@@ -849,7 +869,7 @@ DESCRIPTION
|
||||
open the project page in a web browser
|
||||
```
|
||||
|
||||
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/open.ts)_
|
||||
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/open.ts)_
|
||||
|
||||
## `eas project:info`
|
||||
|
||||
@@ -863,7 +883,7 @@ DESCRIPTION
|
||||
information about the current project
|
||||
```
|
||||
|
||||
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/project/info.ts)_
|
||||
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/project/info.ts)_
|
||||
|
||||
## `eas project:init`
|
||||
|
||||
@@ -885,7 +905,7 @@ ALIASES
|
||||
$ eas init
|
||||
```
|
||||
|
||||
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/project/init.ts)_
|
||||
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/project/init.ts)_
|
||||
|
||||
## `eas secret:create`
|
||||
|
||||
@@ -908,7 +928,7 @@ DESCRIPTION
|
||||
create an environment secret on the current project or owner account
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/secret/create.ts)_
|
||||
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/secret/create.ts)_
|
||||
|
||||
## `eas secret:delete`
|
||||
|
||||
@@ -926,7 +946,7 @@ DESCRIPTION
|
||||
delete an environment secret by ID
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/secret/delete.ts)_
|
||||
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/secret/delete.ts)_
|
||||
|
||||
## `eas secret:list`
|
||||
|
||||
@@ -940,7 +960,27 @@ DESCRIPTION
|
||||
list environment secrets available for your current app
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/secret/list.ts)_
|
||||
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/secret/list.ts)_
|
||||
|
||||
## `eas secret:push`
|
||||
|
||||
read environment secrets from env file and store on the server
|
||||
|
||||
```
|
||||
USAGE
|
||||
$ eas secret:push [--scope account|project] [--env-file <value>] [--force] [--non-interactive]
|
||||
|
||||
FLAGS
|
||||
--env-file=<value> Env file with secrets
|
||||
--force Delete and recreate existing secrets
|
||||
--non-interactive Run the command in non-interactive mode.
|
||||
--scope=(account|project) [default: project] Scope for the secrets
|
||||
|
||||
DESCRIPTION
|
||||
read environment secrets from env file and store on the server
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/push.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/secret/push.ts)_
|
||||
|
||||
## `eas submit`
|
||||
|
||||
@@ -970,7 +1010,7 @@ ALIASES
|
||||
$ eas build:submit
|
||||
```
|
||||
|
||||
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/submit.ts)_
|
||||
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/submit.ts)_
|
||||
|
||||
## `eas update`
|
||||
|
||||
@@ -1000,7 +1040,7 @@ DESCRIPTION
|
||||
publish an update group
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/update/index.ts)_
|
||||
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/update/index.ts)_
|
||||
|
||||
## `eas update:configure`
|
||||
|
||||
@@ -1017,7 +1057,7 @@ DESCRIPTION
|
||||
configure the project to support EAS Update
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/update/configure.ts)_
|
||||
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/update/configure.ts)_
|
||||
|
||||
## `eas update:delete GROUPID`
|
||||
|
||||
@@ -1038,7 +1078,7 @@ DESCRIPTION
|
||||
delete all the updates in an update group
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/update/delete.ts)_
|
||||
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/update/delete.ts)_
|
||||
|
||||
## `eas update:list`
|
||||
|
||||
@@ -1060,7 +1100,7 @@ DESCRIPTION
|
||||
view the recent updates
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/update/list.ts)_
|
||||
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/update/list.ts)_
|
||||
|
||||
## `eas update:view GROUPID`
|
||||
|
||||
@@ -1080,7 +1120,7 @@ DESCRIPTION
|
||||
update group details
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/update/view.ts)_
|
||||
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/update/view.ts)_
|
||||
|
||||
## `eas webhook:create`
|
||||
|
||||
@@ -1101,7 +1141,7 @@ DESCRIPTION
|
||||
create a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/webhook/create.ts)_
|
||||
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/webhook/create.ts)_
|
||||
|
||||
## `eas webhook:delete [ID]`
|
||||
|
||||
@@ -1121,7 +1161,7 @@ DESCRIPTION
|
||||
delete a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/webhook/delete.ts)_
|
||||
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/webhook/delete.ts)_
|
||||
|
||||
## `eas webhook:list`
|
||||
|
||||
@@ -1138,7 +1178,7 @@ DESCRIPTION
|
||||
list webhooks
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/webhook/list.ts)_
|
||||
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/webhook/list.ts)_
|
||||
|
||||
## `eas webhook:update`
|
||||
|
||||
@@ -1160,7 +1200,7 @@ DESCRIPTION
|
||||
update a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/webhook/update.ts)_
|
||||
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/webhook/update.ts)_
|
||||
|
||||
## `eas webhook:view ID`
|
||||
|
||||
@@ -1177,7 +1217,7 @@ DESCRIPTION
|
||||
view a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v2.5.0/packages/eas-cli/src/commands/webhook/view.ts)_
|
||||
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v2.6.0/packages/eas-cli/src/commands/webhook/view.ts)_
|
||||
|
||||
## `eas whoami`
|
||||
|
||||
|
||||
Generated
+492
-52
@@ -2274,6 +2274,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "revokeEndpoint",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "tokenEndpoint",
|
||||
"description": "",
|
||||
@@ -2442,6 +2454,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "revokeEndpoint",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "tokenEndpoint",
|
||||
"description": "",
|
||||
@@ -2734,6 +2758,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "revokeEndpoint",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "tokenEndpoint",
|
||||
"description": "",
|
||||
@@ -11913,6 +11949,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "actualResourceClass",
|
||||
"description": "The actual resource class of the builder assigned to the build job",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "ENUM",
|
||||
"name": "BuildResourceClass",
|
||||
"ofType": null
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "appBuildVersion",
|
||||
"description": "",
|
||||
@@ -12391,12 +12439,16 @@
|
||||
},
|
||||
{
|
||||
"name": "resourceClass",
|
||||
"description": "",
|
||||
"description": "The builder resource class requested by the developer",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "ENUM",
|
||||
"name": "BuildResourceClass",
|
||||
"ofType": null
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "ENUM",
|
||||
"name": "BuildResourceClass",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
@@ -15406,6 +15458,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "archiveSource",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "INPUT_OBJECT",
|
||||
"name": "SubmissionArchiveSourceInput",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "archiveUrl",
|
||||
"description": "",
|
||||
@@ -15641,6 +15705,22 @@
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "nodeIdentifier",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"interfaces": null,
|
||||
@@ -15712,6 +15792,18 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "archiveSource",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "INPUT_OBJECT",
|
||||
"name": "SubmissionArchiveSourceInput",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "archiveUrl",
|
||||
"description": "",
|
||||
@@ -16080,6 +16172,60 @@
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "DeleteIosAppBuildCredentialsResult",
|
||||
"description": "",
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
"interfaces": [],
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "DeleteIosAppCredentialsResult",
|
||||
"description": "",
|
||||
"fields": [
|
||||
{
|
||||
"name": "id",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
"interfaces": [],
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "DeleteRobotResult",
|
||||
@@ -17284,7 +17430,7 @@
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": "1",
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
@@ -17296,7 +17442,7 @@
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": "50",
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
@@ -17305,17 +17451,9 @@
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "LIST",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubAppInstallationAccessibleRepository",
|
||||
"ofType": null
|
||||
}
|
||||
}
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubRepositoryPaginationResult",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
@@ -17468,6 +17606,22 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "nodeId",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "owner",
|
||||
"description": "",
|
||||
@@ -17716,6 +17870,39 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "installation",
|
||||
"description": "",
|
||||
"args": [
|
||||
{
|
||||
"name": "id",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubAppInstallation",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "searchRepositories",
|
||||
"description": "",
|
||||
@@ -17736,30 +17923,6 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "page",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": "1",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "perPage",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": "50",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "query",
|
||||
"description": "",
|
||||
@@ -17781,17 +17944,9 @@
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "LIST",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubAppInstallationAccessibleRepository",
|
||||
"ofType": null
|
||||
}
|
||||
}
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubRepositoryPaginationResult",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
@@ -17883,6 +18038,22 @@
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "nodeIdentifier",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
@@ -18161,6 +18332,57 @@
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubRepositoryPaginationResult",
|
||||
"description": "",
|
||||
"fields": [
|
||||
{
|
||||
"name": "repositories",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "LIST",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubAppInstallationAccessibleRepository",
|
||||
"ofType": null
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "totalCount",
|
||||
"description": "",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
"interfaces": [],
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "GitHubRepositorySettings",
|
||||
@@ -19474,6 +19696,39 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "deleteIosAppBuildCredentials",
|
||||
"description": "Disassociate the build credentials from an iOS app",
|
||||
"args": [
|
||||
{
|
||||
"name": "id",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "DeleteIosAppBuildCredentialsResult",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "setDistributionCertificate",
|
||||
"description": "Set the distribution certificate to be used for an iOS app",
|
||||
@@ -19887,6 +20142,39 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "deleteIosAppCredentials",
|
||||
"description": "Delete a set of credentials for an iOS app",
|
||||
"args": [
|
||||
{
|
||||
"name": "id",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "DeleteIosAppCredentialsResult",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "setAppStoreConnectApiKeyForSubmissions",
|
||||
"description": "Set the App Store Connect Api Key to be used for submitting an iOS app",
|
||||
@@ -19991,6 +20279,50 @@
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "IosAppCredentialsQuery",
|
||||
"description": "",
|
||||
"fields": [
|
||||
{
|
||||
"name": "byId",
|
||||
"description": "",
|
||||
"args": [
|
||||
{
|
||||
"name": "iosAppCredentialsId",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "ID",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "IosAppCredentials",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"inputFields": null,
|
||||
"interfaces": [],
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "ENUM",
|
||||
"name": "IosBuildType",
|
||||
@@ -24394,6 +24726,22 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "iosAppCredentials",
|
||||
"description": "Top-level query object for querying IosAppCredentials.",
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "OBJECT",
|
||||
"name": "IosAppCredentialsQuery",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "me",
|
||||
"description": "If authenticated as a typical end user, this is the appropriate top-level\nquery object",
|
||||
@@ -26444,6 +26792,86 @@
|
||||
],
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "INPUT_OBJECT",
|
||||
"name": "SubmissionArchiveSourceInput",
|
||||
"description": "",
|
||||
"fields": null,
|
||||
"inputFields": [
|
||||
{
|
||||
"name": "bucketKey",
|
||||
"description": "Required if the archive source type is GCS_BUILD_APPLICATION_ARCHIVE or GCS_SUBMIT_ARCHIVE",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "type",
|
||||
"description": "",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "ENUM",
|
||||
"name": "SubmissionArchiveSourceType",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "url",
|
||||
"description": "Required if the archive source type is URL",
|
||||
"type": {
|
||||
"kind": "SCALAR",
|
||||
"name": "String",
|
||||
"ofType": null
|
||||
},
|
||||
"defaultValue": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"interfaces": null,
|
||||
"enumValues": null,
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "ENUM",
|
||||
"name": "SubmissionArchiveSourceType",
|
||||
"description": "",
|
||||
"fields": null,
|
||||
"inputFields": null,
|
||||
"interfaces": null,
|
||||
"enumValues": [
|
||||
{
|
||||
"name": "GCS_BUILD_APPLICATION_ARCHIVE",
|
||||
"description": "",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "GCS_SUBMIT_ARCHIVE",
|
||||
"description": "",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "URL",
|
||||
"description": "",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"possibleTypes": null
|
||||
},
|
||||
{
|
||||
"kind": "OBJECT",
|
||||
"name": "SubmissionError",
|
||||
@@ -28222,6 +28650,12 @@
|
||||
"inputFields": null,
|
||||
"interfaces": null,
|
||||
"enumValues": [
|
||||
{
|
||||
"name": "EAS_BUILD_GCS_PROJECT_SOURCES",
|
||||
"description": "",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "EAS_BUILD_PROJECT_SOURCES",
|
||||
"description": "",
|
||||
@@ -28233,6 +28667,12 @@
|
||||
"description": "",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "EAS_SUBMIT_GCS_APP_ARCHIVE",
|
||||
"description": "",
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"possibleTypes": null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "eas-cli",
|
||||
"description": "EAS command line tool",
|
||||
"version": "2.5.0",
|
||||
"version": "2.6.0",
|
||||
"author": "Expo <[email protected]>",
|
||||
"bin": {
|
||||
"eas": "./bin/run"
|
||||
@@ -9,51 +9,53 @@
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"dependencies": {
|
||||
"@expo/apple-utils": "0.0.0-alpha.34",
|
||||
"@expo/code-signing-certificates": "0.0.2",
|
||||
"@expo/code-signing-certificates": "0.0.3",
|
||||
"@expo/config": "7.0.1",
|
||||
"@expo/config-plugins": "5.0.1",
|
||||
"@expo/config-types": "46.0.2",
|
||||
"@expo/eas-build-job": "0.2.94",
|
||||
"@expo/eas-json": "2.2.0",
|
||||
"@expo/eas-build-job": "0.2.96",
|
||||
"@expo/eas-json": "2.6.0",
|
||||
"@expo/json-file": "8.2.36",
|
||||
"@expo/multipart-body-parser": "1.1.0",
|
||||
"@expo/osascript": "2.0.33",
|
||||
"@expo/package-manager": "0.0.56",
|
||||
"@expo/pkcs12": "0.0.8",
|
||||
"@expo/plist": "0.0.18",
|
||||
"@expo/plugin-autocomplete": "1.4.0",
|
||||
"@expo/plugin-help": "5.3.0",
|
||||
"@expo/plugin-warn-if-update-available": "2.3.0",
|
||||
"@expo/plugin-help": "5.1.16",
|
||||
"@expo/plugin-warn-if-update-available": "2.4.0",
|
||||
"@expo/prebuild-config": "5.0.3",
|
||||
"@expo/results": "1.0.0",
|
||||
"@expo/rudder-sdk-node": "1.1.1",
|
||||
"@expo/spawn-async": "1.7.0",
|
||||
"@expo/timeago.js": "1.0.0",
|
||||
"@oclif/core": "1.13.10",
|
||||
"@urql/core": "2.6.1",
|
||||
"@urql/exchange-retry": "0.3.3",
|
||||
"ajv": "^6.12.6",
|
||||
"@oclif/core": "1.19.2",
|
||||
"@oclif/plugin-autocomplete": "1.3.4",
|
||||
"@segment/ajv-human-errors": "^2.1.2",
|
||||
"@urql/core": "3.0.5",
|
||||
"@urql/exchange-retry": "1.0.0",
|
||||
"ajv": "^8.11.0",
|
||||
"ajv-formats": "2.1.1",
|
||||
"better-opn": "3.0.2",
|
||||
"chalk": "4.1.2",
|
||||
"cli-progress": "3.11.2",
|
||||
"cli-table3": "0.6.2",
|
||||
"dateformat": "4.6.3",
|
||||
"dotenv": "16.0.3",
|
||||
"env-paths": "2.2.0",
|
||||
"envinfo": "7.8.1",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"fast-glob": "3.2.11",
|
||||
"fast-glob": "3.2.12",
|
||||
"figures": "3.2.0",
|
||||
"form-data": "4.0.0",
|
||||
"fs-extra": "10.1.0",
|
||||
"getenv": "1.0.0",
|
||||
"gradle-to-js": "2.0.1",
|
||||
"graphql": "16.5.0",
|
||||
"graphql": "16.6.0",
|
||||
"graphql-tag": "2.12.6",
|
||||
"https-proxy-agent": "5.0.1",
|
||||
"ignore": "5.2.0",
|
||||
"indent-string": "4.0.0",
|
||||
"jks-js": "1.0.2",
|
||||
"joi": "17.6.0",
|
||||
"jks-js": "1.1.0",
|
||||
"joi": "17.6.4",
|
||||
"keychain": "1.3.0",
|
||||
"log-symbols": "4.1.0",
|
||||
"mime": "3.0.0",
|
||||
@@ -69,33 +71,33 @@
|
||||
"prompts": "2.4.2",
|
||||
"qrcode-terminal": "0.12.0",
|
||||
"resolve-from": "5.0.0",
|
||||
"semver": "7.3.7",
|
||||
"semver": "7.3.8",
|
||||
"slash": "3.0.0",
|
||||
"tar": "6.1.11",
|
||||
"terminal-link": "2.1.1",
|
||||
"tslib": "2.4.0",
|
||||
"turndown": "7.1.1",
|
||||
"untildify": "4.0.0",
|
||||
"uuid": "8.3.2",
|
||||
"uuid": "9.0.0",
|
||||
"wrap-ansi": "7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@graphql-codegen/cli": "2.11.5",
|
||||
"@graphql-codegen/cli": "2.13.7",
|
||||
"@graphql-codegen/introspection": "2.2.1",
|
||||
"@graphql-codegen/typescript": "2.7.3",
|
||||
"@graphql-codegen/typescript-operations": "2.5.3",
|
||||
"@graphql-codegen/typescript": "2.8.0",
|
||||
"@graphql-codegen/typescript-operations": "2.5.5",
|
||||
"@types/cli-progress": "3.11.0",
|
||||
"@types/dateformat": "3.0.1",
|
||||
"@types/envinfo": "7.8.1",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"@types/getenv": "^1.0.0",
|
||||
"@types/mime": "2.0.3",
|
||||
"@types/mime": "3.0.1",
|
||||
"@types/node-fetch": "2.6.2",
|
||||
"@types/node-forge": "1.0.4",
|
||||
"@types/node-forge": "1.3.0",
|
||||
"@types/promise-retry": "1.1.3",
|
||||
"@types/prompts": "2.0.14",
|
||||
"@types/semver": "7.3.10",
|
||||
"@types/tar": "6.1.2",
|
||||
"@types/prompts": "2.4.1",
|
||||
"@types/semver": "7.3.12",
|
||||
"@types/tar": "6.1.3",
|
||||
"@types/tough-cookie": "4.0.2",
|
||||
"@types/uuid": "8.3.4",
|
||||
"@types/wrap-ansi": "3.0.0",
|
||||
@@ -105,10 +107,10 @@
|
||||
"mockdate": "3.0.5",
|
||||
"nock": "13.2.9",
|
||||
"rimraf": "3.0.2",
|
||||
"ts-deepmerge": "2.0.5",
|
||||
"ts-deepmerge": "4.0.0",
|
||||
"ts-mockito": "2.6.1",
|
||||
"ts-node": "10.9.1",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "4.8.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
@@ -130,7 +132,7 @@
|
||||
"bin": "eas",
|
||||
"commands": "./build/commands",
|
||||
"plugins": [
|
||||
"@expo/plugin-autocomplete",
|
||||
"@oclif/plugin-autocomplete",
|
||||
"@expo/plugin-help",
|
||||
"@expo/plugin-warn-if-update-available"
|
||||
],
|
||||
|
||||
@@ -778,7 +778,7 @@
|
||||
},
|
||||
"properties": {
|
||||
"configVersion": {
|
||||
"const": 0,
|
||||
"enum": [0],
|
||||
"description": "The EAS metadata store configuration version"
|
||||
},
|
||||
"apple": {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import chalk from 'chalk';
|
||||
import CliTable from 'cli-table3';
|
||||
|
||||
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
||||
import { UpdateBranchFragment } from '../graphql/generated';
|
||||
import { BranchQuery } from '../graphql/queries/BranchQuery';
|
||||
import Log from '../log';
|
||||
import { UPDATE_COLUMNS, formatUpdateMessage, getPlatformsForGroup } from '../update/utils';
|
||||
import { formatBranch, getBranchDescription } from '../update/utils';
|
||||
import { printJsonOnlyOutput } from '../utils/json';
|
||||
import {
|
||||
paginatedQueryWithConfirmPromptAsync,
|
||||
@@ -102,34 +101,13 @@ function renderPageOfBranches(
|
||||
if (json) {
|
||||
printJsonOnlyOutput(currentPage);
|
||||
} else {
|
||||
const table = new CliTable({
|
||||
head: ['Branch', ...UPDATE_COLUMNS],
|
||||
wordWrap: true,
|
||||
});
|
||||
|
||||
table.push(
|
||||
...currentPage.map(branch => {
|
||||
if (branch.updates.length === 0) {
|
||||
return [branch.name, 'N/A', 'N/A', 'N/A', 'N/A'];
|
||||
}
|
||||
|
||||
const latestUpdateOnBranch = branch.updates[0];
|
||||
return [
|
||||
branch.name,
|
||||
formatUpdateMessage(latestUpdateOnBranch),
|
||||
latestUpdateOnBranch.runtimeVersion,
|
||||
latestUpdateOnBranch.group,
|
||||
getPlatformsForGroup({
|
||||
group: latestUpdateOnBranch.group,
|
||||
updates: branch.updates,
|
||||
}),
|
||||
];
|
||||
})
|
||||
);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Branches:'));
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(table.toString());
|
||||
Log.log(
|
||||
currentPage
|
||||
.map(branch => formatBranch(getBranchDescription(branch)))
|
||||
.join(`\n\n${chalk.dim('———')}\n\n`)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
||||
import { BuildFilter, BuildFragment } from '../graphql/generated';
|
||||
import { BuildQuery } from '../graphql/queries/BuildQuery';
|
||||
import Log from '../log';
|
||||
import { appPlatformDisplayNames } from '../platform';
|
||||
import { promptAsync } from '../prompts';
|
||||
import { printJsonOnlyOutput } from '../utils/json';
|
||||
import { paginatedQueryWithConfirmPromptAsync } from '../utils/queries';
|
||||
import { formatGraphQLBuild } from './utils/formatBuild';
|
||||
@@ -53,6 +55,69 @@ export async function listAndRenderBuildsOnAppAsync(
|
||||
}
|
||||
}
|
||||
|
||||
export async function listAndSelectBuildsOnAppAsync(
|
||||
graphqlClient: ExpoGraphqlClient,
|
||||
{
|
||||
projectId,
|
||||
projectDisplayName,
|
||||
filter,
|
||||
queryOptions,
|
||||
}: {
|
||||
projectId: string;
|
||||
projectDisplayName: string;
|
||||
filter?: BuildFilter;
|
||||
queryOptions: PaginatedQueryOptions;
|
||||
}
|
||||
): Promise<BuildFragment> {
|
||||
const builds = await BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
|
||||
appId: projectId,
|
||||
limit: queryOptions.limit ?? BUILDS_LIMIT,
|
||||
offset: queryOptions.offset,
|
||||
filter,
|
||||
});
|
||||
|
||||
if (builds.length === 0) {
|
||||
throw new Error('Found no builds matching the provided criteria.');
|
||||
}
|
||||
|
||||
const { selectedSimulatorBuild } = await promptAsync({
|
||||
type: 'select',
|
||||
message: `Select simulator build to run for ${projectDisplayName} app`,
|
||||
name: 'selectedSimulatorBuild',
|
||||
choices: builds.map(build => ({
|
||||
title: `id: ${build.id}, platform: ${appPlatformDisplayNames[build.platform]}, version: ${
|
||||
build.appVersion
|
||||
}, build number: ${build.appBuildVersion}`,
|
||||
value: build,
|
||||
})),
|
||||
});
|
||||
return selectedSimulatorBuild;
|
||||
}
|
||||
|
||||
export async function getLatestBuildAsync(
|
||||
graphqlClient: ExpoGraphqlClient,
|
||||
{
|
||||
projectId,
|
||||
filter,
|
||||
}: {
|
||||
projectId: string;
|
||||
filter?: BuildFilter;
|
||||
}
|
||||
): Promise<BuildFragment> {
|
||||
const builds = await BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
|
||||
appId: projectId,
|
||||
limit: 1,
|
||||
offset: 0,
|
||||
filter,
|
||||
});
|
||||
|
||||
if (builds.length === 0) {
|
||||
throw new Error('Found no build matching the provided criteria.');
|
||||
}
|
||||
|
||||
return builds[0];
|
||||
}
|
||||
|
||||
function renderPageOfBuilds({
|
||||
builds,
|
||||
projectDisplayName,
|
||||
|
||||
@@ -153,14 +153,13 @@ function renderPageOfChannels(
|
||||
printJsonOnlyOutput({ currentPage });
|
||||
} else {
|
||||
for (const channel of currentPage) {
|
||||
renderChannelHeaderContent({ channelName: channel.name, channelId: channel.id });
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'Name', value: channel.name },
|
||||
{ label: 'ID', value: channel.id },
|
||||
])
|
||||
);
|
||||
logChannelDetails(channel);
|
||||
|
||||
if (currentPage.indexOf(channel) < currentPage.length - 1) {
|
||||
Log.log(`\n${chalk.dim('———')}\n`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,13 +173,8 @@ function renderPageOfBranchesOnChannel(
|
||||
if (json) {
|
||||
printJsonOnlyOutput({ currentPage: channelWithNewBranches });
|
||||
} else {
|
||||
// The channel details contain both the branch and latest update group
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'Name', value: channel.name },
|
||||
{ label: 'ID', value: channel.id },
|
||||
])
|
||||
);
|
||||
logChannelDetails(channelWithNewBranches);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
import assert from 'assert';
|
||||
import CliTable from 'cli-table3';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import { UpdateChannelObject } from '../graphql/queries/ChannelQuery';
|
||||
import Log from '../log';
|
||||
import { UPDATE_COLUMNS, getUpdateGroupDescriptionsWithBranch } from '../update/utils';
|
||||
import {
|
||||
FormattedBranchDescription,
|
||||
formatBranch,
|
||||
getUpdateGroupDescriptionsWithBranch,
|
||||
} from '../update/utils';
|
||||
|
||||
export type BranchMapping = {
|
||||
version: number;
|
||||
@@ -75,38 +79,39 @@ export function getBranchMapping(branchMappingString?: string): {
|
||||
|
||||
export function logChannelDetails(channel: UpdateChannelObject): void {
|
||||
const { branchMapping, isRollout, rolloutPercent } = getBranchMapping(channel.branchMapping);
|
||||
|
||||
const updateChannelsTable = new CliTable({
|
||||
head: ['branch', ...(isRollout ? ['rollout percent'] : []), ...UPDATE_COLUMNS],
|
||||
wordWrap: true,
|
||||
});
|
||||
|
||||
if (branchMapping.data.length > 2) {
|
||||
throw new Error('Branch Mapping data must have length less than or equal to 2.');
|
||||
}
|
||||
|
||||
const rolloutBranchIds = branchMapping.data.map(data => data.branchId);
|
||||
|
||||
for (const currentBranch of channel.updateBranches) {
|
||||
const updateGroupDescriptions = getUpdateGroupDescriptionsWithBranch(
|
||||
currentBranch.updateGroups
|
||||
const branchDescription = channel.updateBranches.flatMap(branch => {
|
||||
const updateGroupWithBranchDescriptions = getUpdateGroupDescriptionsWithBranch(
|
||||
branch.updateGroups
|
||||
);
|
||||
|
||||
const isRolloutBranch = isRollout && rolloutBranchIds.includes(currentBranch.id);
|
||||
const isBaseBranch = rolloutBranchIds.length > 0 && rolloutBranchIds[0] === currentBranch.id;
|
||||
const isRolloutBranch = isRollout && rolloutBranchIds.includes(branch.id);
|
||||
const isBaseBranch = rolloutBranchIds.length > 0 && rolloutBranchIds[0] === branch.id;
|
||||
let rolloutPercentNumber: number | undefined = undefined;
|
||||
if (isRolloutBranch) {
|
||||
rolloutPercentNumber = isBaseBranch ? rolloutPercent! * 100 : (1 - rolloutPercent!) * 100;
|
||||
}
|
||||
|
||||
updateGroupDescriptions.forEach(({ branch, message, runtimeVersion, group, platforms }) => {
|
||||
updateChannelsTable.push([
|
||||
return updateGroupWithBranchDescriptions.map(
|
||||
({ branch, ...updateGroup }): FormattedBranchDescription => ({
|
||||
branch,
|
||||
...(isRolloutBranch
|
||||
? [isBaseBranch ? `${rolloutPercent! * 100}%` : `${(1 - rolloutPercent!) * 100}%`]
|
||||
: []),
|
||||
message,
|
||||
runtimeVersion,
|
||||
group,
|
||||
platforms,
|
||||
]);
|
||||
});
|
||||
branchRolloutPercentage: rolloutPercentNumber,
|
||||
update: updateGroup,
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
if (branchDescription.length === 0) {
|
||||
Log.log(chalk.dim('No branches are pointed to this channel.'));
|
||||
} else {
|
||||
Log.log(
|
||||
branchDescription
|
||||
.map(description => formatBranch(description))
|
||||
.join(`\n\n${chalk.dim('———')}\n\n`)
|
||||
);
|
||||
}
|
||||
Log.log(updateChannelsTable.toString());
|
||||
}
|
||||
@@ -1,20 +1,30 @@
|
||||
import { Actor } from '../../user/User';
|
||||
import FeatureGateEnvOverrides from '../gating/FeatureGateEnvOverrides';
|
||||
import FeatureGating from '../gating/FeatureGating';
|
||||
import ContextField, { ContextOptions } from './ContextField';
|
||||
import { ExpoGraphqlClient, createGraphqlClient } from './contextUtils/createGraphqlClient';
|
||||
|
||||
export default class LoggedInContextField extends ContextField<{
|
||||
actor: Actor;
|
||||
featureGating: FeatureGating;
|
||||
graphqlClient: ExpoGraphqlClient;
|
||||
}> {
|
||||
async getValueAsync({ nonInteractive, sessionManager }: ContextOptions): Promise<{
|
||||
actor: Actor;
|
||||
featureGating: FeatureGating;
|
||||
graphqlClient: ExpoGraphqlClient;
|
||||
}> {
|
||||
const { actor, authenticationInfo } = await sessionManager.ensureLoggedInAsync({
|
||||
nonInteractive,
|
||||
});
|
||||
const featureGateServerValues: { [key: string]: boolean } = actor?.featureGates ?? {};
|
||||
|
||||
const graphqlClient = createGraphqlClient(authenticationInfo);
|
||||
return { actor, graphqlClient };
|
||||
|
||||
return {
|
||||
actor,
|
||||
featureGating: new FeatureGating(featureGateServerValues, new FeatureGateEnvOverrides()),
|
||||
graphqlClient,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,17 @@
|
||||
import { Actor } from '../../user/User';
|
||||
import FeatureGateEnvOverrides from '../gating/FeatureGateEnvOverrides';
|
||||
import FeatureGating from '../gating/FeatureGating';
|
||||
import ContextField, { ContextOptions } from './ContextField';
|
||||
import { ExpoGraphqlClient, createGraphqlClient } from './contextUtils/createGraphqlClient';
|
||||
|
||||
export default class MaybeLoggedInContextField extends ContextField<{
|
||||
actor: Actor | null;
|
||||
featureGating: FeatureGating;
|
||||
graphqlClient: ExpoGraphqlClient;
|
||||
}> {
|
||||
async getValueAsync({ sessionManager }: ContextOptions): Promise<{
|
||||
actor: Actor | null;
|
||||
featureGating: FeatureGating;
|
||||
graphqlClient: ExpoGraphqlClient;
|
||||
}> {
|
||||
const authenticationInfo = {
|
||||
@@ -17,7 +21,12 @@ export default class MaybeLoggedInContextField extends ContextField<{
|
||||
|
||||
const graphqlClient = createGraphqlClient(authenticationInfo);
|
||||
const actor = await sessionManager.getUserAsync();
|
||||
const featureGateServerValues: { [key: string]: boolean } = actor?.featureGates ?? {};
|
||||
|
||||
return { actor: actor ?? null, graphqlClient };
|
||||
return {
|
||||
actor: actor ?? null,
|
||||
featureGating: new FeatureGating(featureGateServerValues, new FeatureGateEnvOverrides()),
|
||||
graphqlClient,
|
||||
};
|
||||
}
|
||||
}
|
||||
+1
@@ -51,6 +51,7 @@ describe(getProjectIdAsync, () => {
|
||||
},
|
||||
],
|
||||
isExpoAdmin: false,
|
||||
featureGates: {},
|
||||
},
|
||||
authenticationInfo: { accessToken: 'fake', sessionSecret: null },
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
AnyVariables,
|
||||
Client,
|
||||
OperationContext,
|
||||
OperationResult,
|
||||
@@ -17,9 +18,9 @@ import { getExpoApiBaseUrl } from '../../../api';
|
||||
import { httpsProxyAgent } from '../../../fetch';
|
||||
|
||||
export interface ExpoGraphqlClient extends Client {
|
||||
query<Data = any, Variables extends object = object>(
|
||||
query<Data = any, Variables extends AnyVariables = AnyVariables>(
|
||||
query: DocumentNode | TypedDocumentNode<Data, Variables> | string,
|
||||
variables: Variables | undefined,
|
||||
variables: Variables,
|
||||
context: Partial<OperationContext> & { additionalTypenames: string[] }
|
||||
): PromisifiedSource<OperationResult<Data, Variables>>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import nullthrows from 'nullthrows';
|
||||
|
||||
import env from '../../env';
|
||||
import { FeatureGateKey } from './FeatureGateKey';
|
||||
|
||||
function parseFeatureGateEnvVariableValue(value: string | undefined): string[] {
|
||||
if (!value) {
|
||||
return [];
|
||||
}
|
||||
return value.split(',').map(v => v.trim());
|
||||
}
|
||||
|
||||
export default class FeatureGateEnvOverrides {
|
||||
private readonly map = new Map<string, boolean>();
|
||||
|
||||
constructor() {
|
||||
const overrideEnableGateKeys = new Set(parseFeatureGateEnvVariableValue(env.featureGateEnable));
|
||||
const overrideDisableGateKeys = new Set(
|
||||
parseFeatureGateEnvVariableValue(env.featureGateDisable)
|
||||
);
|
||||
|
||||
for (const overrideEnableKey of overrideEnableGateKeys) {
|
||||
if (overrideDisableGateKeys.has(overrideEnableKey)) {
|
||||
continue;
|
||||
}
|
||||
this.map.set(overrideEnableKey, true);
|
||||
}
|
||||
for (const overrideDisableGateKey of overrideDisableGateKeys) {
|
||||
this.map.set(overrideDisableGateKey, false);
|
||||
}
|
||||
}
|
||||
|
||||
public isOverridden(key: FeatureGateKey): boolean {
|
||||
return this.map.has(key) ?? false;
|
||||
}
|
||||
|
||||
public getOverride(key: FeatureGateKey): boolean {
|
||||
return nullthrows(this.map.get(key));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export enum FeatureGateKey {
|
||||
// for tests
|
||||
TEST = 'test',
|
||||
}
|
||||
|
||||
export const featureGateDefaultValueWhenNoServerValue: Record<FeatureGateKey, boolean> = {
|
||||
[FeatureGateKey.TEST]: true,
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import { FeatureGateKey } from './FeatureGateKey';
|
||||
|
||||
export const setOverride = (_key: FeatureGateKey, _enabled: boolean): void => {
|
||||
throw new Error('Must use mocked FeatureGateTestOverrides');
|
||||
};
|
||||
|
||||
export const removeOverride = (_key: FeatureGateKey): void => {
|
||||
throw new Error('Must use mocked FeatureGateTestOverrides');
|
||||
};
|
||||
|
||||
export const isOverridden = (_key: FeatureGateKey): boolean => false;
|
||||
|
||||
export const getOverride = (_key: FeatureGateKey): boolean => {
|
||||
throw new Error('Must use mocked FeatureGateTestOverrides');
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
import FeatureGateEnvOverrides from './FeatureGateEnvOverrides';
|
||||
import { FeatureGateKey, featureGateDefaultValueWhenNoServerValue } from './FeatureGateKey';
|
||||
import * as FeatureGateTestOverrides from './FeatureGateTestOverrides';
|
||||
|
||||
export default class FeatureGating {
|
||||
constructor(
|
||||
private readonly serverValues: { [key: string]: boolean },
|
||||
private readonly envOverrides: FeatureGateEnvOverrides
|
||||
) {}
|
||||
|
||||
public isEnabled(experimentKey: FeatureGateKey): boolean {
|
||||
if (process.env.NODE_ENV === 'test' && FeatureGateTestOverrides.isOverridden(experimentKey)) {
|
||||
return FeatureGateTestOverrides.getOverride(experimentKey);
|
||||
}
|
||||
|
||||
if (this.envOverrides.isOverridden(experimentKey)) {
|
||||
return this.envOverrides.getOverride(experimentKey);
|
||||
}
|
||||
|
||||
if (experimentKey in this.serverValues) {
|
||||
return this.serverValues[experimentKey];
|
||||
}
|
||||
|
||||
return featureGateDefaultValueWhenNoServerValue[experimentKey];
|
||||
}
|
||||
|
||||
/**
|
||||
* Test gate override methods
|
||||
*/
|
||||
|
||||
public static overrideKeyForScope(
|
||||
key: FeatureGateKey,
|
||||
enabled: boolean,
|
||||
scope: () => void
|
||||
): void {
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
throw new Error(`Cannot overrideKeyForScope outside of test environment`);
|
||||
}
|
||||
|
||||
FeatureGateTestOverrides.setOverride(key, enabled);
|
||||
try {
|
||||
scope();
|
||||
} finally {
|
||||
FeatureGateTestOverrides.removeOverride(key);
|
||||
}
|
||||
}
|
||||
|
||||
public static async overrideKeyForScopeAsync(
|
||||
key: FeatureGateKey,
|
||||
enabled: boolean,
|
||||
scope: () => Promise<void>
|
||||
): Promise<void> {
|
||||
if (process.env.NODE_ENV !== 'test') {
|
||||
throw new Error(`Cannot overrideKeyForScopeAsync outside of test environment`);
|
||||
}
|
||||
|
||||
FeatureGateTestOverrides.setOverride(key, enabled);
|
||||
try {
|
||||
await scope();
|
||||
} finally {
|
||||
FeatureGateTestOverrides.removeOverride(key);
|
||||
}
|
||||
}
|
||||
|
||||
public static overrideKeyForEachInTest(key: FeatureGateKey, enabled: boolean): void {
|
||||
beforeEach(() => FeatureGateTestOverrides.setOverride(key, enabled));
|
||||
afterEach(() => FeatureGateTestOverrides.removeOverride(key));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { FeatureGateKey } from '../FeatureGateKey';
|
||||
|
||||
const map = new Map();
|
||||
|
||||
export const setOverride = (key: FeatureGateKey, enabled: boolean): void => {
|
||||
map.set(key, enabled);
|
||||
};
|
||||
|
||||
export const removeOverride = (key: FeatureGateKey): void => {
|
||||
map.delete(key);
|
||||
};
|
||||
|
||||
export const isOverridden = (key: FeatureGateKey): boolean => map.has(key);
|
||||
|
||||
export const getOverride = (key: FeatureGateKey): boolean => {
|
||||
if (map.has(key)) {
|
||||
return map.get(key);
|
||||
}
|
||||
throw new Error(`Key ${key} not overridden`);
|
||||
};
|
||||
@@ -0,0 +1,92 @@
|
||||
import env from '../../../env';
|
||||
import FeatureGateEnvOverrides from '../FeatureGateEnvOverrides';
|
||||
import { FeatureGateKey } from '../FeatureGateKey';
|
||||
import FeatureGating from '../FeatureGating';
|
||||
|
||||
jest.mock('../FeatureGateTestOverrides');
|
||||
|
||||
describe(FeatureGating, () => {
|
||||
it('supports scoped overriding', () => {
|
||||
const featureGating = new FeatureGating({}, new FeatureGateEnvOverrides());
|
||||
FeatureGating.overrideKeyForScope(FeatureGateKey.TEST, false, () => {
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(false);
|
||||
});
|
||||
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(true);
|
||||
});
|
||||
|
||||
it('supports async scoped overriding', async () => {
|
||||
const featureGating = new FeatureGating({}, new FeatureGateEnvOverrides());
|
||||
await FeatureGating.overrideKeyForScopeAsync(FeatureGateKey.TEST, false, async () => {
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(false);
|
||||
});
|
||||
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(true);
|
||||
});
|
||||
|
||||
it('uses value from the server, falls back to defined value', () => {
|
||||
const featureGating = new FeatureGating(
|
||||
{ [FeatureGateKey.TEST]: true },
|
||||
new FeatureGateEnvOverrides()
|
||||
);
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(true);
|
||||
|
||||
const featureGating2 = new FeatureGating(
|
||||
{ [FeatureGateKey.TEST]: false },
|
||||
new FeatureGateEnvOverrides()
|
||||
);
|
||||
expect(featureGating2.isEnabled(FeatureGateKey.TEST)).toBe(false);
|
||||
|
||||
const featureGating3 = new FeatureGating({}, new FeatureGateEnvOverrides());
|
||||
expect(featureGating3.isEnabled(FeatureGateKey.TEST)).toBe(true);
|
||||
});
|
||||
|
||||
describe('environment variable overriding', () => {
|
||||
afterAll(() => {
|
||||
env.featureGateEnable = undefined;
|
||||
env.featureGateDisable = undefined;
|
||||
});
|
||||
|
||||
it('supports env overrides affirmative', () => {
|
||||
env.featureGateEnable = [FeatureGateKey.TEST].join(',');
|
||||
env.featureGateDisable = [].join(',');
|
||||
const featureGating = new FeatureGating(
|
||||
{ [FeatureGateKey.TEST]: false },
|
||||
new FeatureGateEnvOverrides()
|
||||
);
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(true);
|
||||
});
|
||||
|
||||
it('supports env overrides negative', () => {
|
||||
env.featureGateEnable = [].join(',');
|
||||
env.featureGateDisable = [FeatureGateKey.TEST].join(',');
|
||||
const featureGating = new FeatureGating(
|
||||
{ [FeatureGateKey.TEST]: true },
|
||||
new FeatureGateEnvOverrides()
|
||||
);
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('jest scoped overriding', () => {
|
||||
FeatureGating.overrideKeyForEachInTest(FeatureGateKey.TEST, false);
|
||||
|
||||
it('supports jest scoped overriding', () => {
|
||||
const featureGating = new FeatureGating(
|
||||
{ [FeatureGateKey.TEST]: true },
|
||||
new FeatureGateEnvOverrides()
|
||||
);
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('removal of jest scoped overriding', () => {
|
||||
it('jest scoped overriding is only for describe scope above', () => {
|
||||
const featureGating = new FeatureGating(
|
||||
{ [FeatureGateKey.TEST]: true },
|
||||
new FeatureGateEnvOverrides()
|
||||
);
|
||||
expect(featureGating.isEnabled(FeatureGateKey.TEST)).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Flags } from '@oclif/core';
|
||||
import { OptionFlag } from '@oclif/core/lib/interfaces';
|
||||
|
||||
import { EasNonInteractiveAndJsonFlags } from './flags';
|
||||
|
||||
@@ -37,7 +38,7 @@ export const getLimitFlagWithCustomValues = ({
|
||||
}: {
|
||||
defaultTo: number;
|
||||
limit: number;
|
||||
}): any =>
|
||||
}): OptionFlag<number | undefined> =>
|
||||
Flags.integer({
|
||||
description: `The number of items to fetch each query. Defaults to ${defaultTo} and is capped at ${limit}.`,
|
||||
// eslint-disable-next-line async-protect/async-suffix
|
||||
|
||||
@@ -9,13 +9,10 @@ import {
|
||||
getLimitFlagWithCustomValues,
|
||||
getPaginatedQueryOptions,
|
||||
} from '../../commandUtils/pagination';
|
||||
import {
|
||||
AppPlatform,
|
||||
DistributionType,
|
||||
BuildStatus as GraphQLBuildStatus,
|
||||
} from '../../graphql/generated';
|
||||
import { AppPlatform, BuildStatus as GraphQLBuildStatus } from '../../graphql/generated';
|
||||
import { RequestedPlatform } from '../../platform';
|
||||
import { getDisplayNameForProjectIdAsync } from '../../project/projectUtils';
|
||||
import { buildDistributionTypeToGraphQLDistributionType } from '../../utils/buildDistribution';
|
||||
import { enableJsonOutput } from '../../utils/json';
|
||||
|
||||
export default class BuildList extends EasCommand {
|
||||
@@ -82,7 +79,8 @@ export default class BuildList extends EasCommand {
|
||||
|
||||
const platform = toAppPlatform(requestedPlatform);
|
||||
const graphqlBuildStatus = toGraphQLBuildStatus(buildStatus);
|
||||
const graphqlBuildDistribution = toGraphQLBuildDistribution(buildDistribution);
|
||||
const graphqlBuildDistribution =
|
||||
buildDistributionTypeToGraphQLDistributionType(buildDistribution);
|
||||
const displayName = await getDisplayNameForProjectIdAsync(graphqlClient, projectId);
|
||||
|
||||
await listAndRenderBuildsOnAppAsync(graphqlClient, {
|
||||
@@ -133,17 +131,3 @@ const toGraphQLBuildStatus = (buildStatus?: BuildStatus): GraphQLBuildStatus | u
|
||||
return GraphQLBuildStatus.Canceled;
|
||||
}
|
||||
};
|
||||
|
||||
const toGraphQLBuildDistribution = (
|
||||
buildDistribution?: BuildDistributionType
|
||||
): DistributionType | undefined => {
|
||||
if (buildDistribution === BuildDistributionType.STORE) {
|
||||
return DistributionType.Store;
|
||||
} else if (buildDistribution === BuildDistributionType.INTERNAL) {
|
||||
return DistributionType.Internal;
|
||||
} else if (buildDistribution === BuildDistributionType.SIMULATOR) {
|
||||
return DistributionType.Simulator;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,213 @@
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import { existsSync } from 'fs-extra';
|
||||
import assert from 'node:assert';
|
||||
|
||||
import { getLatestBuildAsync, listAndSelectBuildsOnAppAsync } from '../../build/queries';
|
||||
import { BuildDistributionType } from '../../build/types';
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import {
|
||||
EasPaginatedQueryFlags,
|
||||
PaginatedQueryOptions,
|
||||
getPaginatedQueryOptions,
|
||||
} from '../../commandUtils/pagination';
|
||||
import { AppPlatform, BuildFragment, BuildStatus } from '../../graphql/generated';
|
||||
import { BuildQuery } from '../../graphql/queries/BuildQuery';
|
||||
import { getDisplayNameForProjectIdAsync } from '../../project/projectUtils';
|
||||
import { promptAsync } from '../../prompts';
|
||||
import { RunArchiveFlags, runAsync } from '../../run/run';
|
||||
import { buildDistributionTypeToGraphQLDistributionType } from '../../utils/buildDistribution';
|
||||
import { downloadAndExtractAppAsync, extractAppFromLocalArchiveAsync } from '../../utils/download';
|
||||
|
||||
interface RawRunFlags {
|
||||
latest?: boolean;
|
||||
id?: string;
|
||||
url?: string;
|
||||
path?: string;
|
||||
platform?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
|
||||
interface RunCommandFlags {
|
||||
selectedPlatform: AppPlatform;
|
||||
runArchiveFlags: RunArchiveFlags;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}
|
||||
|
||||
export default class Run extends EasCommand {
|
||||
static override hidden = true;
|
||||
|
||||
static override description = 'run simulator/emulator builds from eas-cli';
|
||||
|
||||
static override flags = {
|
||||
latest: Flags.boolean({
|
||||
description: 'Run the latest simulator/emulator build for specified platform',
|
||||
exclusive: ['id', 'path', 'url'],
|
||||
}),
|
||||
url: Flags.string({
|
||||
description: 'Simulator/Emulator build archive url',
|
||||
exclusive: ['latest', 'id', 'path'],
|
||||
}),
|
||||
path: Flags.string({
|
||||
description: 'Path to the simulator/emulator build archive or simulator build app',
|
||||
exclusive: ['latest', 'id', 'url'],
|
||||
}),
|
||||
id: Flags.string({
|
||||
description: 'ID of the simulator/emulator build to run',
|
||||
exclusive: ['latest, path, url'],
|
||||
}),
|
||||
platform: Flags.enum({
|
||||
char: 'p',
|
||||
options: ['android', 'ios'],
|
||||
}),
|
||||
...EasPaginatedQueryFlags,
|
||||
};
|
||||
|
||||
static override contextDefinition = {
|
||||
...this.ContextOptions.LoggedIn,
|
||||
...this.ContextOptions.ProjectConfig,
|
||||
...this.ContextOptions.ProjectDir,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { flags: rawFlags } = await this.parse(Run);
|
||||
const flags = await this.sanitizeFlagsAsync(rawFlags);
|
||||
const queryOptions = getPaginatedQueryOptions(flags);
|
||||
const {
|
||||
loggedIn: { graphqlClient },
|
||||
projectConfig: { projectId },
|
||||
} = await this.getContextAsync(Run, {
|
||||
nonInteractive: false,
|
||||
});
|
||||
|
||||
const simulatorBuildPath = await getPathToSimulatorBuildAppAsync(
|
||||
graphqlClient,
|
||||
projectId,
|
||||
flags,
|
||||
queryOptions
|
||||
);
|
||||
|
||||
await runAsync(simulatorBuildPath, flags.selectedPlatform);
|
||||
}
|
||||
|
||||
private async sanitizeFlagsAsync(flags: RawRunFlags): Promise<RunCommandFlags> {
|
||||
const { platform, limit, offset, ...runArchiveFlags } = flags;
|
||||
|
||||
const selectedPlatform = await resolvePlatformAsync(platform);
|
||||
|
||||
if (
|
||||
runArchiveFlags.path &&
|
||||
!(
|
||||
(runArchiveFlags.path.endsWith('.tar.gz') ||
|
||||
runArchiveFlags.path.endsWith('.app') ||
|
||||
runArchiveFlags.path.endsWith('.apk')) &&
|
||||
existsSync(runArchiveFlags.path)
|
||||
)
|
||||
) {
|
||||
Errors.error('The path must point to a .tar.gz archive, .apk file, or .app directory', {
|
||||
exit: 1,
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
selectedPlatform,
|
||||
runArchiveFlags,
|
||||
limit,
|
||||
offset,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function resolvePlatformAsync(platform?: string): Promise<AppPlatform> {
|
||||
if (platform && Object.values(AppPlatform).includes(platform.toUpperCase() as AppPlatform)) {
|
||||
return platform.toUpperCase() as AppPlatform;
|
||||
}
|
||||
|
||||
const { selectedPlatform } = await promptAsync({
|
||||
type: 'select',
|
||||
message: 'Select platform',
|
||||
name: 'selectedPlatform',
|
||||
choices: [
|
||||
{ title: 'Android', value: AppPlatform.Android },
|
||||
{ title: 'iOS', value: AppPlatform.Ios },
|
||||
],
|
||||
});
|
||||
return selectedPlatform;
|
||||
}
|
||||
|
||||
async function maybeGetBuildAsync(
|
||||
graphqlClient: ExpoGraphqlClient,
|
||||
flags: RunCommandFlags,
|
||||
projectId: string,
|
||||
paginatedQueryOptions: PaginatedQueryOptions
|
||||
): Promise<BuildFragment | null> {
|
||||
if (flags.runArchiveFlags.id) {
|
||||
return BuildQuery.byIdAsync(graphqlClient, flags.runArchiveFlags.id);
|
||||
} else if (
|
||||
!flags.runArchiveFlags.id &&
|
||||
!flags.runArchiveFlags.path &&
|
||||
!flags.runArchiveFlags.url &&
|
||||
!flags.runArchiveFlags.latest
|
||||
) {
|
||||
return await listAndSelectBuildsOnAppAsync(graphqlClient, {
|
||||
projectId,
|
||||
projectDisplayName: await getDisplayNameForProjectIdAsync(graphqlClient, projectId),
|
||||
filter: {
|
||||
platform: flags.selectedPlatform,
|
||||
distribution: buildDistributionTypeToGraphQLDistributionType(
|
||||
BuildDistributionType.SIMULATOR
|
||||
),
|
||||
status: BuildStatus.Finished,
|
||||
},
|
||||
queryOptions: paginatedQueryOptions,
|
||||
});
|
||||
} else if (flags.runArchiveFlags.latest) {
|
||||
return await getLatestBuildAsync(graphqlClient, {
|
||||
projectId,
|
||||
filter: {
|
||||
platform: flags.selectedPlatform,
|
||||
distribution: buildDistributionTypeToGraphQLDistributionType(
|
||||
BuildDistributionType.SIMULATOR
|
||||
),
|
||||
status: BuildStatus.Finished,
|
||||
},
|
||||
});
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
async function getPathToSimulatorBuildAppAsync(
|
||||
graphqlClient: ExpoGraphqlClient,
|
||||
projectId: string,
|
||||
flags: RunCommandFlags,
|
||||
queryOptions: PaginatedQueryOptions
|
||||
): Promise<string> {
|
||||
const maybeBuild = await maybeGetBuildAsync(graphqlClient, flags, projectId, queryOptions);
|
||||
const appExtension = flags.selectedPlatform === AppPlatform.Ios ? 'app' : 'apk';
|
||||
|
||||
if (maybeBuild) {
|
||||
if (!maybeBuild.artifacts?.applicationArchiveUrl) {
|
||||
throw new Error('Build does not have an application archive url');
|
||||
}
|
||||
|
||||
return await downloadAndExtractAppAsync(
|
||||
maybeBuild.artifacts.applicationArchiveUrl,
|
||||
appExtension
|
||||
);
|
||||
}
|
||||
|
||||
if (flags.runArchiveFlags.url) {
|
||||
return await downloadAndExtractAppAsync(flags.runArchiveFlags.url, appExtension);
|
||||
}
|
||||
|
||||
if (flags.runArchiveFlags.path?.endsWith('.tar.gz')) {
|
||||
return await extractAppFromLocalArchiveAsync(flags.runArchiveFlags.path!, appExtension);
|
||||
}
|
||||
|
||||
// this should never fail, due to the validation in sanitizeFlagsAsync
|
||||
assert(flags.runArchiveFlags.path);
|
||||
return flags.runArchiveFlags.path;
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonAccessor } from '@expo/eas-json';
|
||||
import { Flags } from '@oclif/core';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import Log from '../../log';
|
||||
import { loadConfigAsync } from '../../metadata/config/resolve';
|
||||
import { MetadataValidationError, logMetadataValidationError } from '../../metadata/errors';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { getProfilesAsync } from '../../utils/profiles';
|
||||
|
||||
export default class MetadataLint extends EasCommand {
|
||||
static override description = 'validate the local store configuration';
|
||||
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
|
||||
default: false,
|
||||
}),
|
||||
profile: Flags.string({
|
||||
description:
|
||||
'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
}),
|
||||
};
|
||||
|
||||
static override contextDefinition = {
|
||||
// The metadata lint command is created to integrate in other dev tooling, like vscode-expo.
|
||||
// These integrations might spam this command, so we avoid communicating with our services here.
|
||||
// Note that this is an exception and you should normally use `ProjectConfig` instead.
|
||||
...this.ContextOptions.ProjectDir,
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { flags } = await this.parse(MetadataLint);
|
||||
const { projectDir } = await this.getContextAsync(MetadataLint, {
|
||||
nonInteractive: true,
|
||||
});
|
||||
|
||||
if (flags.json) {
|
||||
enableJsonOutput();
|
||||
} else {
|
||||
Log.warn('EAS Metadata is in beta and subject to breaking changes.');
|
||||
}
|
||||
|
||||
const submitProfiles = await getProfilesAsync({
|
||||
type: 'submit',
|
||||
easJsonAccessor: new EasJsonAccessor(projectDir),
|
||||
platforms: [Platform.IOS],
|
||||
profileName: flags.profile,
|
||||
});
|
||||
|
||||
if (submitProfiles.length !== 1) {
|
||||
throw new Error('Metadata only supports iOS and a single submit profile.');
|
||||
}
|
||||
|
||||
const submitProfile = submitProfiles[0].profile;
|
||||
|
||||
try {
|
||||
await loadConfigAsync({ projectDir, profile: submitProfile });
|
||||
|
||||
if (flags.json) {
|
||||
return printJsonOnlyOutput([]);
|
||||
}
|
||||
|
||||
Log.log('✅ Store configuration is valid.');
|
||||
} catch (error) {
|
||||
if (!(error instanceof MetadataValidationError)) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (flags.json) {
|
||||
return printJsonOnlyOutput(error.errors);
|
||||
}
|
||||
|
||||
logMetadataValidationError(error);
|
||||
Log.addNewLineIfNone();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonAccessor } from '@expo/eas-json';
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
import path from 'path';
|
||||
@@ -6,9 +8,9 @@ import { ensureProjectConfiguredAsync } from '../../build/configure';
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { CredentialsContext } from '../../credentials/context';
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { createMetadataContextAsync } from '../../metadata/context';
|
||||
import { downloadMetadataAsync } from '../../metadata/download';
|
||||
import { handleMetadataError } from '../../metadata/errors';
|
||||
import { getProfilesAsync } from '../../utils/profiles';
|
||||
|
||||
export default class MetadataPull extends EasCommand {
|
||||
static override description = 'generate the local store configuration from the app stores';
|
||||
@@ -42,6 +44,18 @@ export default class MetadataPull extends EasCommand {
|
||||
// this command is interactive (all nonInteractive flags passed to utility functions are false)
|
||||
await ensureProjectConfiguredAsync({ projectDir, nonInteractive: false });
|
||||
|
||||
const submitProfiles = await getProfilesAsync({
|
||||
type: 'submit',
|
||||
easJsonAccessor: new EasJsonAccessor(projectDir),
|
||||
platforms: [Platform.IOS],
|
||||
profileName: flags.profile,
|
||||
});
|
||||
|
||||
if (submitProfiles.length !== 1) {
|
||||
throw new Error('Metadata only supports iOS and a single submit profile.');
|
||||
}
|
||||
|
||||
const submitProfile = submitProfiles[0].profile;
|
||||
const credentialsCtx = new CredentialsContext({
|
||||
projectInfo: { exp, projectId },
|
||||
projectDir,
|
||||
@@ -51,16 +65,14 @@ export default class MetadataPull extends EasCommand {
|
||||
nonInteractive: false,
|
||||
});
|
||||
|
||||
const metadataCtx = await createMetadataContextAsync({
|
||||
credentialsCtx,
|
||||
analytics,
|
||||
projectDir,
|
||||
exp,
|
||||
profileName: flags.profile,
|
||||
});
|
||||
|
||||
try {
|
||||
const filePath = await downloadMetadataAsync(metadataCtx);
|
||||
const filePath = await downloadMetadataAsync({
|
||||
analytics,
|
||||
exp,
|
||||
credentialsCtx,
|
||||
projectDir,
|
||||
profile: submitProfile,
|
||||
});
|
||||
const relativePath = path.relative(process.cwd(), filePath);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonAccessor } from '@expo/eas-json';
|
||||
import { Flags } from '@oclif/core';
|
||||
|
||||
import { ensureProjectConfiguredAsync } from '../../build/configure';
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { CredentialsContext } from '../../credentials/context';
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { createMetadataContextAsync } from '../../metadata/context';
|
||||
import { handleMetadataError } from '../../metadata/errors';
|
||||
import { uploadMetadataAsync } from '../../metadata/upload';
|
||||
import { getProfilesAsync } from '../../utils/profiles';
|
||||
|
||||
export default class MetadataPush extends EasCommand {
|
||||
static override description = 'sync the local store configuration to the app stores';
|
||||
@@ -40,6 +42,18 @@ export default class MetadataPush extends EasCommand {
|
||||
// this command is interactive (all nonInteractive flags passed to utility functions are false)
|
||||
await ensureProjectConfiguredAsync({ projectDir, nonInteractive: false });
|
||||
|
||||
const submitProfiles = await getProfilesAsync({
|
||||
type: 'submit',
|
||||
easJsonAccessor: new EasJsonAccessor(projectDir),
|
||||
platforms: [Platform.IOS],
|
||||
profileName: flags.profile,
|
||||
});
|
||||
|
||||
if (submitProfiles.length !== 1) {
|
||||
throw new Error('Metadata only supports iOS and a single submit profile.');
|
||||
}
|
||||
|
||||
const submitProfile = submitProfiles[0].profile;
|
||||
const credentialsCtx = new CredentialsContext({
|
||||
projectInfo: { exp, projectId },
|
||||
projectDir,
|
||||
@@ -49,16 +63,15 @@ export default class MetadataPush extends EasCommand {
|
||||
nonInteractive: false,
|
||||
});
|
||||
|
||||
const metadataCtx = await createMetadataContextAsync({
|
||||
credentialsCtx,
|
||||
analytics,
|
||||
projectDir,
|
||||
exp,
|
||||
profileName: flags.profile,
|
||||
});
|
||||
|
||||
try {
|
||||
const { appleLink } = await uploadMetadataAsync(metadataCtx);
|
||||
const { appleLink } = await uploadMetadataAsync({
|
||||
analytics,
|
||||
exp,
|
||||
credentialsCtx,
|
||||
projectDir,
|
||||
profile: submitProfile,
|
||||
});
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(`🎉 Store configuration is synced with the app stores.
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import LoggedInContextField from '../../../commandUtils/context/LoggedInContextF
|
||||
import ProjectDirContextField from '../../../commandUtils/context/ProjectDirContextField';
|
||||
import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { saveProjectIdToAppConfigAsync } from '../../../commandUtils/context/contextUtils/getProjectIdAsync';
|
||||
import FeatureGateEnvOverrides from '../../../commandUtils/gating/FeatureGateEnvOverrides';
|
||||
import FeatureGating from '../../../commandUtils/gating/FeatureGating';
|
||||
import { jester, jester2 } from '../../../credentials/__tests__/fixtures-constants';
|
||||
import { AppMutation } from '../../../graphql/mutations/AppMutation';
|
||||
import { AppQuery } from '../../../graphql/queries/AppQuery';
|
||||
@@ -79,9 +81,11 @@ function mockTestProject(options: {
|
||||
|
||||
jest.mocked(getConfig).mockReturnValue(mockManifest as any);
|
||||
jest.spyOn(ProjectDirContextField.prototype, 'getValueAsync').mockResolvedValue('/test-project');
|
||||
jest
|
||||
.spyOn(LoggedInContextField.prototype, 'getValueAsync')
|
||||
.mockResolvedValue({ actor: jester, graphqlClient });
|
||||
jest.spyOn(LoggedInContextField.prototype, 'getValueAsync').mockResolvedValue({
|
||||
actor: jester,
|
||||
featureGating: new FeatureGating({}, new FeatureGateEnvOverrides()),
|
||||
graphqlClient,
|
||||
});
|
||||
}
|
||||
|
||||
const commandOptions = { root: '/test-project' } as any;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import chalk from 'chalk';
|
||||
import Table from 'cli-table3';
|
||||
import dateFormat from 'dateformat';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { EnvironmentSecretsQuery } from '../../graphql/queries/EnvironmentSecretsQuery';
|
||||
import { EnvironmentSecretTypeToSecretType } from '../../graphql/types/EnvironmentSecret';
|
||||
import {
|
||||
EnvironmentSecretWithScope,
|
||||
EnvironmentSecretsQuery,
|
||||
} from '../../graphql/queries/EnvironmentSecretsQuery';
|
||||
import Log from '../../log';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
|
||||
export default class EnvironmentSecretList extends EasCommand {
|
||||
static override description = 'list environment secrets available for your current app';
|
||||
@@ -25,23 +27,18 @@ export default class EnvironmentSecretList extends EasCommand {
|
||||
|
||||
const secrets = await EnvironmentSecretsQuery.allAsync(graphqlClient, projectId);
|
||||
|
||||
const table = new Table({
|
||||
head: ['Name', 'Type', 'Scope', 'ID', 'Updated at'],
|
||||
wordWrap: true,
|
||||
});
|
||||
|
||||
for (const secret of secrets) {
|
||||
const { name, createdAt: updatedAt, scope, id, type } = secret;
|
||||
table.push([
|
||||
name,
|
||||
EnvironmentSecretTypeToSecretType[type],
|
||||
scope,
|
||||
id,
|
||||
dateFormat(updatedAt, 'mmm dd HH:MM:ss'),
|
||||
]);
|
||||
}
|
||||
|
||||
Log.log(chalk`{bold Secrets for this account and project:}`);
|
||||
Log.log(table.toString());
|
||||
Log.log(secrets.map(secret => formatSecret(secret)).join(`\n\n${chalk.dim('———')}\n\n`));
|
||||
}
|
||||
}
|
||||
|
||||
function formatSecret(secret: EnvironmentSecretWithScope): string {
|
||||
return formatFields([
|
||||
{ label: 'ID', value: secret.id },
|
||||
{ label: 'Name', value: secret.name },
|
||||
{ label: 'Scope', value: secret.scope },
|
||||
{ label: 'Type', value: secret.type },
|
||||
// TODO: Figure out why do we name it updated, while it's created at?
|
||||
{ label: 'Updated at', value: dateFormat(secret.createdAt, 'mmm dd HH:MM:ss') },
|
||||
]);
|
||||
}
|
||||
@@ -87,6 +87,11 @@ export default class UpdateConfigure extends EasCommand {
|
||||
Log.withTick(`Configured ${chalk.bold('Expo.plist')} for EAS Update`);
|
||||
}
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.warn(
|
||||
`All builds of your app going forward will be eligible to receive updates published with EAS Update.`
|
||||
);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(`🎉 Your app is configured to run EAS Update!`);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { AppFragment, Role } from '../../graphql/generated';
|
||||
import { Actor } from '../../user/User';
|
||||
|
||||
export const jester = {
|
||||
export const jester: Actor = {
|
||||
__typename: 'User' as const,
|
||||
id: 'jester-id',
|
||||
username: 'jester',
|
||||
@@ -22,6 +23,7 @@ export const jester = {
|
||||
},
|
||||
],
|
||||
isExpoAdmin: false,
|
||||
featureGates: {},
|
||||
};
|
||||
|
||||
export const jester2 = {
|
||||
@@ -36,6 +38,7 @@ export const jester2 = {
|
||||
},
|
||||
],
|
||||
isExpoAdmin: false,
|
||||
featureGates: {},
|
||||
};
|
||||
|
||||
export const testUsername = jester.username;
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ describe(syncCapabilitiesForEntitlementsAsync, () => {
|
||||
]);
|
||||
|
||||
expect(results.enabled).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
[
|
||||
"HealthKit",
|
||||
"Apple Pay Payment Processing",
|
||||
"iCloud",
|
||||
|
||||
@@ -43,6 +43,7 @@ describe(AccountResolver, () => {
|
||||
},
|
||||
],
|
||||
isExpoAdmin: false,
|
||||
featureGates: {},
|
||||
};
|
||||
|
||||
describe('when inside project dir', () => {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import chalk from 'chalk';
|
||||
import Table from 'cli-table3';
|
||||
|
||||
import { ExpoGraphqlClient } from '../../../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { AppleDeviceMutation } from '../../../credentials/ios/api/graphql/mutations/AppleDeviceMutation';
|
||||
@@ -8,6 +7,7 @@ import Log from '../../../log';
|
||||
import { ora } from '../../../ora';
|
||||
import { confirmAsync, promptAsync } from '../../../prompts';
|
||||
import { isValidUDID, normalizeUDID } from '../../udids';
|
||||
import { formatNewDevice } from '../../utils/formatDevice';
|
||||
|
||||
interface DeviceData {
|
||||
udid: string;
|
||||
@@ -15,11 +15,6 @@ interface DeviceData {
|
||||
deviceClass: AppleDeviceClass | null;
|
||||
}
|
||||
|
||||
const DEVICE_CLASS_DISPLAY_NAMES: Record<AppleDeviceClass, string> = {
|
||||
[AppleDeviceClass.Iphone]: 'iPhone',
|
||||
[AppleDeviceClass.Ipad]: 'iPad',
|
||||
};
|
||||
|
||||
export async function runInputMethodAsync(
|
||||
graphqlClient: ExpoGraphqlClient,
|
||||
accountId: string,
|
||||
@@ -89,7 +84,7 @@ async function collectDeviceDataAsync(
|
||||
This will ${chalk.bold('not')} register the device on the Apple Developer Portal yet.`
|
||||
);
|
||||
Log.newLine();
|
||||
printDeviceDataSummary(deviceData, appleTeam);
|
||||
Log.log(formatNewDevice({ ...deviceData, identifier: deviceData.udid }, appleTeam));
|
||||
Log.newLine();
|
||||
|
||||
const registrationConfirmed = await confirmAsync({
|
||||
@@ -156,21 +151,3 @@ async function promptForDeviceClassAsync(
|
||||
});
|
||||
return deviceClass;
|
||||
}
|
||||
|
||||
function printDeviceDataSummary(
|
||||
{ udid, name, deviceClass }: DeviceData,
|
||||
appleTeam: Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName'>
|
||||
): void {
|
||||
const deviceSummary = new Table({
|
||||
colWidths: [25, 55],
|
||||
wordWrap: true,
|
||||
});
|
||||
deviceSummary.push(
|
||||
['Apple Team ID', appleTeam.appleTeamIdentifier],
|
||||
['Apple Team Name', appleTeam.appleTeamName ?? '(unknown)'],
|
||||
['Device UDID', udid],
|
||||
['Device Name', name ?? '(empty)'],
|
||||
['Device Class', deviceClass ? DEVICE_CLASS_DISPLAY_NAMES[deviceClass] : '(unknown)']
|
||||
);
|
||||
Log.log(deviceSummary.toString());
|
||||
}
|
||||
@@ -1,29 +1,61 @@
|
||||
import { AppleDevice, AppleTeam } from '../../graphql/generated';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
import { AppleDevice, AppleDeviceClass, AppleTeam } from '../../graphql/generated';
|
||||
import formatFields, { FormatFieldsItem } from '../../utils/formatFields';
|
||||
|
||||
type Device = Pick<AppleDevice, 'id' | 'identifier' | 'name' | 'deviceClass' | 'enabled' | 'model'>;
|
||||
type NewDevice = Pick<AppleDevice, 'identifier' | 'name' | 'deviceClass'>;
|
||||
|
||||
export type AppleTeamIdAndName = Pick<AppleTeam, 'appleTeamIdentifier' | 'appleTeamName'>;
|
||||
|
||||
const DEVICE_CLASS_DISPLAY_NAMES: Record<AppleDeviceClass, string> = {
|
||||
[AppleDeviceClass.Iphone]: 'iPhone',
|
||||
[AppleDeviceClass.Ipad]: 'iPad',
|
||||
};
|
||||
|
||||
function formatDeviceClass(device: Device | NewDevice): string {
|
||||
if (!device.deviceClass || !DEVICE_CLASS_DISPLAY_NAMES[device.deviceClass]) {
|
||||
return 'Unknown';
|
||||
}
|
||||
|
||||
return [DEVICE_CLASS_DISPLAY_NAMES[device.deviceClass], 'model' in device ? device.model : '']
|
||||
.filter(value => !!value)
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
export default function formatDevice(device: Device, team?: AppleTeamIdAndName): string {
|
||||
const fields = [
|
||||
const fields: FormatFieldsItem[] = [
|
||||
{ label: 'ID', value: device.id },
|
||||
{ label: 'Name', value: device.name ?? 'Unknown' },
|
||||
{
|
||||
label: 'Class',
|
||||
value: device.deviceClass
|
||||
? `${device.deviceClass}${device.model ? ` ${device.model}` : ''}`
|
||||
: 'Unknown',
|
||||
value: formatDeviceClass(device),
|
||||
},
|
||||
{ label: 'UDID', value: device.identifier },
|
||||
];
|
||||
|
||||
if (team) {
|
||||
fields.push(
|
||||
...[
|
||||
{ label: 'Apple Team ID', value: team.appleTeamIdentifier },
|
||||
{ label: 'Apple Team Name', value: team.appleTeamName ?? 'Unknown' },
|
||||
]
|
||||
{ label: 'Apple Team ID', value: team.appleTeamIdentifier },
|
||||
{ label: 'Apple Team Name', value: team.appleTeamName ?? 'Unknown' }
|
||||
);
|
||||
}
|
||||
|
||||
return formatFields(fields);
|
||||
}
|
||||
|
||||
export function formatNewDevice(device: NewDevice, team?: AppleTeamIdAndName): string {
|
||||
const fields: FormatFieldsItem[] = [
|
||||
{ label: 'Name', value: device.name ?? '(empty)' },
|
||||
{
|
||||
label: 'Class',
|
||||
value: formatDeviceClass(device),
|
||||
},
|
||||
{ label: 'UDID', value: device.identifier },
|
||||
];
|
||||
|
||||
if (team) {
|
||||
fields.push(
|
||||
{ label: 'Apple Team ID', value: team.appleTeamIdentifier },
|
||||
{ label: 'Apple Team Name', value: team.appleTeamName ?? 'Unknown' }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,12 @@ export default {
|
||||
* ignore failures when parsing build.gradle.
|
||||
*/
|
||||
overrideAndroidApplicationId: process.env.EAS_DANGEROUS_OVERRIDE_ANDROID_APPLICATION_ID,
|
||||
/**
|
||||
* Comma separated list of feature gate keys of feature gates to evaluate override to true.
|
||||
*/
|
||||
featureGateEnable: process.env.EAS_FG_ENABLE,
|
||||
/**
|
||||
* Comma separated list of feature gate keys of feature gates to evaluate override to false.
|
||||
*/
|
||||
featureGateDisable: process.env.EAS_FG_DISABLE,
|
||||
};
|
||||
+87
-14
@@ -401,6 +401,7 @@ export type AccountSsoConfiguration = {
|
||||
issuer?: Maybe<Scalars['String']>;
|
||||
jwksEndpoint?: Maybe<Scalars['String']>;
|
||||
redirectUri: Scalars['String'];
|
||||
revokeEndpoint?: Maybe<Scalars['String']>;
|
||||
tokenEndpoint?: Maybe<Scalars['String']>;
|
||||
updatedAt: Scalars['DateTime'];
|
||||
userInfoEndpoint?: Maybe<Scalars['String']>;
|
||||
@@ -415,6 +416,7 @@ export type AccountSsoConfigurationData = {
|
||||
issuer?: InputMaybe<Scalars['String']>;
|
||||
jwksEndpoint?: InputMaybe<Scalars['String']>;
|
||||
redirectUri: Scalars['String'];
|
||||
revokeEndpoint?: InputMaybe<Scalars['String']>;
|
||||
tokenEndpoint?: InputMaybe<Scalars['String']>;
|
||||
userInfoEndpoint?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
@@ -457,6 +459,7 @@ export type AccountSsoConfigurationPublicData = {
|
||||
issuer?: Maybe<Scalars['String']>;
|
||||
jwksEndpoint?: Maybe<Scalars['String']>;
|
||||
redirectUri: Scalars['String'];
|
||||
revokeEndpoint?: Maybe<Scalars['String']>;
|
||||
tokenEndpoint?: Maybe<Scalars['String']>;
|
||||
userInfoEndpoint?: Maybe<Scalars['String']>;
|
||||
};
|
||||
@@ -1744,6 +1747,8 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
|
||||
__typename?: 'Build';
|
||||
activityTimestamp: Scalars['DateTime'];
|
||||
actor?: Maybe<Actor>;
|
||||
/** The actual resource class of the builder assigned to the build job */
|
||||
actualResourceClass?: Maybe<BuildResourceClass>;
|
||||
appBuildVersion?: Maybe<Scalars['String']>;
|
||||
appVersion?: Maybe<Scalars['String']>;
|
||||
artifacts?: Maybe<BuildArtifacts>;
|
||||
@@ -1784,7 +1789,8 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
|
||||
queuePosition?: Maybe<Scalars['Int']>;
|
||||
reactNativeVersion?: Maybe<Scalars['String']>;
|
||||
releaseChannel?: Maybe<Scalars['String']>;
|
||||
resourceClass?: Maybe<BuildResourceClass>;
|
||||
/** The builder resource class requested by the developer */
|
||||
resourceClass: BuildResourceClass;
|
||||
runFromCI?: Maybe<Scalars['Boolean']>;
|
||||
runtimeVersion?: Maybe<Scalars['String']>;
|
||||
sdkVersion?: Maybe<Scalars['String']>;
|
||||
@@ -2219,6 +2225,7 @@ export type CreateAccessTokenResponse = {
|
||||
|
||||
export type CreateAndroidSubmissionInput = {
|
||||
appId: Scalars['ID'];
|
||||
archiveSource?: InputMaybe<SubmissionArchiveSourceInput>;
|
||||
archiveUrl?: InputMaybe<Scalars['String']>;
|
||||
config: AndroidSubmissionConfigInput;
|
||||
submittedBuildId?: InputMaybe<Scalars['ID']>;
|
||||
@@ -2245,6 +2252,7 @@ export type CreateGitHubRepositoryInput = {
|
||||
appId: Scalars['ID'];
|
||||
githubAppInstallationId: Scalars['ID'];
|
||||
githubRepositoryIdentifier: Scalars['Int'];
|
||||
nodeIdentifier: Scalars['String'];
|
||||
};
|
||||
|
||||
export type CreateGitHubRepositorySettingsInput = {
|
||||
@@ -2255,6 +2263,7 @@ export type CreateGitHubRepositorySettingsInput = {
|
||||
|
||||
export type CreateIosSubmissionInput = {
|
||||
appId: Scalars['ID'];
|
||||
archiveSource?: InputMaybe<SubmissionArchiveSourceInput>;
|
||||
archiveUrl?: InputMaybe<Scalars['String']>;
|
||||
config: IosSubmissionConfigInput;
|
||||
submittedBuildId?: InputMaybe<Scalars['ID']>;
|
||||
@@ -2317,6 +2326,16 @@ export type DeleteGoogleServiceAccountKeyResult = {
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
export type DeleteIosAppBuildCredentialsResult = {
|
||||
__typename?: 'DeleteIosAppBuildCredentialsResult';
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
export type DeleteIosAppCredentialsResult = {
|
||||
__typename?: 'DeleteIosAppCredentialsResult';
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
export type DeleteRobotResult = {
|
||||
__typename?: 'DeleteRobotResult';
|
||||
id: Scalars['ID'];
|
||||
@@ -2506,7 +2525,7 @@ export type GetSignedAssetUploadSpecificationsResult = {
|
||||
|
||||
export type GitHubAppInstallation = {
|
||||
__typename?: 'GitHubAppInstallation';
|
||||
accessibleRepositories: Array<GitHubAppInstallationAccessibleRepository>;
|
||||
accessibleRepositories: GitHubRepositoryPaginationResult;
|
||||
account: Account;
|
||||
actor?: Maybe<Actor>;
|
||||
id: Scalars['ID'];
|
||||
@@ -2526,6 +2545,7 @@ export type GitHubAppInstallationAccessibleRepository = {
|
||||
description?: Maybe<Scalars['String']>;
|
||||
id: Scalars['Int'];
|
||||
name: Scalars['String'];
|
||||
nodeId: Scalars['String'];
|
||||
owner: GitHubRepositoryOwner;
|
||||
private: Scalars['Boolean'];
|
||||
url: Scalars['String'];
|
||||
@@ -2566,14 +2586,18 @@ export type GitHubAppQuery = {
|
||||
__typename?: 'GitHubAppQuery';
|
||||
appIdentifier: Scalars['String'];
|
||||
clientIdentifier: Scalars['String'];
|
||||
searchRepositories: Array<GitHubAppInstallationAccessibleRepository>;
|
||||
installation: GitHubAppInstallation;
|
||||
searchRepositories: GitHubRepositoryPaginationResult;
|
||||
};
|
||||
|
||||
|
||||
export type GitHubAppQueryInstallationArgs = {
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
|
||||
export type GitHubAppQuerySearchRepositoriesArgs = {
|
||||
githubAppInstallationId: Scalars['ID'];
|
||||
page?: InputMaybe<Scalars['Int']>;
|
||||
perPage?: InputMaybe<Scalars['Int']>;
|
||||
query: Scalars['String'];
|
||||
};
|
||||
|
||||
@@ -2584,6 +2608,7 @@ export type GitHubRepository = {
|
||||
githubRepositoryIdentifier: Scalars['Int'];
|
||||
id: Scalars['ID'];
|
||||
metadata?: Maybe<GitHubRepositoryMetadata>;
|
||||
nodeIdentifier: Scalars['String'];
|
||||
};
|
||||
|
||||
export type GitHubRepositoryMetadata = {
|
||||
@@ -2623,6 +2648,12 @@ export type GitHubRepositoryOwner = {
|
||||
url: Scalars['String'];
|
||||
};
|
||||
|
||||
export type GitHubRepositoryPaginationResult = {
|
||||
__typename?: 'GitHubRepositoryPaginationResult';
|
||||
repositories: Array<GitHubAppInstallationAccessibleRepository>;
|
||||
totalCount: Scalars['Int'];
|
||||
};
|
||||
|
||||
export type GitHubRepositorySettings = {
|
||||
__typename?: 'GitHubRepositorySettings';
|
||||
app: App;
|
||||
@@ -2788,6 +2819,8 @@ export type IosAppBuildCredentialsMutation = {
|
||||
__typename?: 'IosAppBuildCredentialsMutation';
|
||||
/** Create a set of build credentials for an iOS app */
|
||||
createIosAppBuildCredentials: IosAppBuildCredentials;
|
||||
/** Disassociate the build credentials from an iOS app */
|
||||
deleteIosAppBuildCredentials: DeleteIosAppBuildCredentialsResult;
|
||||
/** Set the distribution certificate to be used for an iOS app */
|
||||
setDistributionCertificate: IosAppBuildCredentials;
|
||||
/** Set the provisioning profile to be used for an iOS app */
|
||||
@@ -2801,6 +2834,11 @@ export type IosAppBuildCredentialsMutationCreateIosAppBuildCredentialsArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type IosAppBuildCredentialsMutationDeleteIosAppBuildCredentialsArgs = {
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
|
||||
export type IosAppBuildCredentialsMutationSetDistributionCertificateArgs = {
|
||||
distributionCertificateId: Scalars['ID'];
|
||||
id: Scalars['ID'];
|
||||
@@ -2849,6 +2887,8 @@ export type IosAppCredentialsMutation = {
|
||||
__typename?: 'IosAppCredentialsMutation';
|
||||
/** Create a set of credentials for an iOS app */
|
||||
createIosAppCredentials: IosAppCredentials;
|
||||
/** Delete a set of credentials for an iOS app */
|
||||
deleteIosAppCredentials: DeleteIosAppCredentialsResult;
|
||||
/** Set the App Store Connect Api Key to be used for submitting an iOS app */
|
||||
setAppStoreConnectApiKeyForSubmissions: IosAppCredentials;
|
||||
/** Set the push key to be used in an iOS app */
|
||||
@@ -2863,6 +2903,11 @@ export type IosAppCredentialsMutationCreateIosAppCredentialsArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type IosAppCredentialsMutationDeleteIosAppCredentialsArgs = {
|
||||
id: Scalars['ID'];
|
||||
};
|
||||
|
||||
|
||||
export type IosAppCredentialsMutationSetAppStoreConnectApiKeyForSubmissionsArgs = {
|
||||
ascApiKeyId: Scalars['ID'];
|
||||
id: Scalars['ID'];
|
||||
@@ -2874,6 +2919,16 @@ export type IosAppCredentialsMutationSetPushKeyArgs = {
|
||||
pushKeyId: Scalars['ID'];
|
||||
};
|
||||
|
||||
export type IosAppCredentialsQuery = {
|
||||
__typename?: 'IosAppCredentialsQuery';
|
||||
byId: IosAppCredentials;
|
||||
};
|
||||
|
||||
|
||||
export type IosAppCredentialsQueryByIdArgs = {
|
||||
iosAppCredentialsId: Scalars['ID'];
|
||||
};
|
||||
|
||||
/** @deprecated Use developmentClient option instead. */
|
||||
export enum IosBuildType {
|
||||
DevelopmentClient = 'DEVELOPMENT_CLIENT',
|
||||
@@ -3499,6 +3554,8 @@ export type RootQuery = {
|
||||
githubApp: GitHubAppQuery;
|
||||
/** Top-level query object for querying Stripe Invoices. */
|
||||
invoice: InvoiceQuery;
|
||||
/** Top-level query object for querying IosAppCredentials. */
|
||||
iosAppCredentials: IosAppCredentialsQuery;
|
||||
/**
|
||||
* If authenticated as a typical end user, this is the appropriate top-level
|
||||
* query object
|
||||
@@ -3829,6 +3886,20 @@ export enum SubmissionAndroidTrack {
|
||||
Production = 'PRODUCTION'
|
||||
}
|
||||
|
||||
export type SubmissionArchiveSourceInput = {
|
||||
/** Required if the archive source type is GCS_BUILD_APPLICATION_ARCHIVE or GCS_SUBMIT_ARCHIVE */
|
||||
bucketKey?: InputMaybe<Scalars['String']>;
|
||||
type: SubmissionArchiveSourceType;
|
||||
/** Required if the archive source type is URL */
|
||||
url?: InputMaybe<Scalars['String']>;
|
||||
};
|
||||
|
||||
export enum SubmissionArchiveSourceType {
|
||||
GcsBuildApplicationArchive = 'GCS_BUILD_APPLICATION_ARCHIVE',
|
||||
GcsSubmitArchive = 'GCS_SUBMIT_ARCHIVE',
|
||||
Url = 'URL'
|
||||
}
|
||||
|
||||
export type SubmissionError = {
|
||||
__typename?: 'SubmissionError';
|
||||
errorCode?: Maybe<Scalars['String']>;
|
||||
@@ -4093,8 +4164,10 @@ export type UploadSessionCreateUploadSessionArgs = {
|
||||
};
|
||||
|
||||
export enum UploadSessionType {
|
||||
EasBuildGcsProjectSources = 'EAS_BUILD_GCS_PROJECT_SOURCES',
|
||||
EasBuildProjectSources = 'EAS_BUILD_PROJECT_SOURCES',
|
||||
EasSubmitAppArchive = 'EAS_SUBMIT_APP_ARCHIVE'
|
||||
EasSubmitAppArchive = 'EAS_SUBMIT_APP_ARCHIVE',
|
||||
EasSubmitGcsAppArchive = 'EAS_SUBMIT_GCS_APP_ARCHIVE'
|
||||
}
|
||||
|
||||
export type UsageMetricTotal = {
|
||||
@@ -4931,7 +5004,7 @@ export type CreateAndroidBuildMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type CreateAndroidBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createAndroidBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } }, deprecationInfo?: { __typename?: 'EASBuildDeprecationInfo', type: EasBuildDeprecationInfoType, message: string } | null } } };
|
||||
export type CreateAndroidBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createAndroidBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } }, deprecationInfo?: { __typename?: 'EASBuildDeprecationInfo', type: EasBuildDeprecationInfoType, message: string } | null } } };
|
||||
|
||||
export type CreateIosBuildMutationVariables = Exact<{
|
||||
appId: Scalars['ID'];
|
||||
@@ -4941,7 +5014,7 @@ export type CreateIosBuildMutationVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type CreateIosBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createIosBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } }, deprecationInfo?: { __typename?: 'EASBuildDeprecationInfo', type: EasBuildDeprecationInfoType, message: string } | null } } };
|
||||
export type CreateIosBuildMutation = { __typename?: 'RootMutation', build: { __typename?: 'BuildMutation', createIosBuild: { __typename?: 'CreateBuildResult', build: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } }, deprecationInfo?: { __typename?: 'EASBuildDeprecationInfo', type: EasBuildDeprecationInfoType, message: string } | null } } };
|
||||
|
||||
export type CreateEnvironmentSecretForAccountMutationVariables = Exact<{
|
||||
input: CreateEnvironmentSecretInput;
|
||||
@@ -5096,14 +5169,14 @@ export type BuildsByIdQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type BuildsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } } } };
|
||||
export type BuildsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } } } };
|
||||
|
||||
export type BuildsWithSubmissionsByIdQueryVariables = Exact<{
|
||||
buildId: Scalars['ID'];
|
||||
}>;
|
||||
|
||||
|
||||
export type BuildsWithSubmissionsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logsUrl?: string | null, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', applicationIdentifier?: string | null, track: SubmissionAndroidTrack, releaseStatus?: SubmissionAndroidReleaseStatus | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } } } };
|
||||
export type BuildsWithSubmissionsByIdQuery = { __typename?: 'RootQuery', builds: { __typename?: 'BuildQuery', byId: { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logsUrl?: string | null, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', applicationIdentifier?: string | null, track: SubmissionAndroidTrack, releaseStatus?: SubmissionAndroidReleaseStatus | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } } } };
|
||||
|
||||
export type ViewBuildsOnAppQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
@@ -5113,7 +5186,7 @@ export type ViewBuildsOnAppQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ViewBuildsOnAppQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, builds: Array<{ __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } }> } } };
|
||||
export type ViewBuildsOnAppQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, builds: Array<{ __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } }> } } };
|
||||
|
||||
export type ViewUpdateChannelOnAppQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
@@ -5209,7 +5282,7 @@ export type ViewUpdateGroupsOnAppQuery = { __typename?: 'RootQuery', app: { __ty
|
||||
export type CurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type CurrentUserQuery = { __typename?: 'RootQuery', meActor?: { __typename: 'Robot', firstName?: string | null, id: string, isExpoAdmin: boolean, accounts: Array<{ __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> }> } | { __typename: 'User', username: string, id: string, isExpoAdmin: boolean, primaryAccount: { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> }, accounts: Array<{ __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> }> } | null };
|
||||
export type CurrentUserQuery = { __typename?: 'RootQuery', meActor?: { __typename: 'Robot', firstName?: string | null, id: string, featureGates: any, isExpoAdmin: boolean, accounts: Array<{ __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> }> } | { __typename: 'User', username: string, id: string, featureGates: any, isExpoAdmin: boolean, primaryAccount: { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> }, accounts: Array<{ __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> }> } | null };
|
||||
|
||||
export type WebhooksByAppIdQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
@@ -5230,9 +5303,9 @@ export type AccountFragment = { __typename?: 'Account', id: string, name: string
|
||||
|
||||
export type AppFragment = { __typename?: 'App', id: string, fullName: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'User', id: string } }> } };
|
||||
|
||||
export type BuildFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } };
|
||||
export type BuildFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } };
|
||||
|
||||
export type BuildWithSubmissionsFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logsUrl?: string | null, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', applicationIdentifier?: string | null, track: SubmissionAndroidTrack, releaseStatus?: SubmissionAndroidReleaseStatus | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } };
|
||||
export type BuildWithSubmissionsFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, submissions: Array<{ __typename?: 'Submission', id: string, status: SubmissionStatus, platform: AppPlatform, logsUrl?: string | null, app: { __typename?: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } }, androidConfig?: { __typename?: 'AndroidSubmissionConfig', applicationIdentifier?: string | null, track: SubmissionAndroidTrack, releaseStatus?: SubmissionAndroidReleaseStatus | null } | null, iosConfig?: { __typename?: 'IosSubmissionConfig', ascAppIdentifier: string, appleIdUsername?: string | null } | null, error?: { __typename?: 'SubmissionError', errorCode?: string | null, message?: string | null } | null }>, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } };
|
||||
|
||||
export type EnvironmentSecretFragment = { __typename?: 'EnvironmentSecret', id: string, name: string, type: EnvironmentSecretType, createdAt: any };
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ export const KeystoreGenerationUrlMutation = {
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
`,
|
||||
{}
|
||||
)
|
||||
.toPromise()
|
||||
);
|
||||
|
||||
@@ -30,12 +30,13 @@ export const UserQuery = {
|
||||
id
|
||||
...AccountFragment
|
||||
}
|
||||
featureGates
|
||||
isExpoAdmin
|
||||
}
|
||||
}
|
||||
${print(AccountFragmentNode)}
|
||||
`,
|
||||
/* variables */ undefined,
|
||||
{},
|
||||
{
|
||||
additionalTypenames: ['User'],
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ export const BuildFragmentNode = gql`
|
||||
artifacts {
|
||||
buildUrl
|
||||
xcodeBuildLogsUrl
|
||||
applicationArchiveUrl
|
||||
}
|
||||
initiatingActor {
|
||||
__typename
|
||||
|
||||
@@ -1,128 +1,149 @@
|
||||
import { SubmitProfile } from '@expo/eas-json';
|
||||
import path from 'path';
|
||||
|
||||
import { getStaticConfigFilePath, loadConfigAsync } from '../config';
|
||||
import { getStaticConfigFilePath, loadConfigAsync } from '../config/resolve';
|
||||
import { MetadataValidationError } from '../errors';
|
||||
|
||||
describe(getStaticConfigFilePath, () => {
|
||||
const projectDir = '/app';
|
||||
|
||||
it(`returns same file for store.config.json`, () => {
|
||||
const metadataPath = 'store.config.json';
|
||||
const expectedFile = path.join(projectDir, metadataPath);
|
||||
function mockProfile(metadataPath: string): SubmitProfile {
|
||||
return { metadataPath } as any;
|
||||
}
|
||||
|
||||
expect(getStaticConfigFilePath({ projectDir, metadataPath })).toBe(expectedFile);
|
||||
it(`returns same file for store.config.json`, () => {
|
||||
expect(getStaticConfigFilePath({ projectDir, profile: mockProfile('store.config.json') })).toBe(
|
||||
path.join(projectDir, 'store.config.json')
|
||||
);
|
||||
});
|
||||
|
||||
it(`returns store.config.json for store.config.js`, () => {
|
||||
const metadataPath = 'store.config.js';
|
||||
const expectedFile = path.join(projectDir, 'store.config.json');
|
||||
|
||||
expect(getStaticConfigFilePath({ projectDir, metadataPath })).toBe(expectedFile);
|
||||
expect(getStaticConfigFilePath({ projectDir, profile: mockProfile('store.config.js') })).toBe(
|
||||
path.join(projectDir, 'store.config.json')
|
||||
);
|
||||
});
|
||||
|
||||
it(`returns store.staging.json file for store.staging.js`, () => {
|
||||
const metadataPath = 'store.staging.js';
|
||||
const expectedFile = path.join(projectDir, 'store.staging.json');
|
||||
|
||||
expect(getStaticConfigFilePath({ projectDir, metadataPath })).toBe(expectedFile);
|
||||
expect(getStaticConfigFilePath({ projectDir, profile: mockProfile('store.staging.js') })).toBe(
|
||||
path.join(projectDir, 'store.staging.json')
|
||||
);
|
||||
});
|
||||
|
||||
// This shouldn't be used IRL, but it tests if this function is working properly
|
||||
it(`returns custom-name.json file for custom-name.js`, () => {
|
||||
const metadataPath = 'custom-name.js';
|
||||
const expectedFile = path.join(projectDir, 'custom-name.json');
|
||||
|
||||
expect(getStaticConfigFilePath({ projectDir, metadataPath })).toBe(expectedFile);
|
||||
expect(getStaticConfigFilePath({ projectDir, profile: mockProfile('custom-name.js') })).toBe(
|
||||
path.join(projectDir, 'custom-name.json')
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe(loadConfigAsync, () => {
|
||||
const projectDir = path.resolve(__dirname, 'fixtures');
|
||||
|
||||
function mockProfile(metadataPath: string): SubmitProfile {
|
||||
return { metadataPath } as any;
|
||||
}
|
||||
|
||||
it(`throws when file doesn't exist`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'doesnt-exist.json' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('doesnt-exist.json') })
|
||||
).rejects.toThrow('file not found');
|
||||
});
|
||||
|
||||
it(`throws when validation errors are found without skipping validation`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid.config.json' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('invalid.config.json') })
|
||||
).rejects.toThrow('errors found');
|
||||
});
|
||||
|
||||
it(`returns config from "store.config.json"`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'store.config.json' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('store.config.json') })
|
||||
).resolves.toHaveProperty('apple.copyright', 'ACME');
|
||||
});
|
||||
|
||||
it(`returns config from "store.config.js"`, async () => {
|
||||
const year = new Date().getFullYear();
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'store.config.js' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('store.config.js') })
|
||||
).resolves.toHaveProperty('apple.copyright', `${year} ACME`);
|
||||
});
|
||||
|
||||
it(`returns config from "store.function.js"`, async () => {
|
||||
const year = new Date().getFullYear();
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'store.function.js' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('store.function.js') })
|
||||
).resolves.toHaveProperty('apple.copyright', `${year} ACME`);
|
||||
});
|
||||
|
||||
it(`returns config from "store.async.js"`, async () => {
|
||||
const year = new Date().getFullYear();
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'store.async.js' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('store.async.js') })
|
||||
).resolves.toHaveProperty('apple.copyright', `${year} ACME`);
|
||||
});
|
||||
|
||||
it(`returns invalid config from "invalid.config.json`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid.config.json', skipValidation: true })
|
||||
loadConfigAsync({
|
||||
projectDir,
|
||||
profile: mockProfile('invalid.config.json'),
|
||||
skipValidation: true,
|
||||
})
|
||||
).resolves.toMatchObject({ configVersion: -1 });
|
||||
});
|
||||
|
||||
it(`returns invalid config from "invalid.config.js`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid.config.js', skipValidation: true })
|
||||
loadConfigAsync({
|
||||
projectDir,
|
||||
profile: mockProfile('invalid.config.js'),
|
||||
skipValidation: true,
|
||||
})
|
||||
).resolves.toMatchObject({ configVersion: -1 });
|
||||
});
|
||||
|
||||
it(`returns invalid config from "invalid.function.js`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid.function.js', skipValidation: true })
|
||||
loadConfigAsync({
|
||||
projectDir,
|
||||
profile: mockProfile('invalid.function.js'),
|
||||
skipValidation: true,
|
||||
})
|
||||
).resolves.toMatchObject({ configVersion: -1 });
|
||||
});
|
||||
|
||||
it(`returns invalid config from "invalid.async.js`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid.async.js', skipValidation: true })
|
||||
loadConfigAsync({
|
||||
projectDir,
|
||||
profile: mockProfile('invalid.async.js'),
|
||||
skipValidation: true,
|
||||
})
|
||||
).resolves.toMatchObject({ configVersion: -1 });
|
||||
});
|
||||
|
||||
it(`throws invalid config type from "invalid-type.config.json"`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid-type.config.json' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('invalid-type.config.json') })
|
||||
).rejects.toThrow(MetadataValidationError);
|
||||
});
|
||||
|
||||
it(`throws invalid config type from "invalid-type.config.js"`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid-type.config.js' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('invalid-type.config.js') })
|
||||
).rejects.toThrow(MetadataValidationError);
|
||||
});
|
||||
|
||||
it(`throws invalid config type from "invalid-type.function.js"`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid-type.function.js' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('invalid-type.function.js') })
|
||||
).rejects.toThrow(MetadataValidationError);
|
||||
});
|
||||
|
||||
it(`throws invalid config type from "invalid-type.async.js"`, async () => {
|
||||
await expect(
|
||||
loadConfigAsync({ projectDir, metadataPath: 'invalid-type.async.js' })
|
||||
loadConfigAsync({ projectDir, profile: mockProfile('invalid-type.async.js') })
|
||||
).rejects.toThrow(MetadataValidationError);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
import { infoKeywordLength } from './infoKeywordLength';
|
||||
import { infoRestrictedWords } from './infoRestrictedWords';
|
||||
|
||||
export const appleRules = [infoKeywordLength, infoRestrictedWords];
|
||||
@@ -0,0 +1,36 @@
|
||||
import { truthy } from '../../../utils/expodash/filter';
|
||||
import { IssueRule } from '../../config/issue';
|
||||
|
||||
const KEYWORD_CHARACTER_LIMIT = 100;
|
||||
|
||||
/**
|
||||
* Keywords are limited to 100 characters when converted to a comma separated string.
|
||||
* @see https://developer.apple.com/app-store/search/
|
||||
*/
|
||||
export const infoKeywordLength: IssueRule = {
|
||||
id: 'apple.info.keyword.length',
|
||||
severity: 2,
|
||||
validate(config) {
|
||||
if (!config.apple?.info || Object.keys(config.apple.info).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.keys(config.apple.info)
|
||||
.map(locale => {
|
||||
const keywords = config.apple?.info?.[locale].keywords ?? [];
|
||||
const length = keywords.join(',').length;
|
||||
|
||||
if (length > KEYWORD_CHARACTER_LIMIT) {
|
||||
return {
|
||||
id: this.id,
|
||||
severity: this.severity,
|
||||
path: ['apple', 'info', locale, 'keywords'],
|
||||
message: `Keywords are limited to ${KEYWORD_CHARACTER_LIMIT} characters, but found ${length}.`,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
})
|
||||
.filter(truthy);
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
import { truthy } from '../../../utils/expodash/filter';
|
||||
import { IssueRule } from '../../config/issue';
|
||||
import { AppleInfo } from '../types';
|
||||
|
||||
const RESTRICTED_PROPERTIES: (keyof AppleInfo)[] = ['title', 'subtitle', 'description', 'keywords'];
|
||||
const RESTRICTED_WORDS = {
|
||||
beta: 'Apple restricts the word "beta" and synonyms implying incomplete functionality.',
|
||||
};
|
||||
|
||||
/**
|
||||
* Apple restricts certain words from being used in name, description, or keywords.
|
||||
* Using these words likely result in a rejection.
|
||||
*/
|
||||
export const infoRestrictedWords: IssueRule = {
|
||||
id: 'apple.info.restrictedWords',
|
||||
severity: 1,
|
||||
validate(config) {
|
||||
if (!config.apple?.info || Object.keys(config.apple.info).length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Object.keys(config.apple.info)
|
||||
.map(locale =>
|
||||
RESTRICTED_PROPERTIES.map(property => {
|
||||
const value = getStringValue(config.apple?.info?.[locale][property]);
|
||||
const issueDescription = getDescriptionForFirstMatch(value);
|
||||
|
||||
if (issueDescription) {
|
||||
return {
|
||||
id: this.id,
|
||||
severity: this.severity,
|
||||
path: ['apple', 'info', locale, property],
|
||||
message: issueDescription,
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}).filter(truthy)
|
||||
)
|
||||
.filter(truthy)
|
||||
.flat();
|
||||
},
|
||||
};
|
||||
|
||||
function getDescriptionForFirstMatch(value: string): string | null {
|
||||
const sanitized = value.toLowerCase();
|
||||
|
||||
for (const [word, description] of Object.entries(RESTRICTED_WORDS)) {
|
||||
if (sanitized.includes(word)) {
|
||||
return description;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function getStringValue(value?: null | string | string[]): string {
|
||||
if (!value) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
return value.join(' ');
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import { MetadataContext } from '../../context';
|
||||
import { AppleTask } from '../task';
|
||||
import { AgeRatingTask } from './age-rating';
|
||||
import { AppInfoTask } from './app-info';
|
||||
@@ -12,10 +11,7 @@ type AppleTaskOptions = {
|
||||
/**
|
||||
* List of all eligible tasks to sync local store configuration to the App store.
|
||||
*/
|
||||
export function createAppleTasks(
|
||||
_ctx: MetadataContext,
|
||||
{ version }: AppleTaskOptions = {}
|
||||
): AppleTask[] {
|
||||
export function createAppleTasks({ version }: AppleTaskOptions = {}): AppleTask[] {
|
||||
return [
|
||||
new AppVersionTask({ version }),
|
||||
new AppInfoTask(),
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
import { App, Session } from '@expo/apple-utils';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
import { SubmitProfile } from '@expo/eas-json';
|
||||
import assert from 'assert';
|
||||
|
||||
import { CredentialsContext } from '../credentials/context';
|
||||
import { getRequestContext } from '../credentials/ios/appstore/authenticate';
|
||||
import { getBundleIdentifierAsync } from '../project/ios/bundleIdentifier';
|
||||
|
||||
export type MetadataAppStoreAuthentication = {
|
||||
/** The root entity of the App store */
|
||||
app: App;
|
||||
/** The authentication state we used to fetch the root entity */
|
||||
auth: Partial<Session.AuthState>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Resolve the bundle identifier from the selected submit profile.
|
||||
* This bundle identifier is used as target for the metadata submission.
|
||||
*/
|
||||
async function resolveAppStoreBundleIdentifierAsync(
|
||||
projectDir: string,
|
||||
profile: SubmitProfile,
|
||||
exp: ExpoConfig
|
||||
): Promise<string> {
|
||||
if ('bundleIdentifier' in profile) {
|
||||
return profile.bundleIdentifier ?? (await getBundleIdentifierAsync(projectDir, exp));
|
||||
}
|
||||
|
||||
return await getBundleIdentifierAsync(projectDir, exp);
|
||||
}
|
||||
|
||||
/**
|
||||
* To start syncing ASC entities, we need access to the apple utils App instance.
|
||||
* This resolves both the authentication and that App instance.
|
||||
*/
|
||||
export async function getAppStoreAuthAsync({
|
||||
projectDir,
|
||||
profile,
|
||||
exp,
|
||||
credentialsCtx,
|
||||
}: {
|
||||
projectDir: string;
|
||||
profile: SubmitProfile;
|
||||
exp: ExpoConfig;
|
||||
credentialsCtx: CredentialsContext;
|
||||
}): Promise<MetadataAppStoreAuthentication> {
|
||||
const bundleId = await resolveAppStoreBundleIdentifierAsync(projectDir, profile, exp);
|
||||
|
||||
const authCtx = await credentialsCtx.appStore.ensureAuthenticatedAsync();
|
||||
assert(authCtx.authState, 'Failed to authenticate with App Store Connect');
|
||||
|
||||
// TODO: improve error handling by mentioning possible configuration errors
|
||||
const app = await App.findAsync(getRequestContext(authCtx), { bundleId });
|
||||
assert(app, `Failed to load app "${bundleId}" from App Store Connect`);
|
||||
|
||||
return { app, auth: authCtx.authState };
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { MetadataConfig } from './schema';
|
||||
|
||||
export enum IssueSeverity {
|
||||
info = 0,
|
||||
warn = 1,
|
||||
error = 2,
|
||||
}
|
||||
|
||||
export interface Issue {
|
||||
/** The type of issue, auto-generated for AJV errors based on the validation type */
|
||||
id: string;
|
||||
/** The severity of the lint message */
|
||||
severity: IssueSeverity;
|
||||
/** The data path, using segments, to the source of this message */
|
||||
path: string[];
|
||||
/** A human readable description of the issue, presented to users */
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface IssueRule<Data = MetadataConfig> {
|
||||
id: string;
|
||||
severity: IssueSeverity;
|
||||
validate(config: Data): null | Issue | Issue[];
|
||||
}
|
||||
+28
-39
@@ -1,19 +1,13 @@
|
||||
import Ajv from 'ajv';
|
||||
import { SubmitProfile } from '@expo/eas-json';
|
||||
import assert from 'assert';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
|
||||
import { AppleConfigReader } from './apple/config/reader';
|
||||
import { AppleConfigWriter } from './apple/config/writer';
|
||||
import { AppleMetadata } from './apple/types';
|
||||
import { MetadataValidationError } from './errors';
|
||||
|
||||
export interface MetadataConfig {
|
||||
/** The store configuration version */
|
||||
configVersion: number;
|
||||
/** All App Store related configuration */
|
||||
apple?: AppleMetadata;
|
||||
}
|
||||
import { AppleConfigReader } from '../apple/config/reader';
|
||||
import { AppleConfigWriter } from '../apple/config/writer';
|
||||
import { MetadataValidationError } from '../errors';
|
||||
import { MetadataConfig } from './schema';
|
||||
import { validateConfig } from './validate';
|
||||
|
||||
/**
|
||||
* Resolve the dynamic config from the user.
|
||||
@@ -27,18 +21,30 @@ async function resolveDynamicConfigAsync(configFile: string): Promise<unknown> {
|
||||
: userConfigOrFunction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the prefered store config file name from the submit profile.
|
||||
* This is relative to the project directory, and uses `store.config.json` by default.
|
||||
*/
|
||||
function resolveConfigFilePath(profile: SubmitProfile): string {
|
||||
if ('metadataPath' in profile) {
|
||||
return profile.metadataPath ?? 'store.config.json';
|
||||
}
|
||||
|
||||
return 'store.config.json';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the static configuration file path, based on the metadata context.
|
||||
* This uses any custom name provided, but swaps out the extension for `.json`.
|
||||
*/
|
||||
export function getStaticConfigFilePath({
|
||||
projectDir,
|
||||
metadataPath,
|
||||
profile,
|
||||
}: {
|
||||
projectDir: string;
|
||||
metadataPath: string;
|
||||
profile: SubmitProfile;
|
||||
}): string {
|
||||
const configFile = path.join(projectDir, metadataPath);
|
||||
const configFile = path.join(projectDir, resolveConfigFilePath(profile));
|
||||
const configExtension = path.extname(configFile);
|
||||
|
||||
return path.join(projectDir, `${path.basename(configFile, configExtension)}.json`);
|
||||
@@ -52,14 +58,14 @@ export function getStaticConfigFilePath({
|
||||
*/
|
||||
export async function loadConfigAsync({
|
||||
projectDir,
|
||||
metadataPath,
|
||||
profile,
|
||||
skipValidation = false,
|
||||
}: {
|
||||
projectDir: string;
|
||||
metadataPath: string;
|
||||
profile: SubmitProfile;
|
||||
skipValidation?: boolean;
|
||||
}): Promise<MetadataConfig> {
|
||||
const configFile = path.join(projectDir, metadataPath);
|
||||
const configFile = path.join(projectDir, resolveConfigFilePath(profile));
|
||||
if (!(await fs.pathExists(configFile))) {
|
||||
throw new MetadataValidationError(`Metadata store config file not found: "${configFile}"`);
|
||||
}
|
||||
@@ -67,37 +73,20 @@ export async function loadConfigAsync({
|
||||
const configData = await resolveDynamicConfigAsync(configFile);
|
||||
|
||||
if (!skipValidation) {
|
||||
const { valid, errors: validationErrors } = validateConfig(configData);
|
||||
const issues = validateConfig(configData);
|
||||
|
||||
if (!valid) {
|
||||
throw new MetadataValidationError(`Metadata store config errors found`, validationErrors);
|
||||
if (issues.length > 0) {
|
||||
throw new MetadataValidationError(`Metadata store config errors found`, issues);
|
||||
}
|
||||
}
|
||||
|
||||
return configData as MetadataConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run the JSON Schema validation to normalize defaults and flag early config errors.
|
||||
* This includes validating the known store limitations for every configurable property.
|
||||
*/
|
||||
export function validateConfig(config: unknown): {
|
||||
valid: boolean;
|
||||
errors: Ajv.ErrorObject[];
|
||||
} {
|
||||
const validator = new Ajv({ allErrors: true, useDefaults: true })
|
||||
.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'))
|
||||
.compile(require('../../schema/metadata-0.json'));
|
||||
|
||||
const valid = validator(config) as boolean;
|
||||
|
||||
return { valid, errors: validator.errors || [] };
|
||||
}
|
||||
|
||||
/** Create a versioned deserializer to fetch App Store data from the store configuration. */
|
||||
export function createAppleReader(config: MetadataConfig): AppleConfigReader {
|
||||
assert(config.configVersion === 0, 'Unsupported store configuration version');
|
||||
assert(config.apple, 'No apple configuration found');
|
||||
assert(config.apple !== undefined, 'No apple configuration found');
|
||||
return new AppleConfigReader(config.apple);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { AppleMetadata } from '../apple/types';
|
||||
|
||||
export interface MetadataConfig {
|
||||
/** The store configuration version */
|
||||
configVersion: number;
|
||||
/** All App Store related configuration */
|
||||
apple?: AppleMetadata;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
import { appleRules } from '../apple/rules';
|
||||
import { createValidator, getReadableErrors } from '../utils/ajv';
|
||||
import { Issue, IssueRule, IssueSeverity } from './issue';
|
||||
import { MetadataConfig } from './schema';
|
||||
|
||||
const metadataSchema = require('../../../schema/metadata-0.json');
|
||||
|
||||
/** Validate the user-provided validation for issues */
|
||||
export function validateConfig(config: unknown): Issue[] {
|
||||
const validator = createValidator().compile(metadataSchema);
|
||||
|
||||
validator(config);
|
||||
|
||||
const issues: Issue[] = getReadableErrors(validator.errors ?? []).map(error => {
|
||||
const path = error.path === '$' ? [] : error.path.substring(2).split('.');
|
||||
const id = error.original?.keyword ?? 'unknown';
|
||||
|
||||
return {
|
||||
id: `json-schema.${id}`,
|
||||
path,
|
||||
severity: IssueSeverity.error,
|
||||
message: error.message,
|
||||
};
|
||||
});
|
||||
|
||||
try {
|
||||
issues.push(...validateRules(appleRules, config as MetadataConfig));
|
||||
} catch {
|
||||
// When the rules are failing, the json schema validation errors explain the issue
|
||||
// TODO(cedric): optionally add debugging logging for these types of errors
|
||||
}
|
||||
|
||||
return issues;
|
||||
}
|
||||
|
||||
/** Validate the set of rules against the parsed metadata config */
|
||||
function validateRules(rules: IssueRule[], config: MetadataConfig): Issue[] {
|
||||
const issues: Issue[] = [];
|
||||
|
||||
for (const rule of rules) {
|
||||
const result = rule.validate(config);
|
||||
|
||||
if (Array.isArray(result)) {
|
||||
issues.push(...result);
|
||||
} else if (result) {
|
||||
issues.push(result);
|
||||
}
|
||||
}
|
||||
|
||||
return issues;
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
import { App, Session } from '@expo/apple-utils';
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonAccessor, EasJsonUtils, SubmitProfile } from '@expo/eas-json';
|
||||
import assert from 'assert';
|
||||
|
||||
import { Analytics } from '../analytics/AnalyticsManager';
|
||||
import { CredentialsContext } from '../credentials/context';
|
||||
import { getRequestContext } from '../credentials/ios/appstore/authenticate';
|
||||
import { getBundleIdentifierAsync } from '../project/ios/bundleIdentifier';
|
||||
import { Actor } from '../user/User';
|
||||
|
||||
export type MetadataContext = {
|
||||
/** Submission profile platform to use */
|
||||
platform: Platform.IOS;
|
||||
/** Resolved submission profile configuration */
|
||||
profile: SubmitProfile<Platform.IOS>;
|
||||
/** Configured store config path, relative from projectDir (defaults to store.config.json) */
|
||||
metadataPath: string;
|
||||
/** Authenticated Expo account */
|
||||
user: Actor;
|
||||
/** The store credentials manager */
|
||||
credentialsCtx: CredentialsContext;
|
||||
/** The analytics manager for EAS cli */
|
||||
analytics: Analytics;
|
||||
/** The app bundle identifier to use for the store */
|
||||
bundleIdentifier: string;
|
||||
/** Root of the Expo project directory */
|
||||
projectDir: string;
|
||||
/** Resolved Expo app configuration */
|
||||
exp: ExpoConfig;
|
||||
};
|
||||
|
||||
export type MetadataAppStoreAuthentication = {
|
||||
/** The root entity of the App store */
|
||||
app: App;
|
||||
/** The authentication state we used to fetch the root entity */
|
||||
auth: Partial<Session.AuthState>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Metadata uses the submission profile to find the configured metadata filename.
|
||||
* Note, only iOS is supported for metadata right now.
|
||||
*/
|
||||
export async function createMetadataContextAsync(params: {
|
||||
projectDir: string;
|
||||
credentialsCtx: CredentialsContext;
|
||||
analytics: Analytics;
|
||||
exp: ExpoConfig;
|
||||
profileName?: string;
|
||||
}): Promise<MetadataContext> {
|
||||
const easJsonAccessor = new EasJsonAccessor(params.projectDir);
|
||||
const submitProfile = await EasJsonUtils.getSubmitProfileAsync(
|
||||
easJsonAccessor,
|
||||
Platform.IOS,
|
||||
params.profileName
|
||||
);
|
||||
|
||||
const exp = params.exp;
|
||||
const user = params.credentialsCtx.user;
|
||||
const bundleIdentifier =
|
||||
submitProfile.bundleIdentifier ?? (await getBundleIdentifierAsync(params.projectDir, exp));
|
||||
|
||||
return {
|
||||
platform: Platform.IOS,
|
||||
profile: submitProfile,
|
||||
metadataPath: submitProfile.metadataPath ?? 'store.config.json',
|
||||
user,
|
||||
analytics: params.analytics,
|
||||
credentialsCtx: params.credentialsCtx,
|
||||
bundleIdentifier,
|
||||
projectDir: params.projectDir,
|
||||
exp,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* To start syncing ASC entities, we need access to the apple utils App instance.
|
||||
* This ensures we are authenticated and have the app instance ready to use.
|
||||
*/
|
||||
export async function ensureMetadataAppStoreAuthenticatedAsync({
|
||||
credentialsCtx,
|
||||
bundleIdentifier,
|
||||
}: MetadataContext): Promise<MetadataAppStoreAuthentication> {
|
||||
const authCtx = await credentialsCtx.appStore.ensureAuthenticatedAsync();
|
||||
assert(authCtx.authState, 'Failed to authenticate with App Store Connect');
|
||||
|
||||
// TODO: improve error handling by mentioning possible configuration errors
|
||||
const app = await App.findAsync(getRequestContext(authCtx), { bundleId: bundleIdentifier });
|
||||
assert(app, `Failed to load app "${bundleIdentifier}" from App Store Connect`);
|
||||
|
||||
return { app, auth: authCtx.authState };
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
import { ExpoConfig } from '@expo/config-types';
|
||||
import { SubmitProfile } from '@expo/eas-json';
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
|
||||
import { MetadataEvent } from '../analytics/AnalyticsManager';
|
||||
import { Analytics, MetadataEvent } from '../analytics/AnalyticsManager';
|
||||
import { CredentialsContext } from '../credentials/context';
|
||||
import Log from '../log';
|
||||
import { confirmAsync } from '../prompts';
|
||||
import { AppleData } from './apple/data';
|
||||
import { createAppleTasks } from './apple/tasks';
|
||||
import { createAppleWriter, getStaticConfigFilePath } from './config';
|
||||
import { MetadataContext, ensureMetadataAppStoreAuthenticatedAsync } from './context';
|
||||
import { getAppStoreAuthAsync } from './auth';
|
||||
import { createAppleWriter, getStaticConfigFilePath } from './config/resolve';
|
||||
import { MetadataDownloadError, MetadataValidationError } from './errors';
|
||||
import { subscribeTelemetry } from './utils/telemetry';
|
||||
|
||||
@@ -15,12 +18,24 @@ import { subscribeTelemetry } from './utils/telemetry';
|
||||
* Generate a local store configuration from the stores.
|
||||
* Note, only App Store is supported at this time.
|
||||
*/
|
||||
export async function downloadMetadataAsync(metadataCtx: MetadataContext): Promise<string> {
|
||||
const filePath = getStaticConfigFilePath(metadataCtx);
|
||||
const fileExists = await fs.pathExists(filePath);
|
||||
export async function downloadMetadataAsync({
|
||||
projectDir,
|
||||
profile,
|
||||
exp,
|
||||
analytics,
|
||||
credentialsCtx,
|
||||
}: {
|
||||
projectDir: string;
|
||||
profile: SubmitProfile;
|
||||
exp: ExpoConfig;
|
||||
analytics: Analytics;
|
||||
credentialsCtx: CredentialsContext;
|
||||
}): Promise<string> {
|
||||
const filePath = getStaticConfigFilePath({ projectDir, profile });
|
||||
|
||||
const fileExists = await fs.pathExists(filePath);
|
||||
if (fileExists) {
|
||||
const filePathRelative = path.relative(metadataCtx.projectDir, filePath);
|
||||
const filePathRelative = path.relative(projectDir, filePath);
|
||||
const overwrite = await confirmAsync({
|
||||
message: `Do you want to overwrite the existing "${filePathRelative}"?`,
|
||||
});
|
||||
@@ -29,9 +44,15 @@ export async function downloadMetadataAsync(metadataCtx: MetadataContext): Promi
|
||||
}
|
||||
}
|
||||
|
||||
const { app, auth } = await ensureMetadataAppStoreAuthenticatedAsync(metadataCtx);
|
||||
const { app, auth } = await getAppStoreAuthAsync({
|
||||
exp,
|
||||
credentialsCtx,
|
||||
projectDir,
|
||||
profile,
|
||||
});
|
||||
|
||||
const { unsubscribeTelemetry, executionId } = subscribeTelemetry(
|
||||
metadataCtx.analytics,
|
||||
analytics,
|
||||
MetadataEvent.APPLE_METADATA_DOWNLOAD,
|
||||
{ app, auth }
|
||||
);
|
||||
@@ -41,7 +62,7 @@ export async function downloadMetadataAsync(metadataCtx: MetadataContext): Promi
|
||||
|
||||
const errors: Error[] = [];
|
||||
const config = createAppleWriter();
|
||||
const tasks = createAppleTasks(metadataCtx);
|
||||
const tasks = createAppleTasks();
|
||||
const taskCtx = { app };
|
||||
|
||||
for (const task of tasks) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ErrorObject } from 'ajv';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import Log, { link } from '../log';
|
||||
import { Issue } from './config/issue';
|
||||
|
||||
/**
|
||||
* Before syncing data to the ASC API, we need to validate the metadata config.
|
||||
@@ -9,7 +9,7 @@ import Log, { link } from '../log';
|
||||
* and should contain useful information for the user to solve before trying again.
|
||||
*/
|
||||
export class MetadataValidationError extends Error {
|
||||
public constructor(message?: string, public readonly errors: ErrorObject[] = []) {
|
||||
public constructor(message?: string, public readonly errors: Issue[] = []) {
|
||||
super(message ?? 'Store configuration validation failed');
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,9 @@ export function logMetadataValidationError(error: MetadataValidationError): void
|
||||
Log.error(chalk.bold(error.message));
|
||||
if (error.errors?.length > 0) {
|
||||
// TODO(cedric): group errors by property to make multiple errors for same property more readable
|
||||
Log.log(error.errors.map(err => ` - ${chalk.bold(err.dataPath)} ${err.message}`).join('\n'));
|
||||
for (const err of error.errors) {
|
||||
Log.log(` - ${chalk.bold(`$.${err.path.join('.')}`)} ${err.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { MetadataEvent } from '../analytics/AnalyticsManager';
|
||||
import { ExpoConfig } from '@expo/config-types';
|
||||
import { SubmitProfile } from '@expo/eas-json';
|
||||
|
||||
import { Analytics, MetadataEvent } from '../analytics/AnalyticsManager';
|
||||
import { CredentialsContext } from '../credentials/context';
|
||||
import Log from '../log';
|
||||
import { confirmAsync } from '../prompts';
|
||||
import { AppleData } from './apple/data';
|
||||
import { createAppleTasks } from './apple/tasks';
|
||||
import { MetadataConfig, createAppleReader, loadConfigAsync } from './config';
|
||||
import { MetadataContext, ensureMetadataAppStoreAuthenticatedAsync } from './context';
|
||||
import { getAppStoreAuthAsync } from './auth';
|
||||
import { createAppleReader, loadConfigAsync } from './config/resolve';
|
||||
import { MetadataConfig } from './config/schema';
|
||||
import { MetadataUploadError, MetadataValidationError, logMetadataValidationError } from './errors';
|
||||
import { subscribeTelemetry } from './utils/telemetry';
|
||||
|
||||
@@ -12,13 +17,29 @@ import { subscribeTelemetry } from './utils/telemetry';
|
||||
* Sync a local store configuration with the stores.
|
||||
* Note, only App Store is supported at this time.
|
||||
*/
|
||||
export async function uploadMetadataAsync(
|
||||
metadataCtx: MetadataContext
|
||||
): Promise<{ appleLink: string }> {
|
||||
const storeConfig = await loadConfigWithValidationPromptAsync(metadataCtx);
|
||||
const { app, auth } = await ensureMetadataAppStoreAuthenticatedAsync(metadataCtx);
|
||||
export async function uploadMetadataAsync({
|
||||
projectDir,
|
||||
profile,
|
||||
exp,
|
||||
analytics,
|
||||
credentialsCtx,
|
||||
}: {
|
||||
projectDir: string;
|
||||
profile: SubmitProfile;
|
||||
exp: ExpoConfig;
|
||||
analytics: Analytics;
|
||||
credentialsCtx: CredentialsContext;
|
||||
}): Promise<{ appleLink: string }> {
|
||||
const storeConfig = await loadConfigWithValidationPromptAsync(projectDir, profile);
|
||||
const { app, auth } = await getAppStoreAuthAsync({
|
||||
exp,
|
||||
credentialsCtx,
|
||||
projectDir,
|
||||
profile,
|
||||
});
|
||||
|
||||
const { unsubscribeTelemetry, executionId } = subscribeTelemetry(
|
||||
metadataCtx.analytics,
|
||||
analytics,
|
||||
MetadataEvent.APPLE_METADATA_UPLOAD,
|
||||
{ app, auth }
|
||||
);
|
||||
@@ -28,7 +49,7 @@ export async function uploadMetadataAsync(
|
||||
|
||||
const errors: Error[] = [];
|
||||
const config = createAppleReader(storeConfig);
|
||||
const tasks = createAppleTasks(metadataCtx, {
|
||||
const tasks = createAppleTasks({
|
||||
// We need to resolve a different version as soon as possible.
|
||||
// This version is the parent model of all changes we are going to push.
|
||||
version: config.getVersion()?.versionString,
|
||||
@@ -62,10 +83,11 @@ export async function uploadMetadataAsync(
|
||||
}
|
||||
|
||||
async function loadConfigWithValidationPromptAsync(
|
||||
metadataCtx: MetadataContext
|
||||
projectDir: string,
|
||||
profile: SubmitProfile
|
||||
): Promise<MetadataConfig> {
|
||||
try {
|
||||
return await loadConfigAsync(metadataCtx);
|
||||
return await loadConfigAsync({ projectDir, profile });
|
||||
} catch (error) {
|
||||
if (error instanceof MetadataValidationError) {
|
||||
logMetadataValidationError(error);
|
||||
@@ -75,7 +97,7 @@ async function loadConfigWithValidationPromptAsync(
|
||||
);
|
||||
|
||||
if (await confirmAsync({ message: 'Do you still want to push the store configuration?' })) {
|
||||
return await loadConfigAsync({ ...metadataCtx, skipValidation: true });
|
||||
return await loadConfigAsync({ projectDir, profile, skipValidation: true });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import { AggregateAjvError, HumanError } from '@segment/ajv-human-errors';
|
||||
import Ajv, { ErrorObject } from 'ajv';
|
||||
import addFormats from 'ajv-formats';
|
||||
|
||||
const jsonSchema = require('ajv/lib/refs/json-schema-draft-06.json');
|
||||
|
||||
/**
|
||||
* Create a new AJV validator using the JSON Schema 06 draft.
|
||||
* It also adds the additional formats from the `ajv-formats` package.
|
||||
*
|
||||
* @see https://github.com/ajv-validator/ajv-formats
|
||||
*/
|
||||
export function createValidator(): Ajv {
|
||||
const validator = new Ajv({
|
||||
strict: false, // The metadata schema is shared with vscode, including vscode-only properties
|
||||
verbose: true, // Required for `ajv-human-errors`
|
||||
allErrors: true, // Required for `ajv-human-errors`
|
||||
});
|
||||
|
||||
return addFormats(validator).addMetaSchema(jsonSchema);
|
||||
}
|
||||
|
||||
export function getReadableErrors(errors: ErrorObject[] = []): HumanError[] {
|
||||
if (errors.length === 0) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return new AggregateAjvError(errors).toJSON();
|
||||
}
|
||||
@@ -48,11 +48,11 @@ export function subscribeTelemetry(
|
||||
type: 'response',
|
||||
phase: 'rejected',
|
||||
method: error.request.method.toUpperCase(),
|
||||
url: scrubber(error.config.url),
|
||||
url: scrubber(error.config?.url),
|
||||
error: scrubber(error.message),
|
||||
status: String(error.response?.status),
|
||||
statusText: scrubber(error.response?.statusText),
|
||||
input: scrubber(error.config.data),
|
||||
input: scrubber(error.config?.data),
|
||||
output: scrubber(error.response?.data),
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import { PublishMutation } from '../graphql/mutations/PublishMutation';
|
||||
import { PresignedPost } from '../graphql/mutations/UploadSessionMutation';
|
||||
import { PublishQuery } from '../graphql/queries/PublishQuery';
|
||||
import { uploadWithPresignedPostWithRetryAsync } from '../uploads';
|
||||
import { expoCommandAsync, shouldUseVersionedExpoCLI } from '../utils/expoCli';
|
||||
import { expoCommandAsync } from '../utils/expoCli';
|
||||
import chunk from '../utils/expodash/chunk';
|
||||
import uniqBy from '../utils/expodash/uniqBy';
|
||||
|
||||
@@ -157,19 +157,14 @@ export async function buildBundlesAsync({
|
||||
throw new Error('Could not locate package.json');
|
||||
}
|
||||
|
||||
if (shouldUseVersionedExpoCLI(projectDir)) {
|
||||
await expoCommandAsync(projectDir, ['export', '--output-dir', inputDir, '--dump-sourcemap']);
|
||||
} else {
|
||||
// Legacy global Expo CLI
|
||||
await expoCommandAsync(projectDir, [
|
||||
'export',
|
||||
'--output-dir',
|
||||
inputDir,
|
||||
'--experimental-bundle',
|
||||
'--non-interactive',
|
||||
'--dump-sourcemap',
|
||||
]);
|
||||
}
|
||||
await expoCommandAsync(projectDir, [
|
||||
'export',
|
||||
'--output-dir',
|
||||
inputDir,
|
||||
'--experimental-bundle',
|
||||
'--non-interactive',
|
||||
'--dump-sourcemap',
|
||||
]);
|
||||
}
|
||||
|
||||
export async function resolveInputDirectoryAsync(customInputDirectory: string): Promise<string> {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import Log from '../../log';
|
||||
|
||||
export async function runAppOnAndroidEmulatorAsync(_appPath: string): Promise<void> {
|
||||
Log.error('Not implemented!');
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import spawnAsync from '@expo/spawn-async';
|
||||
import path from 'path';
|
||||
|
||||
import * as simulator from './simulator';
|
||||
import { validateSystemRequirementsAsync } from './systemRequirements';
|
||||
|
||||
export async function runAppOnIosSimulatorAsync(appPath: string): Promise<void> {
|
||||
await validateSystemRequirementsAsync();
|
||||
|
||||
const selectedSimulator = await simulator.selectSimulatorAsync();
|
||||
await simulator.ensureSimulatorBootedAsync(selectedSimulator);
|
||||
|
||||
await simulator.ensureSimulatorAppOpenedAsync(selectedSimulator.udid);
|
||||
|
||||
const bundleIdentifier = await getAppBundleIdentifierAsync(appPath);
|
||||
await simulator.installAppAsync(selectedSimulator.udid, appPath);
|
||||
|
||||
await simulator.launchAppAsync(selectedSimulator.udid, bundleIdentifier);
|
||||
}
|
||||
|
||||
async function getAppBundleIdentifierAsync(appPath: string): Promise<string> {
|
||||
const { stdout, stderr } = await spawnAsync('xcrun', [
|
||||
'plutil',
|
||||
'-extract',
|
||||
'CFBundleIdentifier',
|
||||
'raw',
|
||||
path.join(appPath, 'Info.plist'),
|
||||
]);
|
||||
|
||||
if (!stdout) {
|
||||
throw new Error(
|
||||
`Could not read app bundle identifier from ${path.join(appPath, 'Info.plist')}: ${stderr}`
|
||||
);
|
||||
}
|
||||
|
||||
return stdout.trim();
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { SpawnOptions, SpawnResult } from '@expo/spawn-async';
|
||||
|
||||
import { xcrunAsync } from './xcrun';
|
||||
|
||||
export async function simctlAsync(args: string[], options?: SpawnOptions): Promise<SpawnResult> {
|
||||
return xcrunAsync(['simctl', ...args], options);
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
import * as osascript from '@expo/osascript';
|
||||
import spawnAsync from '@expo/spawn-async';
|
||||
|
||||
import Log from '../../log';
|
||||
import { promptAsync } from '../../prompts';
|
||||
import { sleepAsync } from '../../utils/promise';
|
||||
import { simctlAsync } from './simctl';
|
||||
|
||||
interface IosSimulator {
|
||||
runtime: string;
|
||||
osVersion: string;
|
||||
windowName: string;
|
||||
osType: 'iOS';
|
||||
state: 'Booted' | 'Shutdown';
|
||||
isAvailable: boolean;
|
||||
name: string;
|
||||
udid: string;
|
||||
lastBootedAt?: Date;
|
||||
}
|
||||
|
||||
export async function selectSimulatorAsync(): Promise<IosSimulator> {
|
||||
const bootedSimulator = await getFirstBootedIosSimulatorAsync();
|
||||
|
||||
if (bootedSimulator) {
|
||||
return bootedSimulator;
|
||||
}
|
||||
|
||||
const simulators = await getAvaliableIosSimulatorsListAsync();
|
||||
|
||||
Log.newLine();
|
||||
const { selectedSimulator } = await promptAsync({
|
||||
type: 'select',
|
||||
message: `Select a simulator to run your app on`,
|
||||
name: 'selectedSimulator',
|
||||
choices: simulators.map(simulator => ({
|
||||
title: `ios ${simulator.osVersion} ${simulator.name}`,
|
||||
value: simulator,
|
||||
})),
|
||||
});
|
||||
|
||||
return selectedSimulator;
|
||||
}
|
||||
|
||||
export async function getFirstBootedIosSimulatorAsync(): Promise<IosSimulator | undefined> {
|
||||
const bootedSimulators = await getAvaliableIosSimulatorsListAsync('booted');
|
||||
|
||||
if (bootedSimulators.length > 0) {
|
||||
return bootedSimulators[0];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export async function getAvaliableIosSimulatorsListAsync(query?: string): Promise<IosSimulator[]> {
|
||||
const { stdout } = query
|
||||
? await simctlAsync(['list', 'devices', '--json', query])
|
||||
: await simctlAsync(['list', 'devices', '--json']);
|
||||
const info = parseSimControlJsonResults(stdout);
|
||||
|
||||
const iosSimulators = [];
|
||||
|
||||
for (const runtime of Object.keys(info.devices)) {
|
||||
// Given a string like 'com.apple.CoreSimulator.SimRuntime.tvOS-13-4'
|
||||
const runtimeSuffix = runtime.split('com.apple.CoreSimulator.SimRuntime.').pop();
|
||||
|
||||
if (!runtimeSuffix) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Create an array [tvOS, 13, 4]
|
||||
const [osType, ...osVersionComponents] = runtimeSuffix.split('-');
|
||||
|
||||
if (osType === 'iOS') {
|
||||
// Join the end components [13, 4] -> '13.4'
|
||||
const osVersion = osVersionComponents.join('.');
|
||||
const sims = info.devices[runtime];
|
||||
for (const device of sims) {
|
||||
if (device.isAvailable) {
|
||||
iosSimulators.push({
|
||||
...device,
|
||||
runtime,
|
||||
osVersion,
|
||||
windowName: `${device.name} (${osVersion})`,
|
||||
osType: 'iOS' as const,
|
||||
state: device.state as 'Booted' | 'Shutdown',
|
||||
lastBootedAt: device.lastBootedAt ? new Date(device.lastBootedAt) : undefined,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return iosSimulators;
|
||||
}
|
||||
|
||||
function parseSimControlJsonResults(input: string): any {
|
||||
try {
|
||||
return JSON.parse(input);
|
||||
} catch (error: any) {
|
||||
// Nov 15, 2020: Observed this can happen when opening the simulator and the simulator prompts the user to update the xcode command line tools.
|
||||
// Unexpected token I in JSON at position 0
|
||||
if (error.message.includes('Unexpected token')) {
|
||||
Log.error(`Apple's simctl returned malformed JSON:\n${input}`);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function ensureSimulatorBootedAsync(simulator: IosSimulator): Promise<void> {
|
||||
if (simulator.state === 'Booted') {
|
||||
return;
|
||||
}
|
||||
|
||||
await simctlAsync(['boot', simulator.udid]);
|
||||
}
|
||||
|
||||
export async function openSimulatorAppAsync(simulatorUdid: string): Promise<void> {
|
||||
const args = ['-a', 'Simulator'];
|
||||
if (simulatorUdid) {
|
||||
// This has no effect if the app is already running.
|
||||
args.push('--args', '-CurrentDeviceUDID', simulatorUdid);
|
||||
}
|
||||
await spawnAsync('open', args);
|
||||
}
|
||||
|
||||
export async function launchAppAsync(
|
||||
simulatorUdid: string,
|
||||
bundleIdentifier: string
|
||||
): Promise<void> {
|
||||
Log.newLine();
|
||||
Log.log('Launching your app...');
|
||||
|
||||
await simctlAsync(['launch', simulatorUdid, bundleIdentifier]);
|
||||
|
||||
Log.succeed('Successfully launched your app!');
|
||||
}
|
||||
|
||||
// I think the app can be open while no simulators are booted.
|
||||
async function waitForSimulatorAppToStartAsync(
|
||||
maxWaitTimeMs: number,
|
||||
intervalMs: number
|
||||
): Promise<void> {
|
||||
Log.newLine();
|
||||
Log.log('Waiting for Simulator app to start...');
|
||||
|
||||
const startTime = Date.now();
|
||||
while (Date.now() - startTime < maxWaitTimeMs) {
|
||||
if (await isSimulatorAppRunningAsync()) {
|
||||
return;
|
||||
}
|
||||
await sleepAsync(Math.min(intervalMs, Math.max(maxWaitTimeMs - (Date.now() - startTime), 0)));
|
||||
}
|
||||
throw new Error('Timed out waiting for the iOS simulator to start.');
|
||||
}
|
||||
|
||||
async function isSimulatorAppRunningAsync(): Promise<boolean> {
|
||||
try {
|
||||
const result = await osascript.execAsync(
|
||||
'tell app "System Events" to count processes whose name is "Simulator"'
|
||||
);
|
||||
|
||||
if (result.trim() === '0') {
|
||||
return false;
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (error.message.includes('Application isn’t running')) {
|
||||
return false;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
export async function ensureSimulatorAppOpenedAsync(simulatorUuid: string): Promise<void> {
|
||||
if (await isSimulatorAppRunningAsync()) {
|
||||
return;
|
||||
}
|
||||
|
||||
await openSimulatorAppAsync(simulatorUuid);
|
||||
await waitForSimulatorAppToStartAsync(60 * 1000, 1000);
|
||||
}
|
||||
|
||||
export async function installAppAsync(deviceId: string, filePath: string): Promise<void> {
|
||||
Log.newLine();
|
||||
Log.log('Installing your app on the simulator...');
|
||||
|
||||
await simctlAsync(['install', deviceId, filePath]);
|
||||
|
||||
Log.succeed('Successfully installed your app on the simulator!');
|
||||
}
|
||||
|
||||
export async function getSimulatorAppIdAsync(): Promise<string | undefined> {
|
||||
try {
|
||||
return (await osascript.execAsync('id of app "Simulator"')).trim();
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import spawnAsync from '@expo/spawn-async';
|
||||
import chalk from 'chalk';
|
||||
import semver from 'semver';
|
||||
|
||||
import Log from '../../log';
|
||||
import { promptAsync } from '../../prompts';
|
||||
import { getSimulatorAppIdAsync } from './simulator';
|
||||
import * as xcode from './xcode';
|
||||
import { installXcrunAsync, isXcrunInstalledAsync } from './xcrun';
|
||||
|
||||
function assertPlatform(): void {
|
||||
if (process.platform !== 'darwin') {
|
||||
Log.error('iOS simulator apps can only be run on macOS devices.');
|
||||
throw Error('iOS simulator apps can only be run on macOS devices.');
|
||||
}
|
||||
}
|
||||
|
||||
async function assertCorrectXcodeVersionInstalledAsync(): Promise<void> {
|
||||
const xcodeVersion = await xcode.getXcodeVersionAsync();
|
||||
|
||||
if (!xcodeVersion) {
|
||||
const { goToAppStore } = await promptAsync({
|
||||
type: 'select',
|
||||
message: 'Xcode needs to be installed, would you like to continue to the App Store?',
|
||||
name: 'goToAppStore',
|
||||
choices: [
|
||||
{ title: 'Yes', value: true },
|
||||
{ title: 'No', value: false },
|
||||
],
|
||||
});
|
||||
|
||||
if (goToAppStore) {
|
||||
await xcode.openAppStoreAsync(xcode.APP_STORE_ID);
|
||||
}
|
||||
|
||||
throw Error('Please try again once Xcode is installed');
|
||||
}
|
||||
|
||||
if (semver.lt(xcodeVersion, xcode.MIN_XCODE_VERSION)) {
|
||||
throw Error(
|
||||
`Xcode version ${chalk.bold(xcodeVersion)} is too old. Please upgrade to version ${chalk.bold(
|
||||
xcode.MIN_XCODE_VERSION
|
||||
)} or higher.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureXcrunInstalledAsync(): Promise<void> {
|
||||
if (!isXcrunInstalledAsync()) {
|
||||
const { installXcrun } = await promptAsync({
|
||||
type: 'select',
|
||||
message: 'Xcode Command Line Tools need to be installed, continue?',
|
||||
name: 'installXcrun',
|
||||
choices: [
|
||||
{ title: 'Yes', value: true },
|
||||
{ title: 'No', value: false },
|
||||
],
|
||||
});
|
||||
|
||||
if (installXcrun) {
|
||||
await installXcrunAsync();
|
||||
return;
|
||||
}
|
||||
|
||||
throw Error('Please try again once Xcode Command Line Tools are installed');
|
||||
}
|
||||
}
|
||||
|
||||
async function assertSimulatorAppInstalledAsync(): Promise<void> {
|
||||
const simulatorAppId = await getSimulatorAppIdAsync();
|
||||
if (!simulatorAppId) {
|
||||
throw new Error(
|
||||
`Can't determine id of Simulator app; the Simulator is most likely not installed on this machine. Run 'sudo xcode-select -s /Applications/Xcode.app'`
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
simulatorAppId !== 'com.apple.iphonesimulator' &&
|
||||
simulatorAppId !== 'com.apple.CoreSimulator.SimulatorTrampoline'
|
||||
) {
|
||||
throw new Error(
|
||||
`Simulator is installed but is identified as '${simulatorAppId}', can't recognize what that is`
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
// make sure we can run simctl
|
||||
await spawnAsync('xcrun', ['simctl', 'help']);
|
||||
} catch (error: any) {
|
||||
Log.warn(`Unable to run simctl:\n${error.toString()}`);
|
||||
throw new Error(
|
||||
'xcrun is not configured correctly. Ensure `sudo xcode-select --reset` works before running this command again.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export async function validateSystemRequirementsAsync(): Promise<void> {
|
||||
assertPlatform();
|
||||
await assertCorrectXcodeVersionInstalledAsync();
|
||||
await ensureXcrunInstalledAsync();
|
||||
await assertSimulatorAppInstalledAsync();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import spawnAsync from '@expo/spawn-async';
|
||||
import chalk from 'chalk';
|
||||
import semver from 'semver';
|
||||
|
||||
import Log from '../../log';
|
||||
|
||||
// Based on the RN docs (Aug 2020).
|
||||
export const MIN_XCODE_VERSION = '9.4.0';
|
||||
export const APP_STORE_ID = '497799835';
|
||||
|
||||
export async function getXcodeVersionAsync(): Promise<string | undefined> {
|
||||
try {
|
||||
const { stdout } = await spawnAsync('xcodebuild', ['-version']);
|
||||
|
||||
const version = stdout.match(/Xcode (\d+\.\d+)/)?.[1];
|
||||
|
||||
const semverFormattedVersion = `${version}.0`;
|
||||
|
||||
if (!semver.valid(semverFormattedVersion)) {
|
||||
Log.warn(
|
||||
`Xcode version ${chalk.bold(version)} is in unknown format. Expected format is ${chalk.bold(
|
||||
'12.0'
|
||||
)}.`
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return semverFormattedVersion;
|
||||
} catch {
|
||||
// not installed
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export async function openAppStoreAsync(appId: string): Promise<void> {
|
||||
const link = getAppStoreLink(appId);
|
||||
await spawnAsync(`open`, [link]);
|
||||
}
|
||||
|
||||
function getAppStoreLink(appId: string): string {
|
||||
if (process.platform === 'darwin') {
|
||||
// TODO: Is there ever a case where the macappstore isn't available on mac?
|
||||
return `macappstore://itunes.apple.com/app/id${appId}`;
|
||||
}
|
||||
return `https://apps.apple.com/us/app/id${appId}`;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
import spawnAsync, { SpawnOptions, SpawnResult } from '@expo/spawn-async';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import Log from '../../log';
|
||||
import { sleepAsync } from '../../utils/promise';
|
||||
|
||||
export async function xcrunAsync(args: string[], options?: SpawnOptions): Promise<SpawnResult> {
|
||||
try {
|
||||
return await spawnAsync('xcrun', args, options);
|
||||
} catch (e) {
|
||||
throwXcrunError(e);
|
||||
}
|
||||
}
|
||||
|
||||
function throwXcrunError(e: any): never {
|
||||
if (isLicenseOutOfDate(e.stdout) || isLicenseOutOfDate(e.stderr)) {
|
||||
throw new Error('Xcode license is not accepted. Please run `sudo xcodebuild -license`.');
|
||||
} else if (e.stderr?.includes('not a developer tool or in PATH')) {
|
||||
throw new Error(
|
||||
`You may need to run ${chalk.bold(
|
||||
'sudo xcode-select -s /Applications/Xcode.app'
|
||||
)} and try again.`
|
||||
);
|
||||
}
|
||||
|
||||
if (Array.isArray(e.output)) {
|
||||
e.message += '\n' + e.output.join('\n').trim();
|
||||
} else if (e.stderr) {
|
||||
e.message += '\n' + e.stderr;
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
`Some other error occurred while running xcrun command.
|
||||
${e.message}`
|
||||
);
|
||||
}
|
||||
|
||||
function isLicenseOutOfDate(text: string): boolean {
|
||||
if (!text) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const lower = text.toLowerCase();
|
||||
return lower.includes('xcode') && lower.includes('license');
|
||||
}
|
||||
|
||||
export async function isXcrunInstalledAsync(): Promise<boolean> {
|
||||
try {
|
||||
await spawnAsync('xcrun', ['--version']);
|
||||
return true;
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export async function installXcrunAsync(): Promise<void> {
|
||||
await spawnAsync('xcode-select', ['--install']);
|
||||
|
||||
await waitForXcrunInstallToFinishAsync(60 * 1000, 1000);
|
||||
}
|
||||
|
||||
async function waitForXcrunInstallToFinishAsync(
|
||||
maxWaitTimeMs: number,
|
||||
intervalMs: number
|
||||
): Promise<void> {
|
||||
Log.newLine();
|
||||
Log.log('Waiting for Xcode Command Line Tools install to finish...');
|
||||
|
||||
const startTime = Date.now();
|
||||
while (Date.now() - startTime < maxWaitTimeMs) {
|
||||
if (await isXcrunInstalledAsync()) {
|
||||
return;
|
||||
}
|
||||
await sleepAsync(Math.min(intervalMs, Math.max(maxWaitTimeMs - (Date.now() - startTime), 0)));
|
||||
}
|
||||
throw new Error('Timed out waiting for Xcode Command Line Tools install to finish');
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { AppPlatform } from '../graphql/generated';
|
||||
import { runAppOnAndroidEmulatorAsync } from './android/run';
|
||||
import { runAppOnIosSimulatorAsync } from './ios/run';
|
||||
|
||||
export interface RunArchiveFlags {
|
||||
latest?: boolean;
|
||||
id?: string;
|
||||
path?: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export async function runAsync(
|
||||
simulatorBuildPath: string,
|
||||
selectedPlatform: AppPlatform
|
||||
): Promise<void> {
|
||||
if (selectedPlatform === AppPlatform.Ios) {
|
||||
await runAppOnIosSimulatorAsync(simulatorBuildPath);
|
||||
} else {
|
||||
await runAppOnAndroidEmulatorAsync(simulatorBuildPath);
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ export function formatArchiveSourceSummary({ source, build }: Archive): ArchiveS
|
||||
return summarySlice;
|
||||
}
|
||||
|
||||
export function printSummary<T>(summary: T, keyMap: Record<keyof T, string>): void {
|
||||
export function printSummary<T extends object>(summary: T, keyMap: Record<keyof T, string>): void {
|
||||
const fields = [];
|
||||
for (const [key, value] of Object.entries(summary)) {
|
||||
const label = `${keyMap[key as keyof T]}:`;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import assert from 'assert';
|
||||
import chalk from 'chalk';
|
||||
import CliTable from 'cli-table3';
|
||||
|
||||
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
||||
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
||||
@@ -18,10 +17,9 @@ import {
|
||||
paginatedQueryWithSelectPromptAsync,
|
||||
} from '../utils/queries';
|
||||
import {
|
||||
UPDATE_COLUMNS,
|
||||
UPDATE_COLUMNS_WITH_BRANCH,
|
||||
formatBranch,
|
||||
formatUpdateGroup,
|
||||
formatUpdateTitle,
|
||||
getUpdateGroupDescriptions,
|
||||
getUpdateGroupDescriptionsWithBranch,
|
||||
} from './utils';
|
||||
|
||||
@@ -44,7 +42,7 @@ export async function listAndRenderUpdateGroupsOnAppAsync(
|
||||
offset: paginatedQueryOptions.offset,
|
||||
appId: projectId,
|
||||
});
|
||||
renderUpdateGroupsOnAppAsTable(updateGroups, paginatedQueryOptions);
|
||||
renderUpdateGroupsOnApp({ updateGroups, paginatedQueryOptions });
|
||||
} else {
|
||||
await paginatedQueryWithConfirmPromptAsync({
|
||||
limit: paginatedQueryOptions.limit ?? UPDATE_GROUPS_LIMIT,
|
||||
@@ -54,7 +52,7 @@ export async function listAndRenderUpdateGroupsOnAppAsync(
|
||||
promptOptions: {
|
||||
title: 'Load more update groups?',
|
||||
renderListItems: updateGroups =>
|
||||
renderUpdateGroupsOnAppAsTable(updateGroups, paginatedQueryOptions),
|
||||
renderUpdateGroupsOnApp({ updateGroups, paginatedQueryOptions }),
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -79,7 +77,7 @@ export async function listAndRenderUpdateGroupsOnBranchAsync(
|
||||
appId: projectId,
|
||||
branchName,
|
||||
});
|
||||
renderUpdateGroupsOnBranchAsTable({ updateGroups, branchName, paginatedQueryOptions });
|
||||
renderUpdateGroupsOnBranch({ updateGroups, branchName, paginatedQueryOptions });
|
||||
} else {
|
||||
await paginatedQueryWithConfirmPromptAsync({
|
||||
limit: paginatedQueryOptions.limit ?? UPDATE_GROUPS_LIMIT,
|
||||
@@ -94,7 +92,7 @@ export async function listAndRenderUpdateGroupsOnBranchAsync(
|
||||
promptOptions: {
|
||||
title: 'Load more update groups?',
|
||||
renderListItems: updateGroups =>
|
||||
renderUpdateGroupsOnBranchAsTable({ updateGroups, branchName, paginatedQueryOptions }),
|
||||
renderUpdateGroupsOnBranch({ updateGroups, branchName, paginatedQueryOptions }),
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -154,15 +152,16 @@ async function queryUpdateGroupsOnAppAsync(
|
||||
return await UpdateQuery.viewUpdateGroupsOnAppAsync(graphqlClient, args);
|
||||
}
|
||||
|
||||
function renderUpdateGroupsOnBranchAsTable({
|
||||
updateGroups,
|
||||
function renderUpdateGroupsOnBranch({
|
||||
branchName,
|
||||
updateGroups,
|
||||
paginatedQueryOptions: { json },
|
||||
}: {
|
||||
updateGroups: UpdateFragment[][];
|
||||
branchName: string;
|
||||
updateGroups: UpdateFragment[][];
|
||||
paginatedQueryOptions: PaginatedQueryOptions;
|
||||
}): void {
|
||||
// Ensure all updates are from the same branch
|
||||
const branchNames = updateGroups.flatMap(updateGroup =>
|
||||
updateGroup.map(update => update.branch.name)
|
||||
);
|
||||
@@ -171,59 +170,58 @@ function renderUpdateGroupsOnBranchAsTable({
|
||||
'Each update must belong to the same branch.'
|
||||
);
|
||||
|
||||
const updateGroupDescriptions = getUpdateGroupDescriptionsWithBranch(updateGroups);
|
||||
const branch = {
|
||||
name: branchName,
|
||||
id: updateGroups[0]?.[0].branch.id ?? 'N/A',
|
||||
};
|
||||
|
||||
const updateGroupDescriptions = getUpdateGroupDescriptions(updateGroups);
|
||||
|
||||
if (json) {
|
||||
printJsonOnlyOutput({ ...branch, currentPage: updateGroupDescriptions });
|
||||
} else {
|
||||
const updateGroupsTable = new CliTable({
|
||||
head: UPDATE_COLUMNS,
|
||||
wordWrap: true,
|
||||
});
|
||||
|
||||
updateGroupDescriptions.forEach(({ message, runtimeVersion, group, platforms }) => {
|
||||
updateGroupsTable.push([message, runtimeVersion, group, platforms]);
|
||||
});
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Branch:'));
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'Name', value: branch.name },
|
||||
{ label: 'ID', value: branch.id },
|
||||
])
|
||||
);
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(updateGroupsTable.toString());
|
||||
return printJsonOnlyOutput({ ...branch, currentPage: updateGroupDescriptions });
|
||||
}
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Branch:'));
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'Name', value: branch.name },
|
||||
{ label: 'ID', value: branch.id },
|
||||
])
|
||||
);
|
||||
Log.newLine();
|
||||
Log.log(chalk.bold('Recent update groups:'));
|
||||
Log.newLine();
|
||||
Log.log(
|
||||
updateGroupDescriptions
|
||||
.map(description => formatUpdateGroup(description))
|
||||
.join(`\n\n${chalk.dim('———')}\n\n`)
|
||||
);
|
||||
}
|
||||
|
||||
function renderUpdateGroupsOnAppAsTable(
|
||||
updateGroups: UpdateFragment[][],
|
||||
{ json }: PaginatedQueryOptions
|
||||
): void {
|
||||
function renderUpdateGroupsOnApp({
|
||||
updateGroups,
|
||||
paginatedQueryOptions: { json },
|
||||
}: {
|
||||
updateGroups: UpdateFragment[][];
|
||||
paginatedQueryOptions: PaginatedQueryOptions;
|
||||
}): void {
|
||||
const updateGroupDescriptions = getUpdateGroupDescriptionsWithBranch(updateGroups);
|
||||
|
||||
if (json) {
|
||||
printJsonOnlyOutput({ currentPage: updateGroupDescriptions });
|
||||
} else {
|
||||
const updateGroupsTable = new CliTable({
|
||||
head: UPDATE_COLUMNS_WITH_BRANCH,
|
||||
wordWrap: true,
|
||||
});
|
||||
|
||||
updateGroupDescriptions.forEach(({ branch, message, runtimeVersion, group, platforms }) => {
|
||||
updateGroupsTable.push([branch, message, runtimeVersion, group, platforms]);
|
||||
});
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Recent update groups:'));
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(updateGroupsTable.toString());
|
||||
}
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Recent update groups:'));
|
||||
Log.newLine();
|
||||
Log.log(
|
||||
updateGroupDescriptions
|
||||
.map(({ branch, ...update }) =>
|
||||
formatBranch({
|
||||
branch,
|
||||
update,
|
||||
})
|
||||
)
|
||||
.join(`\n\n${chalk.dim('———')}\n\n`)
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,14 @@ import chalk from 'chalk';
|
||||
import dateFormat from 'dateformat';
|
||||
|
||||
import { getEASUpdateURL } from '../api';
|
||||
import { Maybe, Robot, Update, UpdateFragment, User } from '../graphql/generated';
|
||||
import {
|
||||
Maybe,
|
||||
Robot,
|
||||
Update,
|
||||
UpdateBranchFragment,
|
||||
UpdateFragment,
|
||||
User,
|
||||
} from '../graphql/generated';
|
||||
import Log, { learnMore } from '../log';
|
||||
import { RequestedPlatform } from '../platform';
|
||||
import { confirmAsync } from '../prompts';
|
||||
@@ -31,6 +38,12 @@ export type FormattedUpdateGroupDescription = {
|
||||
runtimeVersion: string;
|
||||
};
|
||||
|
||||
export type FormattedBranchDescription = {
|
||||
branch: string;
|
||||
branchRolloutPercentage?: number;
|
||||
update?: FormattedUpdateGroupDescription;
|
||||
};
|
||||
|
||||
export type FormattedUpdateGroupDescriptionWithBranch = FormattedUpdateGroupDescription & {
|
||||
branch: string;
|
||||
};
|
||||
@@ -53,6 +66,25 @@ export function formatUpdateGroup(update: FormattedUpdateGroupDescription): stri
|
||||
]);
|
||||
}
|
||||
|
||||
export function formatBranch({
|
||||
branch,
|
||||
branchRolloutPercentage,
|
||||
update,
|
||||
}: FormattedBranchDescription): string {
|
||||
const rolloutField = branchRolloutPercentage
|
||||
? [{ label: 'Rollout', value: `${branchRolloutPercentage}%` }]
|
||||
: [];
|
||||
|
||||
return formatFields([
|
||||
{ label: 'Branch', value: branch },
|
||||
...rolloutField,
|
||||
{ label: 'Platforms', value: update?.platforms ?? 'N/A' },
|
||||
{ label: 'Runtime Version', value: update?.runtimeVersion ?? 'N/A' },
|
||||
{ label: 'Message', value: update?.message ?? 'N/A' },
|
||||
{ label: 'Group ID', value: update?.group ?? 'N/A' },
|
||||
]);
|
||||
}
|
||||
|
||||
export function getPlatformsForGroup({
|
||||
group,
|
||||
updates = [],
|
||||
@@ -172,6 +204,26 @@ export function getUpdateGroupDescriptionsWithBranch(
|
||||
}));
|
||||
}
|
||||
|
||||
export function getBranchDescription(branch: UpdateBranchFragment): FormattedBranchDescription {
|
||||
if (branch.updates.length === 0) {
|
||||
return { branch: branch.name };
|
||||
}
|
||||
|
||||
const latestUpdate = branch.updates[0];
|
||||
return {
|
||||
branch: branch.name,
|
||||
update: {
|
||||
message: formatUpdateMessage(latestUpdate),
|
||||
runtimeVersion: latestUpdate.runtimeVersion,
|
||||
group: latestUpdate.group,
|
||||
platforms: getPlatformsForGroup({
|
||||
group: latestUpdate.group,
|
||||
updates: branch.updates,
|
||||
}),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function checkEASUpdateURLIsSetAsync(
|
||||
exp: ExpoConfig,
|
||||
projectId: string
|
||||
|
||||
@@ -142,11 +142,11 @@ describe(SessionManager, () => {
|
||||
await sessionManager['loginAsync']({ username: 'USERNAME', password: 'PASSWORD' });
|
||||
expect(await fs.readFile(getStateJsonPath(), 'utf8')).toMatchInlineSnapshot(`
|
||||
"{
|
||||
\\"auth\\": {
|
||||
\\"sessionSecret\\": \\"SESSION_SECRET\\",
|
||||
\\"userId\\": \\"USER_ID\\",
|
||||
\\"username\\": \\"USERNAME\\",
|
||||
\\"currentConnection\\": \\"Username-Password-Authentication\\"
|
||||
"auth": {
|
||||
"sessionSecret": "SESSION_SECRET",
|
||||
"userId": "USER_ID",
|
||||
"username": "USERNAME",
|
||||
"currentConnection": "Username-Password-Authentication"
|
||||
}
|
||||
}
|
||||
"
|
||||
|
||||
@@ -18,6 +18,7 @@ const userStub: Actor = {
|
||||
},
|
||||
],
|
||||
isExpoAdmin: false,
|
||||
featureGates: {},
|
||||
};
|
||||
|
||||
const robotStub: Actor = {
|
||||
@@ -26,6 +27,7 @@ const robotStub: Actor = {
|
||||
firstName: 'GLaDOS',
|
||||
accounts: [],
|
||||
isExpoAdmin: false,
|
||||
featureGates: {},
|
||||
};
|
||||
|
||||
describe('getActorDisplayName', () => {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { BuildDistributionType } from '../build/types';
|
||||
import { DistributionType } from '../graphql/generated';
|
||||
|
||||
export const buildDistributionTypeToGraphQLDistributionType = (
|
||||
buildDistribution?: BuildDistributionType
|
||||
): DistributionType | undefined => {
|
||||
if (buildDistribution === BuildDistributionType.STORE) {
|
||||
return DistributionType.Store;
|
||||
} else if (buildDistribution === BuildDistributionType.INTERNAL) {
|
||||
return DistributionType.Internal;
|
||||
} else if (buildDistribution === BuildDistributionType.SIMULATOR) {
|
||||
return DistributionType.Simulator;
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,157 @@
|
||||
import spawnAsync from '@expo/spawn-async';
|
||||
import cliProgress from 'cli-progress';
|
||||
import glob from 'fast-glob';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { Stream } from 'stream';
|
||||
import { extract } from 'tar';
|
||||
import { promisify } from 'util';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import fetch, { RequestInit } from '../fetch';
|
||||
import Log from '../log';
|
||||
import { getTmpDirectory } from './paths';
|
||||
|
||||
const pipeline = promisify(Stream.pipeline);
|
||||
|
||||
type ProgressCallback = (progress: number, total: number, loaded: number) => void;
|
||||
|
||||
function wrapFetchWithProgress() {
|
||||
return async (url: string, init: RequestInit, onProgressCallback: ProgressCallback) => {
|
||||
const response = await fetch(url, init);
|
||||
|
||||
if (response.ok) {
|
||||
const totalDownloadSize = response.headers.get('Content-Length');
|
||||
const total = Number(totalDownloadSize);
|
||||
|
||||
if (!totalDownloadSize || isNaN(total) || total < 0) {
|
||||
Log.warn(
|
||||
'Progress callback not supported for network request because "Content-Length" header missing or invalid in response from URL:',
|
||||
url.toString()
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
let length = 0;
|
||||
const onProgress = (chunkLength?: number): void => {
|
||||
if (chunkLength) {
|
||||
length += chunkLength;
|
||||
}
|
||||
|
||||
const progress = length / total;
|
||||
|
||||
onProgressCallback(progress, total, length);
|
||||
};
|
||||
|
||||
response.body.on('data', chunk => {
|
||||
onProgress(chunk.length);
|
||||
});
|
||||
|
||||
response.body.on('end', () => {
|
||||
onProgress();
|
||||
});
|
||||
}
|
||||
|
||||
return response;
|
||||
};
|
||||
}
|
||||
|
||||
async function downloadFileWithProgressBarAsync(
|
||||
url: string,
|
||||
outputPath: string,
|
||||
infoMessage?: string
|
||||
): Promise<void> {
|
||||
Log.newLine();
|
||||
Log.log(infoMessage ? infoMessage : `Downloading file from ${url}...`);
|
||||
|
||||
const downloadProgressBar = new cliProgress.SingleBar(
|
||||
{ format: '|{bar}|' },
|
||||
cliProgress.Presets.rect
|
||||
);
|
||||
|
||||
let downloadProgressBarStarted = false;
|
||||
const response = await wrapFetchWithProgress()(
|
||||
url,
|
||||
{
|
||||
timeout: 1000 * 60 * 5, // 5 minutes
|
||||
},
|
||||
(_progress: number, total: number, loaded: number): void => {
|
||||
if (!downloadProgressBarStarted) {
|
||||
downloadProgressBar.start(total, loaded);
|
||||
downloadProgressBarStarted = true;
|
||||
} else if (loaded < total) {
|
||||
downloadProgressBar.update(loaded);
|
||||
} else {
|
||||
downloadProgressBar.stop();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to download file from ${url}`);
|
||||
}
|
||||
|
||||
await pipeline(response.body, fs.createWriteStream(outputPath));
|
||||
}
|
||||
|
||||
export async function downloadAndExtractAppAsync(
|
||||
url: string,
|
||||
applicationExtension: string
|
||||
): Promise<string> {
|
||||
const outputDir = path.join(getTmpDirectory(), uuidv4());
|
||||
await fs.promises.mkdir(outputDir, { recursive: true });
|
||||
|
||||
const tmpArchivePathDir = path.join(getTmpDirectory(), uuidv4());
|
||||
await fs.promises.mkdir(tmpArchivePathDir, { recursive: true });
|
||||
|
||||
const tmpArchivePath = path.join(tmpArchivePathDir, `${uuidv4()}.tar.gz`);
|
||||
|
||||
await downloadFileWithProgressBarAsync(url, tmpArchivePath, 'Downloading app archive...');
|
||||
await tarExtractAsync(tmpArchivePath, outputDir);
|
||||
|
||||
return await getAppPathAsync(outputDir, applicationExtension);
|
||||
}
|
||||
|
||||
export async function extractAppFromLocalArchiveAsync(
|
||||
appArchivePath: string,
|
||||
applicationExtension: string
|
||||
): Promise<string> {
|
||||
const outputDir = path.join(getTmpDirectory(), uuidv4());
|
||||
await fs.promises.mkdir(outputDir, { recursive: true });
|
||||
|
||||
await tarExtractAsync(appArchivePath, outputDir);
|
||||
|
||||
return await getAppPathAsync(outputDir, applicationExtension);
|
||||
}
|
||||
|
||||
async function getAppPathAsync(outputDir: string, applicationExtension: string): Promise<string> {
|
||||
const appFileName = await glob(`*.${applicationExtension}`, {
|
||||
cwd: outputDir,
|
||||
onlyFiles: false,
|
||||
});
|
||||
|
||||
if (appFileName.length === 0) {
|
||||
throw Error('Something went wrong while extracting the app from app archive');
|
||||
}
|
||||
|
||||
return path.join(outputDir, appFileName[0]);
|
||||
}
|
||||
|
||||
async function tarExtractAsync(input: string, output: string): Promise<void> {
|
||||
try {
|
||||
if (process.platform !== 'win32') {
|
||||
await spawnAsync('tar', ['-xf', input, '-C', output], {
|
||||
stdio: 'inherit',
|
||||
});
|
||||
return;
|
||||
}
|
||||
} catch (error: any) {
|
||||
Log.warn(
|
||||
`Failed to extract tar using native tools, falling back on JS tar module. ${error.message}`
|
||||
);
|
||||
}
|
||||
Log.debug(`Extracting ${input} to ${output} using JS tar module`);
|
||||
// tar node module has previously had problems with big files, and seems to
|
||||
// be slower, so only use it as a backup.
|
||||
await extract({ file: input, cwd: output });
|
||||
}
|
||||
@@ -1,16 +1,9 @@
|
||||
import spawnAsync from '@expo/spawn-async';
|
||||
import chalk from 'chalk';
|
||||
import { boolish } from 'getenv';
|
||||
import resolveFrom from 'resolve-from';
|
||||
|
||||
import Log from '../log';
|
||||
|
||||
export function shouldUseVersionedExpoCLI(projectDir: string): boolean {
|
||||
// Users can disable local CLI settings EXPO_USE_LOCAL_CLI=false
|
||||
// https://github.com/expo/expo/blob/69eddda7bb1dbfab44258f468cf7f22984c1e44e/packages/expo/bin/cli.js#L10
|
||||
return !!resolveFrom.silent(projectDir, '@expo/cli') && boolish('EXPO_USE_LOCAL_CLI', true);
|
||||
}
|
||||
|
||||
export async function expoCommandAsync(
|
||||
projectDir: string,
|
||||
args: string[],
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { truthy } from '../filter';
|
||||
|
||||
describe(truthy, () => {
|
||||
it('filters 0 numbers', () => {
|
||||
expect([1, 0, -2, 2].filter(truthy)).toEqual([1, -2, 2]);
|
||||
});
|
||||
|
||||
it('filters empty strings', () => {
|
||||
expect(['hello', '', 'world'].filter(truthy)).toEqual(['hello', 'world']);
|
||||
});
|
||||
|
||||
it('filters null from strings or numbers', () => {
|
||||
expect(['hello', null, 1, ''].filter(truthy)).toEqual(['hello', 1]);
|
||||
});
|
||||
|
||||
it('filters undefined from strings or numbers', () => {
|
||||
expect(['hello', undefined, 1, ''].filter(truthy)).toEqual(['hello', 1]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
/** A predicate to filter arrays on truthy values, returning a type-safe array. */
|
||||
export function truthy<TValue>(value: TValue | null | undefined): value is TValue {
|
||||
return !!value;
|
||||
}
|
||||
@@ -4,8 +4,10 @@ type FormatFieldsOptions = {
|
||||
labelFormat: (raw: string) => string;
|
||||
};
|
||||
|
||||
export type FormatFieldsItem = { label: string; value: string };
|
||||
|
||||
export default function formatFields(
|
||||
fields: { label: string; value: string }[],
|
||||
fields: FormatFieldsItem[],
|
||||
options: FormatFieldsOptions = { labelFormat: chalk.dim }
|
||||
): string {
|
||||
const columnWidth = fields.reduce((a, b) => (a.label.length > b.label.length ? a : b)).label
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"name": "@expo/eas-json",
|
||||
"description": "A library for interacting with eas.json",
|
||||
"version": "2.2.0",
|
||||
"version": "2.6.0",
|
||||
"author": "Expo <[email protected]>",
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "7.18.6",
|
||||
"@expo/eas-build-job": "0.2.94",
|
||||
"@expo/eas-build-job": "0.2.96",
|
||||
"chalk": "4.1.2",
|
||||
"env-string": "1.0.1",
|
||||
"fs-extra": "10.1.0",
|
||||
"golden-fleece": "1.0.9",
|
||||
"joi": "17.6.0",
|
||||
"joi": "17.6.4",
|
||||
"log-symbols": "4.1.0",
|
||||
"semver": "7.3.7",
|
||||
"semver": "7.3.8",
|
||||
"tslib": "2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -21,7 +21,7 @@
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"memfs": "3.4.7",
|
||||
"rimraf": "3.0.2",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "4.8.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
exports[`EasJsonAccessor patching JSON file 1`] = `
|
||||
"{
|
||||
\\"build\\": {
|
||||
\\"production\\": {
|
||||
\\"env\\": {
|
||||
\\"TEST\\": \\"123\\",
|
||||
\\"ABC\\": \\"456\\"
|
||||
"build": {
|
||||
"production": {
|
||||
"env": {
|
||||
"TEST": "123",
|
||||
"ABC": "456"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,12 +16,12 @@ exports[`EasJsonAccessor patching JSON file 1`] = `
|
||||
|
||||
exports[`EasJsonAccessor patching JSON5 file (preserves comments) 1`] = `
|
||||
"{
|
||||
\\"build\\": {
|
||||
\\"production\\": {
|
||||
"build": {
|
||||
"production": {
|
||||
// comment
|
||||
\\"env\\": {
|
||||
\\"TEST\\": \\"123\\",
|
||||
ABC: \\"456\\"
|
||||
"env": {
|
||||
"TEST": "123",
|
||||
ABC: "456"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
declare module 'exec-async' {
|
||||
import { ExecFileOptions } from 'child_process';
|
||||
|
||||
export type ExecAsyncOptions = ExecFileOptions;
|
||||
|
||||
export default function execAsync(
|
||||
command: string,
|
||||
args?: readonly string[] | object | undefined,
|
||||
options?: ExecAsyncOptions
|
||||
): Promise<string>;
|
||||
}
|
||||
Reference in new issue
Block a user