mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-13 20:28:08 -10:00
Compare commits
42
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9147ae631c | ||
|
|
9c09cb9034 | ||
|
|
e52d14586f | ||
|
|
0f7646868f | ||
|
|
6fe4511280 | ||
|
|
efc1551d62 | ||
|
|
0cc5b74081 | ||
|
|
6c6f9b079d | ||
|
|
7da0db0237 | ||
|
|
66f916ac02 | ||
|
|
0e500ec827 | ||
|
|
00f1d24aa5 | ||
|
|
b909409c54 | ||
|
|
d18d7a6e21 | ||
|
|
0131cdbf4b | ||
|
|
114190c52e | ||
|
|
a06352d150 | ||
|
|
1969eea8a7 | ||
|
|
8c758fa413 | ||
|
|
4b2fb24d1d | ||
|
|
1637573d72 | ||
|
|
367477f75b | ||
|
|
f5d44a08ec | ||
|
|
d4ffb07402 | ||
|
|
0b2b6ddc14 | ||
|
|
0cff5ef83f | ||
|
|
396c45269e | ||
|
|
98ad9798c5 | ||
|
|
b4741293ba | ||
|
|
43a6aa826b | ||
|
|
e0a9384e56 | ||
|
|
b5ca8c63d9 | ||
|
|
c98401131a | ||
|
|
c1cd0f584f | ||
|
|
f82aae7fc9 | ||
|
|
c349ad7a40 | ||
|
|
3500a4d5ec | ||
|
|
149d07b28e | ||
|
|
e248bf3fc3 | ||
|
|
f07b692ead | ||
|
|
ebfe69535f | ||
|
|
58dbee8dee |
No files matched your search
@@ -8,6 +8,76 @@ This is the log of notable changes to EAS CLI and related packages.
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Add `-e` as a shortcut for `--profile` flag. ([#1342](https://github.com/expo/eas-cli/pull/1342) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
- Support JSON5 in **eas.json**. ([#1350](https://github.com/expo/eas-cli/pull/1350) by [@dsokal](https://github.com/dsokal))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
### 🧹 Chores
|
||||
|
||||
## [2.1.0](https://github.com/expo/eas-cli/releases/tag/v2.1.0) - 2022-09-05
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Add tvOS credentials compatibility for Adhoc and App store builds. ([#1325](https://github.com/expo/eas-cli/pull/1325) by [@quinlanj](https://github.com/quinlanj))
|
||||
- Add `eas open` command for opening project page in web browser. ([#1337](https://github.com/expo/eas-cli/pull/1337) by [@dsokal](https://github.com/dsokal))
|
||||
- Add support for buildArtifactPaths. Rename artifactPath to applicationArchivePath. ([#1321](https://github.com/expo/eas-cli/pull/1321) by [@dsokal](https://github.com/dsokal))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Fix viewing branch list when a branch has no associated platforms. ([#1326](https://github.com/expo/eas-cli/pull/1326) by [@hbiede](https://github.com/hbiede))
|
||||
- Fix description of `help` command in help prompt. ([#1341](https://github.com/expo/eas-cli/pull/1341) by [@Simek](https://github.com/Simek))
|
||||
- Resolve paths from the root when checking for gitignored values. ([#1336](https://github.com/expo/eas-cli/pull/1336) by [@wkozyra95](https://github.com/wkozyra95))
|
||||
|
||||
### 🧹 Chores
|
||||
|
||||
- Add noImplicitOverride to tsconfigs. ([#1327](https://github.com/expo/eas-cli/pull/1327) by [@wschurman](https://github.com/wschurman))
|
||||
- Fix typos. ([#1340](https://github.com/expo/eas-cli/pull/1340) by [@hbiede](https://github.com/hbiede))
|
||||
|
||||
## [2.0.0](https://github.com/expo/eas-cli/releases/tag/v2.0.0) - 2022-09-01
|
||||
|
||||
### 🛠 Breaking changes
|
||||
|
||||
- Fix typo in `cli.promptToConfigurePushNotifications` field in **eas.json**. EAS CLI will throw an error if the old field name is in **eas.json**. ([#1332](https://github.com/expo/eas-cli/pull/1332) by [@dsokal](https://github.com/dsokal))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Fix dynamic config update warning. ([#1322](https://github.com/expo/eas-cli/pull/1322) by [@wschurman](https://github.com/wschurman))
|
||||
|
||||
## [1.2.0](https://github.com/expo/eas-cli/releases/tag/v1.2.0) - 2022-08-29
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Add 2022 Apple capabilities. ([#1307](https://github.com/expo/eas-cli/pull/1307) by [@EvanBacon](https://github.com/EvanBacon))
|
||||
- Print warning when eas-cli is installed as project dependency. ([#1310](https://github.com/expo/eas-cli/pull/1310) by [@dsokal](https://github.com/dsokal))
|
||||
- Add eas.json to skip push notifications credentials setup. ([#1315](https://github.com/expo/eas-cli/pull/1315) by [@dsokal](https://github.com/dsokal))
|
||||
- Warn about EAS outages when running `build`, `submit`, and `update` commands. ([#1312](https://github.com/expo/eas-cli/pull/1312) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Replace promptToCreateProjectIfNotExistsAsync with getProjectIdAsync. ([#1303](https://github.com/expo/eas-cli/pull/1303) by [@wschurman](https://github.com/wschurman))
|
||||
- Use AppQuery instead of ProjectQuery. ([#1304](https://github.com/expo/eas-cli/pull/1304) by [@wschurman](https://github.com/wschurman))
|
||||
|
||||
### 🧹 Chores
|
||||
|
||||
- Improve instructions on setting `extra.eas.projectId` in app configuration. ([#1316](https://github.com/expo/eas-cli/pull/1316) by [@dsokal](https://github.com/dsokal))
|
||||
- Improve copy in EAS Submit - "e-mail" -> email, and make the link to app on App Store go directly to the TestFlight tab. ([#1318](https://github.com/expo/eas-cli/pull/1318) by [@brentvatne](https://github.com/brentvatne))
|
||||
|
||||
## [1.1.1](https://github.com/expo/eas-cli/releases/tag/v1.1.1) - 2022-08-23
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Add support for `autoIncrement` option at the root of the build profile. ([#1298](https://github.com/expo/eas-cli/pull/1298) by [@szdziedzic](https://github.com/szdziedzic))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Handle trailing backslash in `.gitignore`. ([#1306](https://github.com/expo/eas-cli/pull/1306) by [@wkozyra95](https://github.com/wkozyra95))
|
||||
- Retry ASC Api Key downloads if it has not fully propagated on Apple's infrastructure. ([#1302](https://github.com/expo/eas-cli/pull/1302) by [@quinlanj](https://github.com/quinlanj))
|
||||
|
||||
## [1.1.0](https://github.com/expo/eas-cli/releases/tag/v1.1.0) - 2022-08-23
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Add support for passing platform flag to `credentials` command. ([#1277](https://github.com/expo/eas-cli/pull/1277) by [@Simek](https://github.com/Simek))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"version": "1.1.0"
|
||||
"version": "2.1.0"
|
||||
}
|
||||
+86
-49
@@ -19,6 +19,28 @@ npm install -g eas-cli
|
||||
yarn global add eas-cli
|
||||
```
|
||||
|
||||
## Enforcing eas-cli version for your project
|
||||
|
||||
If you want to enforce the `eas-cli` version for your project, use the `"cli.version"` field in **eas.json**. Installing `eas-cli` to your project dependencies is strongly discouraged because it may cause dependency conflicts that are difficult to debug.
|
||||
|
||||
An example of **eas.json** that enforces `eas-cli` in version `1.0.0` or newer:
|
||||
|
||||
```json
|
||||
{
|
||||
"cli": {
|
||||
"version": ">=1.0.0"
|
||||
},
|
||||
"build": {
|
||||
// build profiles
|
||||
},
|
||||
"submit": {
|
||||
// submit profiles
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Learn more: https://docs.expo.dev/build-reference/eas-json/
|
||||
|
||||
# Usage
|
||||
|
||||
```sh
|
||||
@@ -69,6 +91,7 @@ eas --help COMMAND
|
||||
* [`eas logout`](#eas-logout)
|
||||
* [`eas metadata:pull`](#eas-metadatapull)
|
||||
* [`eas metadata:push`](#eas-metadatapush)
|
||||
* [`eas open`](#eas-open)
|
||||
* [`eas project:info`](#eas-projectinfo)
|
||||
* [`eas project:init`](#eas-projectinit)
|
||||
* [`eas secret:create`](#eas-secretcreate)
|
||||
@@ -102,7 +125,7 @@ ALIASES
|
||||
$ eas login
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/account/login.ts)_
|
||||
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/account/login.ts)_
|
||||
|
||||
## `eas account:logout`
|
||||
|
||||
@@ -119,7 +142,7 @@ ALIASES
|
||||
$ eas logout
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/account/logout.ts)_
|
||||
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/account/logout.ts)_
|
||||
|
||||
## `eas account:view`
|
||||
|
||||
@@ -136,7 +159,7 @@ ALIASES
|
||||
$ eas whoami
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/account/view.ts)_
|
||||
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/account/view.ts)_
|
||||
|
||||
## `eas analytics [STATUS]`
|
||||
|
||||
@@ -150,7 +173,7 @@ DESCRIPTION
|
||||
display or change analytics settings
|
||||
```
|
||||
|
||||
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/analytics.ts)_
|
||||
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/analytics.ts)_
|
||||
|
||||
## `eas autocomplete [SHELL]`
|
||||
|
||||
@@ -199,7 +222,7 @@ DESCRIPTION
|
||||
create a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/branch/create.ts)_
|
||||
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/branch/create.ts)_
|
||||
|
||||
## `eas branch:delete [NAME]`
|
||||
|
||||
@@ -219,7 +242,7 @@ DESCRIPTION
|
||||
delete a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/branch/delete.ts)_
|
||||
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/branch/delete.ts)_
|
||||
|
||||
## `eas branch:list`
|
||||
|
||||
@@ -240,7 +263,7 @@ DESCRIPTION
|
||||
list all branches
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/branch/list.ts)_
|
||||
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/branch/list.ts)_
|
||||
|
||||
## `eas branch:rename`
|
||||
|
||||
@@ -259,7 +282,7 @@ DESCRIPTION
|
||||
rename a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/branch/rename.ts)_
|
||||
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/branch/rename.ts)_
|
||||
|
||||
## `eas branch:view [NAME]`
|
||||
|
||||
@@ -283,7 +306,7 @@ DESCRIPTION
|
||||
view a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/branch/view.ts)_
|
||||
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/branch/view.ts)_
|
||||
|
||||
## `eas build`
|
||||
|
||||
@@ -313,7 +336,7 @@ DESCRIPTION
|
||||
start a build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/build/index.ts)_
|
||||
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/build/index.ts)_
|
||||
|
||||
## `eas build:cancel [BUILD_ID]`
|
||||
|
||||
@@ -327,7 +350,7 @@ DESCRIPTION
|
||||
cancel a build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/build/cancel.ts)_
|
||||
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/build/cancel.ts)_
|
||||
|
||||
## `eas build:configure`
|
||||
|
||||
@@ -344,7 +367,7 @@ DESCRIPTION
|
||||
configure the project to support EAS Build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/build/configure.ts)_
|
||||
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/build/configure.ts)_
|
||||
|
||||
## `eas build:inspect`
|
||||
|
||||
@@ -379,7 +402,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/v1.1.0/packages/eas-cli/src/commands/build/inspect.ts)_
|
||||
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/build/inspect.ts)_
|
||||
|
||||
## `eas build:list`
|
||||
|
||||
@@ -412,7 +435,7 @@ DESCRIPTION
|
||||
list all builds for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/build/list.ts)_
|
||||
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/build/list.ts)_
|
||||
|
||||
## `eas build:submit`
|
||||
|
||||
@@ -459,7 +482,7 @@ DESCRIPTION
|
||||
Update version of an app.
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v1.1.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.1.0/packages/eas-cli/src/commands/build/version/set.ts)_
|
||||
|
||||
## `eas build:version:sync`
|
||||
|
||||
@@ -478,7 +501,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/v1.1.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.1.0/packages/eas-cli/src/commands/build/version/sync.ts)_
|
||||
|
||||
## `eas build:view [BUILD_ID]`
|
||||
|
||||
@@ -495,7 +518,7 @@ DESCRIPTION
|
||||
view a build for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/build/view.ts)_
|
||||
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/build/view.ts)_
|
||||
|
||||
## `eas channel:create [NAME]`
|
||||
|
||||
@@ -515,7 +538,7 @@ DESCRIPTION
|
||||
create a channel
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/channel/create.ts)_
|
||||
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/channel/create.ts)_
|
||||
|
||||
## `eas channel:edit [NAME]`
|
||||
|
||||
@@ -536,7 +559,7 @@ DESCRIPTION
|
||||
point a channel at a new branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/channel/edit.ts)_
|
||||
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/channel/edit.ts)_
|
||||
|
||||
## `eas channel:list`
|
||||
|
||||
@@ -553,7 +576,7 @@ DESCRIPTION
|
||||
list all channels
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/channel/list.ts)_
|
||||
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/channel/list.ts)_
|
||||
|
||||
## `eas channel:view [NAME]`
|
||||
|
||||
@@ -573,7 +596,7 @@ DESCRIPTION
|
||||
view a channel
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/channel/view.ts)_
|
||||
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/channel/view.ts)_
|
||||
|
||||
## `eas config`
|
||||
|
||||
@@ -591,7 +614,7 @@ DESCRIPTION
|
||||
display project configuration (app.json + eas.json)
|
||||
```
|
||||
|
||||
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/config.ts)_
|
||||
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/config.ts)_
|
||||
|
||||
## `eas credentials`
|
||||
|
||||
@@ -608,7 +631,7 @@ DESCRIPTION
|
||||
manage credentials
|
||||
```
|
||||
|
||||
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/credentials.ts)_
|
||||
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/credentials.ts)_
|
||||
|
||||
## `eas device:create`
|
||||
|
||||
@@ -622,7 +645,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/v1.1.0/packages/eas-cli/src/commands/device/create.ts)_
|
||||
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/device/create.ts)_
|
||||
|
||||
## `eas device:delete`
|
||||
|
||||
@@ -640,7 +663,7 @@ DESCRIPTION
|
||||
remove a registered device from your account
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/device/delete.ts)_
|
||||
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/device/delete.ts)_
|
||||
|
||||
## `eas device:list`
|
||||
|
||||
@@ -657,7 +680,7 @@ DESCRIPTION
|
||||
list all registered devices for your account
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/device/list.ts)_
|
||||
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/device/list.ts)_
|
||||
|
||||
## `eas device:view [UDID]`
|
||||
|
||||
@@ -671,7 +694,7 @@ DESCRIPTION
|
||||
view a device for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/device/view.ts)_
|
||||
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/device/view.ts)_
|
||||
|
||||
## `eas diagnostics`
|
||||
|
||||
@@ -685,11 +708,11 @@ DESCRIPTION
|
||||
display environment info
|
||||
```
|
||||
|
||||
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/diagnostics.ts)_
|
||||
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/diagnostics.ts)_
|
||||
|
||||
## `eas help [COMMAND]`
|
||||
|
||||
Display help for eas.
|
||||
display help for eas-cli
|
||||
|
||||
```
|
||||
USAGE
|
||||
@@ -702,10 +725,10 @@ FLAGS
|
||||
-n, --nested-commands Include all nested commands in the output.
|
||||
|
||||
DESCRIPTION
|
||||
Display help for eas.
|
||||
display help for eas-cli
|
||||
```
|
||||
|
||||
_See code: [@expo/plugin-help](https://github.com/expo/oclif-plugin-help/blob/v5.2.0/src/commands/help.ts)_
|
||||
_See code: [@expo/plugin-help](https://github.com/expo/oclif-plugin-help/blob/v5.3.0/src/commands/help.ts)_
|
||||
|
||||
## `eas init`
|
||||
|
||||
@@ -767,7 +790,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/v1.1.0/packages/eas-cli/src/commands/metadata/pull.ts)_
|
||||
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/metadata/pull.ts)_
|
||||
|
||||
## `eas metadata:push`
|
||||
|
||||
@@ -784,7 +807,21 @@ DESCRIPTION
|
||||
sync the local store configuration to the app stores
|
||||
```
|
||||
|
||||
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/metadata/push.ts)_
|
||||
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/metadata/push.ts)_
|
||||
|
||||
## `eas open`
|
||||
|
||||
open the project page in a web browser
|
||||
|
||||
```
|
||||
USAGE
|
||||
$ eas open
|
||||
|
||||
DESCRIPTION
|
||||
open the project page in a web browser
|
||||
```
|
||||
|
||||
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/open.ts)_
|
||||
|
||||
## `eas project:info`
|
||||
|
||||
@@ -798,7 +835,7 @@ DESCRIPTION
|
||||
information about the current project
|
||||
```
|
||||
|
||||
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/project/info.ts)_
|
||||
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/project/info.ts)_
|
||||
|
||||
## `eas project:init`
|
||||
|
||||
@@ -815,7 +852,7 @@ ALIASES
|
||||
$ eas init
|
||||
```
|
||||
|
||||
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/project/init.ts)_
|
||||
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/project/init.ts)_
|
||||
|
||||
## `eas secret:create`
|
||||
|
||||
@@ -835,7 +872,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/v1.1.0/packages/eas-cli/src/commands/secret/create.ts)_
|
||||
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/secret/create.ts)_
|
||||
|
||||
## `eas secret:delete`
|
||||
|
||||
@@ -852,7 +889,7 @@ DESCRIPTION
|
||||
delete an environment secret by ID
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/secret/delete.ts)_
|
||||
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/secret/delete.ts)_
|
||||
|
||||
## `eas secret:list`
|
||||
|
||||
@@ -866,7 +903,7 @@ DESCRIPTION
|
||||
list environment secrets available for your current app
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/secret/list.ts)_
|
||||
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/secret/list.ts)_
|
||||
|
||||
## `eas submit`
|
||||
|
||||
@@ -896,7 +933,7 @@ ALIASES
|
||||
$ eas build:submit
|
||||
```
|
||||
|
||||
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/submit.ts)_
|
||||
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/submit.ts)_
|
||||
|
||||
## `eas update`
|
||||
|
||||
@@ -926,7 +963,7 @@ DESCRIPTION
|
||||
publish an update group
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/update/index.ts)_
|
||||
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/update/index.ts)_
|
||||
|
||||
## `eas update:configure`
|
||||
|
||||
@@ -943,7 +980,7 @@ DESCRIPTION
|
||||
configure the project to support EAS Update
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/update/configure.ts)_
|
||||
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/update/configure.ts)_
|
||||
|
||||
## `eas update:delete GROUPID`
|
||||
|
||||
@@ -963,7 +1000,7 @@ DESCRIPTION
|
||||
delete all the updates in an update group
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/update/delete.ts)_
|
||||
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/update/delete.ts)_
|
||||
|
||||
## `eas update:list`
|
||||
|
||||
@@ -982,7 +1019,7 @@ DESCRIPTION
|
||||
view the recent updates for a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/update/list.ts)_
|
||||
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/update/list.ts)_
|
||||
|
||||
## `eas update:view GROUPID`
|
||||
|
||||
@@ -1002,7 +1039,7 @@ DESCRIPTION
|
||||
update group details
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/update/view.ts)_
|
||||
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/update/view.ts)_
|
||||
|
||||
## `eas webhook:create`
|
||||
|
||||
@@ -1022,7 +1059,7 @@ DESCRIPTION
|
||||
create a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/webhook/create.ts)_
|
||||
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/webhook/create.ts)_
|
||||
|
||||
## `eas webhook:delete [ID]`
|
||||
|
||||
@@ -1039,7 +1076,7 @@ DESCRIPTION
|
||||
delete a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/webhook/delete.ts)_
|
||||
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/webhook/delete.ts)_
|
||||
|
||||
## `eas webhook:list`
|
||||
|
||||
@@ -1056,7 +1093,7 @@ DESCRIPTION
|
||||
list webhooks
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/webhook/list.ts)_
|
||||
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/webhook/list.ts)_
|
||||
|
||||
## `eas webhook:update`
|
||||
|
||||
@@ -1077,7 +1114,7 @@ DESCRIPTION
|
||||
update a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/webhook/update.ts)_
|
||||
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/webhook/update.ts)_
|
||||
|
||||
## `eas webhook:view ID`
|
||||
|
||||
@@ -1094,7 +1131,7 @@ DESCRIPTION
|
||||
view a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v1.1.0/packages/eas-cli/src/commands/webhook/view.ts)_
|
||||
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v2.1.0/packages/eas-cli/src/commands/webhook/view.ts)_
|
||||
|
||||
## `eas whoami`
|
||||
|
||||
|
||||
Generated
+1447
-50
File diff suppressed because it is too large.
Load diff
@@ -1,27 +1,27 @@
|
||||
{
|
||||
"name": "eas-cli",
|
||||
"description": "EAS command line tool",
|
||||
"version": "1.1.0",
|
||||
"version": "2.1.0",
|
||||
"author": "Expo <[email protected]>",
|
||||
"bin": {
|
||||
"eas": "./bin/run"
|
||||
},
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"dependencies": {
|
||||
"@expo/apple-utils": "0.0.0-alpha.33",
|
||||
"@expo/apple-utils": "0.0.0-alpha.34",
|
||||
"@expo/code-signing-certificates": "0.0.2",
|
||||
"@expo/config": "7.0.1",
|
||||
"@expo/config-plugins": "5.0.1",
|
||||
"@expo/config-types": "46.0.2",
|
||||
"@expo/eas-build-job": "0.2.85",
|
||||
"@expo/eas-json": "1.0.0",
|
||||
"@expo/eas-build-job": "0.2.90",
|
||||
"@expo/eas-json": "2.1.0",
|
||||
"@expo/json-file": "8.2.36",
|
||||
"@expo/multipart-body-parser": "1.1.0",
|
||||
"@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.2.0",
|
||||
"@expo/plugin-help": "5.3.0",
|
||||
"@expo/plugin-warn-if-update-available": "2.3.0",
|
||||
"@expo/prebuild-config": "5.0.3",
|
||||
"@expo/results": "1.0.0",
|
||||
@@ -32,6 +32,7 @@
|
||||
"@urql/core": "2.6.1",
|
||||
"@urql/exchange-retry": "0.3.3",
|
||||
"ajv": "^6.12.6",
|
||||
"better-opn": "3.0.2",
|
||||
"chalk": "4.1.2",
|
||||
"cli-progress": "3.11.2",
|
||||
"cli-table3": "0.6.2",
|
||||
|
||||
@@ -15,6 +15,9 @@ export enum SubmissionEvent {
|
||||
SUBMIT_REQUEST_ATTEMPT = 'submit cli request attempt',
|
||||
SUBMIT_REQUEST_SUCCESS = 'submit cli request success',
|
||||
SUBMIT_REQUEST_FAIL = 'submit cli request fail',
|
||||
API_KEY_DOWNLOAD_FAIL = 'submit cli credentials api key download fail',
|
||||
API_KEY_DOWNLOAD_RETRY = 'submit cli credentials api key download fail temporary',
|
||||
API_KEY_DOWNLOAD_SUCCESS = 'submit cli credentials api key download succeed',
|
||||
}
|
||||
|
||||
export enum BuildEvent {
|
||||
|
||||
@@ -4,7 +4,7 @@ import fetch, { RequestError, RequestInit } from './fetch';
|
||||
import { getAccessToken, getSessionSecret } from './user/sessionStorage';
|
||||
|
||||
export class ApiV2Error extends Error {
|
||||
readonly name = 'ApiV2Error';
|
||||
override readonly name = 'ApiV2Error';
|
||||
readonly expoApiV2ErrorCode: string;
|
||||
readonly expoApiV2ErrorDetails?: JSONValue;
|
||||
readonly expoApiV2ErrorServerStack?: string;
|
||||
|
||||
@@ -89,16 +89,21 @@ function renderPageOfBranches(
|
||||
});
|
||||
|
||||
table.push(
|
||||
...currentPage.map(branch => [
|
||||
branch.name,
|
||||
formatUpdate(branch.updates[0]),
|
||||
branch.updates[0]?.runtimeVersion ?? 'N/A',
|
||||
branch.updates[0]?.group ?? 'N/A',
|
||||
getPlatformsForGroup({
|
||||
updates: branch.updates,
|
||||
group: branch.updates[0]?.group,
|
||||
}),
|
||||
])
|
||||
...currentPage.map(branch => {
|
||||
const update: UpdateBranchFragment['updates'][0] | undefined = branch.updates[0];
|
||||
return [
|
||||
branch.name,
|
||||
formatUpdate(update),
|
||||
update?.runtimeVersion ?? 'N/A',
|
||||
update?.group ?? 'N/A',
|
||||
update?.group
|
||||
? getPlatformsForGroup({
|
||||
updates: branch.updates,
|
||||
group: update.group,
|
||||
})
|
||||
: 'N/A',
|
||||
];
|
||||
})
|
||||
);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
|
||||
@@ -73,17 +73,17 @@ describe(bumpVersionAsync, () => {
|
||||
|
||||
await bumpVersionAsync({
|
||||
bumpStrategy: BumpStrategy.VERSION_CODE,
|
||||
projectDir: '/repo',
|
||||
projectDir: '/app',
|
||||
exp: fakeExp,
|
||||
});
|
||||
|
||||
const appJSON = await fs.readJSON('/repo/app.json');
|
||||
const appJSON = await fs.readJSON('/app/app.json');
|
||||
expect(fakeExp.version).toBe('3.0.0');
|
||||
expect(fakeExp.android?.versionCode).toBe(124);
|
||||
expect(appJSON.expo.version).toBe('3.0.0');
|
||||
expect(appJSON.expo.android.versionCode).toBe(124);
|
||||
|
||||
const buildGradle = await getAppBuildGradleAsync('/repo');
|
||||
const buildGradle = await getAppBuildGradleAsync('/app');
|
||||
assert(buildGradle);
|
||||
expect(resolveConfigValue(buildGradle, 'versionCode')).toBe('124');
|
||||
expect(resolveConfigValue(buildGradle, 'versionName')).toBe('3.0.0');
|
||||
@@ -95,17 +95,17 @@ describe(bumpVersionAsync, () => {
|
||||
|
||||
await bumpVersionAsync({
|
||||
bumpStrategy: BumpStrategy.APP_VERSION,
|
||||
projectDir: '/repo',
|
||||
projectDir: '/app',
|
||||
exp: fakeExp,
|
||||
});
|
||||
|
||||
const appJSON = await fs.readJSON('/repo/app.json');
|
||||
const appJSON = await fs.readJSON('/app/app.json');
|
||||
expect(fakeExp.version).toBe('3.0.1');
|
||||
expect(fakeExp.android?.versionCode).toBe(123);
|
||||
expect(appJSON.expo.version).toBe('3.0.1');
|
||||
expect(appJSON.expo.android.versionCode).toBe(123);
|
||||
|
||||
const buildGradle = await getAppBuildGradleAsync('/repo');
|
||||
const buildGradle = await getAppBuildGradleAsync('/app');
|
||||
assert(buildGradle);
|
||||
expect(resolveConfigValue(buildGradle, 'versionCode')).toBe('123');
|
||||
expect(resolveConfigValue(buildGradle, 'versionName')).toBe('3.0.1');
|
||||
@@ -116,17 +116,17 @@ describe(bumpVersionAsync, () => {
|
||||
|
||||
await bumpVersionAsync({
|
||||
bumpStrategy: BumpStrategy.NOOP,
|
||||
projectDir: '/repo',
|
||||
projectDir: '/app',
|
||||
exp: fakeExp,
|
||||
});
|
||||
|
||||
const appJSON = await fs.readJSON('/repo/app.json');
|
||||
const appJSON = await fs.readJSON('/app/app.json');
|
||||
expect(fakeExp.version).toBe('3.0.0');
|
||||
expect(fakeExp.android?.versionCode).toBe(123);
|
||||
expect(appJSON.expo.version).toBe('3.0.0');
|
||||
expect(appJSON.expo.android.versionCode).toBe(123);
|
||||
|
||||
const buildGradle = await getAppBuildGradleAsync('/repo');
|
||||
const buildGradle = await getAppBuildGradleAsync('/app');
|
||||
assert(buildGradle);
|
||||
expect(resolveConfigValue(buildGradle, 'versionCode')).toBe('123');
|
||||
expect(resolveConfigValue(buildGradle, 'versionName')).toBe('3.0.0');
|
||||
@@ -140,11 +140,11 @@ describe(bumpVersionInAppJsonAsync, () => {
|
||||
|
||||
await bumpVersionInAppJsonAsync({
|
||||
bumpStrategy: BumpStrategy.VERSION_CODE,
|
||||
projectDir: '/repo',
|
||||
projectDir: '/app',
|
||||
exp: fakeExp,
|
||||
});
|
||||
|
||||
const appJSON = await fs.readJSON('/repo/app.json');
|
||||
const appJSON = await fs.readJSON('/app/app.json');
|
||||
expect(fakeExp.version).toBe('5.0.0');
|
||||
expect(fakeExp.android?.versionCode).toBe(127);
|
||||
expect(appJSON.expo.version).toBe('5.0.0');
|
||||
@@ -156,11 +156,11 @@ describe(bumpVersionInAppJsonAsync, () => {
|
||||
|
||||
await bumpVersionInAppJsonAsync({
|
||||
bumpStrategy: BumpStrategy.APP_VERSION,
|
||||
projectDir: '/repo',
|
||||
projectDir: '/app',
|
||||
exp: fakeExp,
|
||||
});
|
||||
|
||||
const appJSON = await fs.readJSON('/repo/app.json');
|
||||
const appJSON = await fs.readJSON('/app/app.json');
|
||||
expect(fakeExp.version).toBe('5.0.1');
|
||||
expect(fakeExp.android?.versionCode).toBe(126);
|
||||
expect(appJSON.expo.version).toBe('5.0.1');
|
||||
@@ -172,11 +172,11 @@ describe(bumpVersionInAppJsonAsync, () => {
|
||||
|
||||
await bumpVersionInAppJsonAsync({
|
||||
bumpStrategy: BumpStrategy.NOOP,
|
||||
projectDir: '/repo',
|
||||
projectDir: '/app',
|
||||
exp: fakeExp,
|
||||
});
|
||||
|
||||
const appJSON = await fs.readJSON('/repo/app.json');
|
||||
const appJSON = await fs.readJSON('/app/app.json');
|
||||
expect(fakeExp.version).toBe('5.0.0');
|
||||
expect(fakeExp.android?.versionCode).toBe(126);
|
||||
expect(appJSON.expo.version).toBe('5.0.0');
|
||||
@@ -189,7 +189,7 @@ describe(maybeResolveVersionsAsync, () => {
|
||||
it('reads the versions from native code', async () => {
|
||||
const exp = initBareWorkflowProject();
|
||||
const { appVersion, appBuildVersion } = await maybeResolveVersionsAsync(
|
||||
'/repo',
|
||||
'/app',
|
||||
exp,
|
||||
{} as BuildProfile<Platform.ANDROID>
|
||||
);
|
||||
@@ -201,7 +201,7 @@ describe(maybeResolveVersionsAsync, () => {
|
||||
it('reads the versions from expo config', async () => {
|
||||
const exp = initManagedProject();
|
||||
const { appVersion, appBuildVersion } = await maybeResolveVersionsAsync(
|
||||
'/repo',
|
||||
'/app',
|
||||
exp,
|
||||
{} as BuildProfile<Platform.ANDROID>
|
||||
);
|
||||
@@ -240,7 +240,7 @@ function initBareWorkflowProject({
|
||||
}`,
|
||||
'./android/app/src/main/AndroidManifest.xml': 'fake',
|
||||
},
|
||||
'/repo'
|
||||
'/app'
|
||||
);
|
||||
|
||||
return fakeExp;
|
||||
@@ -261,7 +261,7 @@ function initManagedProject(): ExpoConfig {
|
||||
expo: fakeExp,
|
||||
}),
|
||||
},
|
||||
'/repo'
|
||||
'/app'
|
||||
);
|
||||
|
||||
return fakeExp;
|
||||
|
||||
@@ -15,7 +15,8 @@ export function transformJob(job: Android.Job): AndroidJobInput {
|
||||
cache: job.cache,
|
||||
version: job.version?.versionCode ? { versionCode: job.version.versionCode } : undefined,
|
||||
gradleCommand: job.gradleCommand,
|
||||
artifactPath: job.artifactPath,
|
||||
applicationArchivePath: job.applicationArchivePath,
|
||||
buildArtifactPaths: job.buildArtifactPaths,
|
||||
username: job.username,
|
||||
buildType: job.buildType && transformBuildType(job.buildType),
|
||||
developmentClient: job.developmentClient,
|
||||
|
||||
@@ -72,7 +72,8 @@ export async function prepareJobAsync(
|
||||
updates: { channel: ctx.buildProfile.channel },
|
||||
developmentClient: buildProfile.developmentClient,
|
||||
gradleCommand: buildProfile.gradleCommand,
|
||||
artifactPath: buildProfile.artifactPath,
|
||||
applicationArchivePath: buildProfile.applicationArchivePath ?? buildProfile.artifactPath,
|
||||
buildArtifactPaths: buildProfile.buildArtifactPaths,
|
||||
buildType,
|
||||
username,
|
||||
...(ctx.android.versionCodeOverride && {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Platform, Workflow } from '@expo/eas-build-job';
|
||||
import { EasJson, EasJsonReader } from '@expo/eas-json';
|
||||
import { EasJson, EasJsonAccessor } from '@expo/eas-json';
|
||||
import chalk from 'chalk';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
@@ -24,7 +24,7 @@ interface ConfigureParams {
|
||||
export async function ensureProjectConfiguredAsync(
|
||||
configureParams: ConfigureParams
|
||||
): Promise<boolean> {
|
||||
if (await fs.pathExists(EasJsonReader.formatEasJsonPath(configureParams.projectDir))) {
|
||||
if (await fs.pathExists(EasJsonAccessor.formatEasJsonPath(configureParams.projectDir))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ const EAS_JSON_BARE_DEFAULT: EasJson = {
|
||||
};
|
||||
|
||||
async function createEasJsonAsync(projectDir: string): Promise<void> {
|
||||
const easJsonPath = EasJsonReader.formatEasJsonPath(projectDir);
|
||||
const easJsonPath = EasJsonAccessor.formatEasJsonPath(projectDir);
|
||||
|
||||
const hasAndroidNativeProject =
|
||||
(await resolveWorkflowAsync(projectDir, Platform.ANDROID)) === Workflow.GENERIC;
|
||||
|
||||
@@ -60,6 +60,7 @@ export async function createBuildContextAsync<T extends Platform>({
|
||||
projectDir,
|
||||
user,
|
||||
env: buildProfile.env,
|
||||
easJsonCliConfig,
|
||||
});
|
||||
|
||||
const devClientProperties = getDevClientEventProperties({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Env, Ios } from '@expo/eas-build-job';
|
||||
import { Ios } from '@expo/eas-build-job';
|
||||
import nullthrows from 'nullthrows';
|
||||
|
||||
import { IosJobInput, IosJobSecretsInput } from '../../graphql/generated';
|
||||
@@ -17,7 +17,8 @@ export function transformJob(job: Ios.Job): IosJobInput {
|
||||
version: job.version?.buildNumber ? { buildNumber: job.version.buildNumber } : undefined,
|
||||
scheme: job.scheme,
|
||||
buildConfiguration: job.buildConfiguration,
|
||||
artifactPath: job.artifactPath,
|
||||
applicationArchivePath: job.applicationArchivePath,
|
||||
buildArtifactPaths: job.buildArtifactPaths,
|
||||
username: job.username,
|
||||
developmentClient: job.developmentClient,
|
||||
simulator: job.simulator,
|
||||
@@ -27,7 +28,6 @@ export function transformJob(job: Ios.Job): IosJobInput {
|
||||
|
||||
function transformIosSecrets(secrets: {
|
||||
buildCredentials?: Ios.BuildCredentials;
|
||||
env?: Env;
|
||||
}): IosJobSecretsInput {
|
||||
const buildCredentials: IosJobSecretsInput['buildCredentials'] = [];
|
||||
|
||||
@@ -43,6 +43,5 @@ function transformIosSecrets(secrets: {
|
||||
|
||||
return {
|
||||
buildCredentials,
|
||||
environmentSecrets: secrets.env,
|
||||
};
|
||||
}
|
||||
@@ -64,7 +64,9 @@ export async function prepareJobAsync(
|
||||
simulator: ctx.buildProfile.simulator,
|
||||
scheme: jobData.buildScheme,
|
||||
buildConfiguration: ctx.buildProfile.buildConfiguration,
|
||||
artifactPath: ctx.buildProfile.artifactPath,
|
||||
applicationArchivePath:
|
||||
ctx.buildProfile.applicationArchivePath ?? ctx.buildProfile.artifactPath,
|
||||
buildArtifactPaths: ctx.buildProfile.buildArtifactPaths,
|
||||
username,
|
||||
...(ctx.ios.buildNumberOverride && {
|
||||
version: {
|
||||
|
||||
@@ -3,7 +3,8 @@ import {
|
||||
AppVersionSource,
|
||||
BuildProfile,
|
||||
EasJson,
|
||||
EasJsonReader,
|
||||
EasJsonAccessor,
|
||||
EasJsonUtils,
|
||||
SubmitProfile,
|
||||
} from '@expo/eas-json';
|
||||
import chalk from 'chalk';
|
||||
@@ -94,13 +95,14 @@ export async function runBuildAndSubmitAsync(projectDir: string, flags: BuildFla
|
||||
projectDir,
|
||||
nonInteractive: flags.nonInteractive,
|
||||
});
|
||||
const easJsonReader = new EasJsonReader(projectDir);
|
||||
const easJsonCliConfig: EasJson['cli'] = (await easJsonReader.getCliConfigAsync()) ?? {};
|
||||
const easJsonAccessor = new EasJsonAccessor(projectDir);
|
||||
const easJsonCliConfig: EasJson['cli'] =
|
||||
(await EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
|
||||
|
||||
const platforms = toPlatforms(flags.requestedPlatform);
|
||||
const buildProfiles = await getProfilesAsync({
|
||||
type: 'build',
|
||||
easJsonReader,
|
||||
easJsonAccessor,
|
||||
platforms,
|
||||
profileName: flags.profile ?? undefined,
|
||||
});
|
||||
@@ -150,7 +152,7 @@ export async function runBuildAndSubmitAsync(projectDir: string, flags: BuildFla
|
||||
const submissions: SubmissionFragment[] = [];
|
||||
if (flags.autoSubmit) {
|
||||
const submitProfiles = await getProfilesAsync({
|
||||
easJsonReader,
|
||||
easJsonAccessor,
|
||||
platforms,
|
||||
profileName: flags.submitProfile,
|
||||
type: 'submit',
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
import { EasJsonReader } from '@expo/eas-json';
|
||||
import { Command } from '@oclif/core';
|
||||
import { EasJsonAccessor, EasJsonUtils } from '@expo/eas-json';
|
||||
import * as PackageManagerUtils from '@expo/package-manager';
|
||||
import { Command, Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
import fs from 'fs-extra';
|
||||
// eslint-disable-next-line no-restricted-imports
|
||||
import { Options, Ora } from 'ora';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
|
||||
import {
|
||||
@@ -8,14 +14,48 @@ import {
|
||||
initAsync as initAnalyticsAsync,
|
||||
logEvent,
|
||||
} from '../analytics/rudderstackClient';
|
||||
import Log, { learnMore } from '../log';
|
||||
import { interactiveOra, nonInteractiveOra } from '../ora';
|
||||
import { findProjectRootAsync } from '../project/projectUtils';
|
||||
import { InteractivePrompts, NonInteractivePrompts, Prompts } from '../prompts';
|
||||
import { getUserAsync } from '../user/User';
|
||||
import { ensureLoggedInAsync } from '../user/actions';
|
||||
import { easCliVersion } from '../utils/easCli';
|
||||
import { setVcsClient } from '../vcs';
|
||||
import GitClient from '../vcs/clients/git';
|
||||
|
||||
type CommandOptions =
|
||||
| {
|
||||
nonInteractive: true;
|
||||
json: true;
|
||||
}
|
||||
| {
|
||||
nonInteractive: boolean;
|
||||
json: false;
|
||||
};
|
||||
|
||||
export type CommandContext = Readonly<
|
||||
CommandOptions & {
|
||||
logger: Log;
|
||||
prompts: Prompts;
|
||||
ora: (options?: Options | string) => Ora;
|
||||
}
|
||||
>;
|
||||
|
||||
export default abstract class EasCommand extends Command {
|
||||
static override globalFlags = {
|
||||
json: Flags.boolean({
|
||||
description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
|
||||
dependsOn: ['non-interactive'],
|
||||
}),
|
||||
'non-interactive': Flags.boolean({
|
||||
description: 'Run the command in non-interactive mode.',
|
||||
}),
|
||||
};
|
||||
|
||||
// disable built in oclif json stuff
|
||||
enableJsonFlag = false;
|
||||
|
||||
/**
|
||||
* When user data is unavailable locally, determines if the command will
|
||||
* force the user to log in
|
||||
@@ -23,18 +63,35 @@ export default abstract class EasCommand extends Command {
|
||||
protected requiresAuthentication = true;
|
||||
protected mustBeRunInsideProject = true;
|
||||
|
||||
protected abstract runAsync(): Promise<any>;
|
||||
protected abstract runAsync({
|
||||
nonInteractive,
|
||||
json,
|
||||
logger,
|
||||
prompts: {
|
||||
promptAsync,
|
||||
confirmAsync,
|
||||
selectAsync,
|
||||
toggleConfirmAsync,
|
||||
pressAnyKeyToContinueAsync,
|
||||
},
|
||||
ora,
|
||||
}: CommandContext): Promise<{ jsonOutput: object }>;
|
||||
|
||||
// eslint-disable-next-line async-protect/async-suffix
|
||||
async run(): Promise<any> {
|
||||
const { flags } = await this.parse();
|
||||
const json = flags.json ?? false;
|
||||
const nonInteractive = (flags as any)['non-interactive'] ?? false;
|
||||
|
||||
await initAnalyticsAsync();
|
||||
|
||||
if (this.mustBeRunInsideProject) {
|
||||
await this.applyCliConfigAsync();
|
||||
const projectDir = await findProjectRootAsync();
|
||||
await this.applyCliConfigAsync(projectDir);
|
||||
await this.ensureEasCliIsNotInDependenciesAsync(projectDir);
|
||||
}
|
||||
|
||||
if (this.requiresAuthentication) {
|
||||
const { flags } = await this.parse();
|
||||
const nonInteractive = (flags as any)['non-interactive'] ?? false;
|
||||
await ensureLoggedInAsync({ nonInteractive });
|
||||
} else {
|
||||
await getUserAsync();
|
||||
@@ -44,19 +101,29 @@ export default abstract class EasCommand extends Command {
|
||||
// commands/submit === submit, commands/build/list === build:list
|
||||
action: `eas ${this.id}`,
|
||||
});
|
||||
return this.runAsync();
|
||||
|
||||
const jsonOutput = await this.runAsync({
|
||||
nonInteractive,
|
||||
json: json ?? false,
|
||||
logger: new Log(json),
|
||||
prompts: nonInteractive ? new InteractivePrompts() : new NonInteractivePrompts(),
|
||||
ora: nonInteractive ? nonInteractiveOra : interactiveOra,
|
||||
});
|
||||
|
||||
if (json) {
|
||||
this.printJsonOnlyOutput(jsonOutput);
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line async-protect/async-suffix
|
||||
async finally(err: Error): Promise<any> {
|
||||
override async finally(err: Error): Promise<any> {
|
||||
await flushAnalyticsAsync();
|
||||
return super.finally(err);
|
||||
}
|
||||
|
||||
private async applyCliConfigAsync(): Promise<void> {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
const easJsonReader = new EasJsonReader(projectDir);
|
||||
const config = await easJsonReader.getCliConfigAsync();
|
||||
private async applyCliConfigAsync(projectDir: string): Promise<void> {
|
||||
const easJsonAccessor = new EasJsonAccessor(projectDir);
|
||||
const config = await EasJsonUtils.getCliConfigAsync(easJsonAccessor);
|
||||
if (config?.version && !semver.satisfies(easCliVersion, config.version)) {
|
||||
throw new Error(
|
||||
`You are on eas-cli@${easCliVersion} which does not satisfy the CLI version constraint in eas.json (${config.version})`
|
||||
@@ -66,4 +133,72 @@ export default abstract class EasCommand extends Command {
|
||||
setVcsClient(new GitClient());
|
||||
}
|
||||
}
|
||||
|
||||
private async ensureEasCliIsNotInDependenciesAsync(projectDir: string): Promise<void> {
|
||||
let printCliVersionWarning = false;
|
||||
|
||||
const consoleWarn = (msg?: string): void => {
|
||||
if (msg) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(chalk.yellow(msg));
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn();
|
||||
}
|
||||
};
|
||||
|
||||
if (await this.isEasCliInDependenciesAsync(projectDir)) {
|
||||
printCliVersionWarning = true;
|
||||
consoleWarn(`Found ${chalk.bold('eas-cli')} in your project dependencies.`);
|
||||
}
|
||||
|
||||
const maybeRepoRoot = PackageManagerUtils.findWorkspaceRoot(projectDir) ?? projectDir;
|
||||
if (maybeRepoRoot !== projectDir && (await this.isEasCliInDependenciesAsync(maybeRepoRoot))) {
|
||||
printCliVersionWarning = true;
|
||||
consoleWarn(`Found ${chalk.bold('eas-cli')} in your monorepo dependencies.`);
|
||||
}
|
||||
|
||||
if (printCliVersionWarning) {
|
||||
consoleWarn(
|
||||
`It's recommended to use the ${chalk.bold(
|
||||
'"cli.version"'
|
||||
)} field in eas.json to enforce the ${chalk.bold('eas-cli')} version for your project.`
|
||||
);
|
||||
consoleWarn(
|
||||
learnMore('https://github.com/expo/eas-cli#enforcing-eas-cli-version-for-your-project')
|
||||
);
|
||||
consoleWarn();
|
||||
}
|
||||
}
|
||||
|
||||
private async isEasCliInDependenciesAsync(dir: string): Promise<boolean> {
|
||||
const packageJsonPath = path.join(dir, 'package.json');
|
||||
const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
|
||||
return (
|
||||
packageJson?.dependencies?.['eas-cli'] !== undefined ||
|
||||
packageJson?.devDependencies?.['eas-cli'] !== undefined
|
||||
);
|
||||
}
|
||||
|
||||
private printJsonOnlyOutput(value: object): void {
|
||||
try {
|
||||
new Log(false).log(JSON.stringify(this.sanitizeValue(value), null, 2));
|
||||
} catch {}
|
||||
}
|
||||
|
||||
private sanitizeValue(value: any): unknown {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map(val => this.sanitizeValue(val));
|
||||
} else if (value && typeof value === 'object') {
|
||||
const result: Record<string, any> = {};
|
||||
Object.keys(value).forEach(key => {
|
||||
if (key !== '__typename' && value[key] !== null) {
|
||||
result[key] = this.sanitizeValue(value[key]);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
} else {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ beforeEach(() => {
|
||||
|
||||
const createTestEasCommand = (authValue: boolean): typeof EasCommand => {
|
||||
class TestEasCommand extends EasCommand {
|
||||
requiresAuthentication = authValue;
|
||||
override requiresAuthentication = authValue;
|
||||
|
||||
async runAsync(): Promise<void> {}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
import { Flags } from '@oclif/core';
|
||||
|
||||
export const getPaginatedQueryOptions = (
|
||||
flags: Record<keyof typeof EasPaginatedQueryFlags, any>
|
||||
): PaginatedQueryOptions => {
|
||||
export const getPaginatedQueryOptions = (flags: {
|
||||
json: boolean;
|
||||
'non-interactive': boolean;
|
||||
offset: number | undefined;
|
||||
limit: number | undefined;
|
||||
}): PaginatedQueryOptions => {
|
||||
return {
|
||||
json: flags.json ?? false,
|
||||
json: flags.json,
|
||||
offset: flags.offset ?? 0,
|
||||
nonInteractive: flags['non-interactive'] ?? false,
|
||||
nonInteractive: flags['non-interactive'],
|
||||
...('limit' in flags && { limit: flags.limit }),
|
||||
};
|
||||
};
|
||||
@@ -40,12 +43,6 @@ export const EasPaginatedQueryFlags = {
|
||||
// eslint-disable-next-line async-protect/async-suffix
|
||||
parse: async input => parseFlagInputStringAsInteger(input, 'limit', 1, 100),
|
||||
}),
|
||||
json: Flags.boolean({
|
||||
description: 'Enable JSON output, non-JSON messages will be printed to stderr.',
|
||||
}),
|
||||
'non-interactive': Flags.boolean({
|
||||
description: 'Run the command in non-interactive mode.',
|
||||
}),
|
||||
};
|
||||
|
||||
// options required to control a paginated query
|
||||
|
||||
@@ -3,11 +3,11 @@ import Log from '../../log';
|
||||
import { showLoginPromptAsync } from '../../user/actions';
|
||||
|
||||
export default class AccountLogin extends EasCommand {
|
||||
static description = 'log in with your Expo account';
|
||||
static aliases = ['login'];
|
||||
static override description = 'log in with your Expo account';
|
||||
static override aliases = ['login'];
|
||||
|
||||
protected mustBeRunInsideProject = false;
|
||||
protected requiresAuthentication = false;
|
||||
protected override mustBeRunInsideProject = false;
|
||||
protected override requiresAuthentication = false;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
await showLoginPromptAsync();
|
||||
|
||||
@@ -3,11 +3,11 @@ import Log from '../../log';
|
||||
import { logoutAsync } from '../../user/User';
|
||||
|
||||
export default class AccountLogout extends EasCommand {
|
||||
static description = 'log out';
|
||||
static aliases = ['logout'];
|
||||
static override description = 'log out';
|
||||
static override aliases = ['logout'];
|
||||
|
||||
protected mustBeRunInsideProject = false;
|
||||
protected requiresAuthentication = false;
|
||||
protected override mustBeRunInsideProject = false;
|
||||
protected override requiresAuthentication = false;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
await logoutAsync();
|
||||
|
||||
@@ -5,11 +5,11 @@ import Log from '../../log';
|
||||
import { getActorDisplayName, getUserAsync } from '../../user/User';
|
||||
|
||||
export default class AccountView extends EasCommand {
|
||||
static description = 'show the username you are logged in as';
|
||||
static aliases = ['whoami'];
|
||||
static override description = 'show the username you are logged in as';
|
||||
static override aliases = ['whoami'];
|
||||
|
||||
protected mustBeRunInsideProject = false;
|
||||
protected requiresAuthentication = false;
|
||||
protected override mustBeRunInsideProject = false;
|
||||
protected override requiresAuthentication = false;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const user = await getUserAsync();
|
||||
|
||||
@@ -3,11 +3,11 @@ import Log from '../log';
|
||||
import UserSettings from '../user/UserSettings';
|
||||
|
||||
export default class AnalyticsView extends EasCommand {
|
||||
static description = 'display or change analytics settings';
|
||||
static override description = 'display or change analytics settings';
|
||||
|
||||
static args = [{ name: 'STATUS', options: ['on', 'off'] }];
|
||||
static override args = [{ name: 'STATUS', options: ['on', 'off'] }];
|
||||
|
||||
protected requiresAuthentication = false;
|
||||
protected override requiresAuthentication = false;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { STATUS: status } = (await this.parse(AnalyticsView)).args;
|
||||
|
||||
@@ -52,9 +52,9 @@ export async function createUpdateBranchOnAppAsync({
|
||||
}
|
||||
|
||||
export default class BranchCreate extends EasCommand {
|
||||
static description = 'create a branch';
|
||||
static override description = 'create a branch';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
@@ -62,7 +62,7 @@ export default class BranchCreate extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: 'return a json with the new branch ID and name.',
|
||||
default: false,
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import EasCommand, { CommandContext } from '../../commandUtils/EasCommand';
|
||||
import { graphqlClient, withErrorHandlingAsync } from '../../graphql/client';
|
||||
import {
|
||||
DeleteUpdateBranchMutation,
|
||||
@@ -11,15 +10,12 @@ import {
|
||||
GetBranchInfoQuery,
|
||||
GetBranchInfoQueryVariables,
|
||||
} from '../../graphql/generated';
|
||||
import Log from '../../log';
|
||||
import { getExpoConfig } from '../../project/expoConfig';
|
||||
import {
|
||||
findProjectRootAsync,
|
||||
getProjectFullNameAsync,
|
||||
getProjectIdAsync,
|
||||
} from '../../project/projectUtils';
|
||||
import { promptAsync, toggleConfirmAsync } from '../../prompts';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
|
||||
async function getBranchInfoAsync({
|
||||
appId,
|
||||
@@ -77,30 +73,24 @@ async function deleteBranchOnAppAsync({
|
||||
}
|
||||
|
||||
export default class BranchDelete extends EasCommand {
|
||||
static description = 'delete a branch';
|
||||
static override description = 'delete a branch';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
description: 'Name of the branch to delete',
|
||||
},
|
||||
];
|
||||
static flags = {
|
||||
json: Flags.boolean({
|
||||
description: `return JSON with the edited branch's ID and name.`,
|
||||
default: false,
|
||||
}),
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
protected async runAsync({
|
||||
nonInteractive,
|
||||
logger,
|
||||
prompts: { promptAsync, toggleConfirmAsync },
|
||||
}: CommandContext): Promise<{ jsonOutput: object }> {
|
||||
let {
|
||||
args: { name },
|
||||
flags: { json: jsonFlag },
|
||||
} = await this.parse(BranchDelete);
|
||||
if (jsonFlag) {
|
||||
enableJsonOutput();
|
||||
}
|
||||
|
||||
const projectDir = await findProjectRootAsync();
|
||||
const exp = getExpoConfig(projectDir);
|
||||
@@ -109,7 +99,7 @@ export default class BranchDelete extends EasCommand {
|
||||
|
||||
if (!name) {
|
||||
const validationMessage = 'branch name may not be empty.';
|
||||
if (jsonFlag) {
|
||||
if (nonInteractive) {
|
||||
throw new Error(validationMessage);
|
||||
}
|
||||
({ name } = await promptAsync({
|
||||
@@ -126,16 +116,16 @@ export default class BranchDelete extends EasCommand {
|
||||
throw new Error(`Could not find branch ${name} on ${fullName}`);
|
||||
}
|
||||
|
||||
if (!jsonFlag) {
|
||||
Log.addNewLineIfNone();
|
||||
Log.warn(
|
||||
`You are about to permamently delete branch: "${name}" and all of the updates published on it.` +
|
||||
if (!nonInteractive) {
|
||||
logger.addNewLineIfNone();
|
||||
logger.warn(
|
||||
`You are about to permanently delete branch: "${name}" and all of the updates published on it.` +
|
||||
`\nThis action is irreversible.`
|
||||
);
|
||||
Log.newLine();
|
||||
logger.newLine();
|
||||
const confirmed = await toggleConfirmAsync({ message: 'Are you sure you wish to proceed?' });
|
||||
if (!confirmed) {
|
||||
Log.error(`Cancelled deletion of branch: "${name}".`);
|
||||
logger.error(`Cancelled deletion of branch: "${name}".`);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
@@ -144,12 +134,10 @@ export default class BranchDelete extends EasCommand {
|
||||
branchId,
|
||||
});
|
||||
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput(deletionResult);
|
||||
} else {
|
||||
Log.withTick(
|
||||
`️Deleted branch "${name}" and all of its updates on project ${chalk.bold(fullName)}.`
|
||||
);
|
||||
}
|
||||
logger.withTick(
|
||||
`Deleted branch "${name}" and all of its updates on project ${chalk.bold(fullName)}.`
|
||||
);
|
||||
|
||||
return { jsonOutput: deletionResult };
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,9 @@ import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUt
|
||||
import { enableJsonOutput } from '../../utils/json';
|
||||
|
||||
export default class BranchList extends EasCommand {
|
||||
static description = 'list all branches';
|
||||
static override description = 'list all branches';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
...EasPaginatedQueryFlags,
|
||||
};
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
|
||||
export default class BranchPublish extends EasCommand {
|
||||
static description = 'deprecated, use "eas update"';
|
||||
static hidden = true;
|
||||
static override description = 'deprecated, use "eas update"';
|
||||
static override hidden = true;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
throw new Error(BranchPublish.description);
|
||||
|
||||
@@ -52,9 +52,9 @@ async function renameUpdateBranchOnAppAsync({
|
||||
}
|
||||
|
||||
export default class BranchRename extends EasCommand {
|
||||
static description = 'rename a branch';
|
||||
static override description = 'rename a branch';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
from: Flags.string({
|
||||
description: 'current name of the branch.',
|
||||
required: false,
|
||||
|
||||
@@ -7,9 +7,9 @@ import { listAndRenderUpdatesOnBranchByNameAsync } from '../../update/queries';
|
||||
import { enableJsonOutput } from '../../utils/json';
|
||||
|
||||
export default class BranchView extends EasCommand {
|
||||
static description = 'view a branch';
|
||||
static override description = 'view a branch';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
@@ -17,7 +17,7 @@ export default class BranchView extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
...EasPaginatedQueryFlags,
|
||||
};
|
||||
|
||||
|
||||
@@ -110,9 +110,9 @@ async function ensureBuildExistsAsync(buildId: string): Promise<void> {
|
||||
}
|
||||
|
||||
export default class BuildCancel extends EasCommand {
|
||||
static description = 'cancel a build';
|
||||
static override description = 'cancel a build';
|
||||
|
||||
static args = [{ name: 'BUILD_ID' }];
|
||||
static override args = [{ name: 'BUILD_ID' }];
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { BUILD_ID: buildIdFromArg } = (await this.parse(BuildCancel)).args;
|
||||
|
||||
@@ -16,9 +16,9 @@ import { syncUpdatesConfigurationAsync as syncIosUpdatesConfigurationAsync } fro
|
||||
import { getVcsClient } from '../../vcs';
|
||||
|
||||
export default class BuildConfigure extends EasCommand {
|
||||
static description = 'configure the project to support EAS Build';
|
||||
static override description = 'configure the project to support EAS Build';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
description: 'Platform to configure',
|
||||
char: 'p',
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonAccessor, EasJsonUtils } from '@expo/eas-json';
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
import figures from 'figures';
|
||||
import path from 'path';
|
||||
|
||||
import { BuildFlags, runBuildAndSubmitAsync } from '../../build/runBuildAndSubmit';
|
||||
import { UserInputResourceClass } from '../../build/types';
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import Log from '../../log';
|
||||
import { StatuspageServiceName } from '../../graphql/generated';
|
||||
import Log, { link } from '../../log';
|
||||
import { RequestedPlatform, selectRequestedPlatformAsync } from '../../platform';
|
||||
import { findProjectRootAsync } from '../../project/projectUtils';
|
||||
import { selectAsync } from '../../prompts';
|
||||
import uniq from '../../utils/expodash/uniq';
|
||||
import { enableJsonOutput } from '../../utils/json';
|
||||
import { maybeWarnAboutEasOutagesAsync } from '../../utils/statuspageService';
|
||||
|
||||
interface RawBuildFlags {
|
||||
platform?: string;
|
||||
@@ -27,9 +35,9 @@ interface RawBuildFlags {
|
||||
}
|
||||
|
||||
export default class Build extends EasCommand {
|
||||
static description = 'start a build';
|
||||
static override description = 'start a build';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
char: 'p',
|
||||
options: ['android', 'ios', 'all'],
|
||||
@@ -47,6 +55,7 @@ export default class Build extends EasCommand {
|
||||
hidden: true,
|
||||
}),
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
helpValue: 'PROFILE_NAME',
|
||||
@@ -95,17 +104,32 @@ export default class Build extends EasCommand {
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { flags: rawFlags } = await this.parse(Build);
|
||||
|
||||
if (rawFlags.json) {
|
||||
enableJsonOutput();
|
||||
}
|
||||
const flags = await this.sanitizeFlagsAsync(rawFlags);
|
||||
const flags = this.sanitizeFlags(rawFlags);
|
||||
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
await runBuildAndSubmitAsync(projectDir, flags);
|
||||
await handleDeprecatedEasJsonAsync(projectDir, flags.nonInteractive);
|
||||
|
||||
if (!flags.localBuildOptions.enable) {
|
||||
await maybeWarnAboutEasOutagesAsync(
|
||||
flags.autoSubmit
|
||||
? [StatuspageServiceName.EasBuild, StatuspageServiceName.EasSubmit]
|
||||
: [StatuspageServiceName.EasBuild]
|
||||
);
|
||||
}
|
||||
|
||||
const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
|
||||
|
||||
await runBuildAndSubmitAsync(projectDir, flagsWithPlatform);
|
||||
}
|
||||
|
||||
private async sanitizeFlagsAsync(flags: RawBuildFlags): Promise<BuildFlags> {
|
||||
private sanitizeFlags(
|
||||
flags: RawBuildFlags
|
||||
): Omit<BuildFlags, 'requestedPlatform'> & { requestedPlatform?: RequestedPlatform } {
|
||||
const nonInteractive = flags['non-interactive'];
|
||||
if (!flags.local && flags.output) {
|
||||
Errors.error('--output is allowed only for local builds', { exit: 1 });
|
||||
@@ -117,21 +141,11 @@ export default class Build extends EasCommand {
|
||||
Errors.error('--json is allowed only when building in non-interactive mode', { exit: 1 });
|
||||
}
|
||||
|
||||
const requestedPlatform = await selectRequestedPlatformAsync(flags.platform);
|
||||
if (flags.local) {
|
||||
if (flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined) {
|
||||
// TODO: implement this
|
||||
Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
|
||||
}
|
||||
|
||||
if (requestedPlatform === RequestedPlatform.All) {
|
||||
Errors.error('Builds for multiple platforms are not supported with flag --local', {
|
||||
exit: 1,
|
||||
});
|
||||
} else if (process.platform !== 'darwin' && requestedPlatform === RequestedPlatform.Ios) {
|
||||
Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
|
||||
}
|
||||
}
|
||||
const requestedPlatform =
|
||||
flags.platform &&
|
||||
Object.values(RequestedPlatform).includes(flags.platform.toLowerCase() as RequestedPlatform)
|
||||
? (flags.platform.toLowerCase() as RequestedPlatform)
|
||||
: undefined;
|
||||
|
||||
if (flags['skip-credentials-check']) {
|
||||
Log.warnDeprecatedFlag(
|
||||
@@ -176,4 +190,105 @@ export default class Build extends EasCommand {
|
||||
message,
|
||||
};
|
||||
}
|
||||
|
||||
private async ensurePlatformSelectedAsync(
|
||||
flags: Omit<BuildFlags, 'requestedPlatform'> & { requestedPlatform?: RequestedPlatform }
|
||||
): Promise<BuildFlags> {
|
||||
const requestedPlatform = await selectRequestedPlatformAsync(flags.requestedPlatform);
|
||||
|
||||
if (flags.localBuildOptions.enable) {
|
||||
if (flags.autoSubmit) {
|
||||
// TODO: implement this
|
||||
Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
|
||||
}
|
||||
|
||||
if (requestedPlatform === RequestedPlatform.All) {
|
||||
Errors.error('Builds for multiple platforms are not supported with flag --local', {
|
||||
exit: 1,
|
||||
});
|
||||
} else if (process.platform !== 'darwin' && requestedPlatform === RequestedPlatform.Ios) {
|
||||
Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...flags,
|
||||
requestedPlatform,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async function handleDeprecatedEasJsonAsync(
|
||||
projectDir: string,
|
||||
nonInteractive: boolean
|
||||
): Promise<void> {
|
||||
const easJsonAccessor = new EasJsonAccessor(projectDir);
|
||||
const profileNames = await EasJsonUtils.getBuildProfileNamesAsync(easJsonAccessor);
|
||||
const platformAndProfileNames: [Platform, string][] = profileNames.flatMap(profileName => [
|
||||
[Platform.ANDROID, profileName],
|
||||
[Platform.IOS, profileName],
|
||||
]);
|
||||
|
||||
const deprecatedProfiles: [Platform, string][] = [];
|
||||
|
||||
for (const [platform, profileName] of platformAndProfileNames) {
|
||||
const buildProfile = await EasJsonUtils.getBuildProfileAsync(
|
||||
easJsonAccessor,
|
||||
platform,
|
||||
profileName
|
||||
);
|
||||
if (buildProfile.artifactPath) {
|
||||
deprecatedProfiles.push([platform, profileName]);
|
||||
}
|
||||
}
|
||||
|
||||
if (deprecatedProfiles.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const deprecatedProfileNames = uniq(deprecatedProfiles.map(([, profileName]) => profileName));
|
||||
Log.warn(`Some of your build profiles use deprecated field ${chalk.bold('artifactPath')}:`);
|
||||
for (const profileName of deprecatedProfileNames) {
|
||||
Log.warn(`- ${profileName}`);
|
||||
}
|
||||
Log.newLine();
|
||||
|
||||
if (nonInteractive) {
|
||||
Log.warn(
|
||||
`${figures.warning} Action required: rename ${chalk.bold('artifactPath')} to ${chalk.bold(
|
||||
'applicationArchivePath'
|
||||
)} in all of the build profiles listed above.`
|
||||
);
|
||||
Log.warn(
|
||||
`See ${link('https://docs.expo.dev/build-reference/eas-json/')} for more information.`
|
||||
);
|
||||
Log.warn(
|
||||
`This warning will become an error in a future EAS CLI release. This build will continue to use the ${chalk.bold(
|
||||
'artifactPath'
|
||||
)} setting.`
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
const rename = await selectAsync('Do you want us to handle renaming the field for you?', [
|
||||
{ title: 'Yes', value: true },
|
||||
{ title: 'No, I will edit eas.json manually (EAS CLI exits)', value: false },
|
||||
]);
|
||||
|
||||
if (!rename) {
|
||||
Errors.exit(1);
|
||||
}
|
||||
|
||||
await easJsonAccessor.readRawJsonAsync();
|
||||
for (const [platform, profileName] of deprecatedProfiles) {
|
||||
easJsonAccessor.patch(easJsonRawObject => {
|
||||
easJsonRawObject.build[profileName][platform].applicationArchivePath =
|
||||
easJsonRawObject.build[profileName][platform].artifactPath;
|
||||
delete easJsonRawObject.build[profileName][platform].artifactPath;
|
||||
return easJsonRawObject;
|
||||
});
|
||||
}
|
||||
await easJsonAccessor.writeAsync();
|
||||
|
||||
Log.withTick('Updated eas.json');
|
||||
}
|
||||
@@ -25,16 +25,17 @@ const STAGE_DESCRIPTION = `Stage of the build you want to inspect.
|
||||
post-build - builds the native project and leaves the output directory for inspection`;
|
||||
|
||||
export default class BuildInspect extends EasCommand {
|
||||
static description =
|
||||
static override description =
|
||||
'inspect the state of the project at specific build stages, useful for troubleshooting';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
char: 'p',
|
||||
options: [RequestedPlatform.Android, RequestedPlatform.Ios],
|
||||
required: true,
|
||||
}),
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
helpValue: 'PROFILE_NAME',
|
||||
|
||||
@@ -22,9 +22,9 @@ import {
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
|
||||
export default class BuildList extends EasCommand {
|
||||
static description = 'list all builds for your project';
|
||||
static override description = 'list all builds for your project';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
options: [RequestedPlatform.All, RequestedPlatform.Android, RequestedPlatform.Ios],
|
||||
}),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getRuntimeVersionNullable } from '@expo/config-plugins/build/utils/Updates';
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonReader } from '@expo/eas-json';
|
||||
import { EasJsonAccessor, EasJsonUtils } from '@expo/eas-json';
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
@@ -27,14 +27,15 @@ import {
|
||||
import { promptAsync } from '../../../prompts';
|
||||
|
||||
export default class BuildVersionSetView extends EasCommand {
|
||||
static description = 'Update version of an app.';
|
||||
static override description = 'Update version of an app.';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
char: 'p',
|
||||
options: ['android', 'ios'],
|
||||
}),
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
helpValue: 'PROFILE_NAME',
|
||||
@@ -47,9 +48,13 @@ export default class BuildVersionSetView extends EasCommand {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
const platform = await selectPlatformAsync(flags.platform);
|
||||
const easJsonReader = new EasJsonReader(projectDir);
|
||||
await ensureVersionSourceIsRemoteAsync(projectDir, easJsonReader);
|
||||
const profile = await easJsonReader.getBuildProfileAsync(platform, flags.profile ?? undefined);
|
||||
const easJsonAccessor = new EasJsonAccessor(projectDir);
|
||||
await ensureVersionSourceIsRemoteAsync(easJsonAccessor);
|
||||
const profile = await EasJsonUtils.getBuildProfileAsync(
|
||||
easJsonAccessor,
|
||||
platform,
|
||||
flags.profile ?? undefined
|
||||
);
|
||||
|
||||
const exp = getExpoConfig(projectDir, { env: profile.env });
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
import { Platform, Workflow } from '@expo/eas-build-job';
|
||||
import { BuildProfile, EasJsonReader } from '@expo/eas-json';
|
||||
import { BuildProfile, EasJsonAccessor } from '@expo/eas-json';
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
@@ -40,14 +40,16 @@ interface SyncContext<T extends Platform> {
|
||||
}
|
||||
|
||||
export default class BuildVersionSyncView extends EasCommand {
|
||||
public static description = 'Update a version in native code with a value stored on EAS servers';
|
||||
public static override description =
|
||||
'Update a version in native code with a value stored on EAS servers';
|
||||
|
||||
public static flags = {
|
||||
public static override flags = {
|
||||
platform: Flags.enum({
|
||||
char: 'p',
|
||||
options: ['android', 'ios', 'all'],
|
||||
}),
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
helpValue: 'PROFILE_NAME',
|
||||
@@ -59,13 +61,13 @@ export default class BuildVersionSyncView extends EasCommand {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
const requestedPlatform = await selectRequestedPlatformAsync(flags.platform);
|
||||
const easJsonReader = new EasJsonReader(projectDir);
|
||||
await ensureVersionSourceIsRemoteAsync(projectDir, easJsonReader);
|
||||
const easJsonAccessor = new EasJsonAccessor(projectDir);
|
||||
await ensureVersionSourceIsRemoteAsync(easJsonAccessor);
|
||||
|
||||
const platforms = toPlatforms(requestedPlatform);
|
||||
const buildProfiles = await getProfilesAsync({
|
||||
type: 'build',
|
||||
easJsonReader,
|
||||
easJsonAccessor,
|
||||
platforms,
|
||||
profileName: flags.profile ?? undefined,
|
||||
});
|
||||
|
||||
@@ -15,11 +15,11 @@ import {
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
|
||||
export default class BuildView extends EasCommand {
|
||||
static description = 'view a build for your project';
|
||||
static override description = 'view a build for your project';
|
||||
|
||||
static args = [{ name: 'BUILD_ID' }];
|
||||
static override args = [{ name: 'BUILD_ID' }];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
|
||||
}),
|
||||
|
||||
@@ -60,9 +60,9 @@ export async function createUpdateChannelOnAppAsync({
|
||||
}
|
||||
|
||||
export default class ChannelCreate extends EasCommand {
|
||||
static description = 'create a channel';
|
||||
static override description = 'create a channel';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
@@ -70,7 +70,7 @@ export default class ChannelCreate extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description:
|
||||
'print output as a JSON object with the new channel ID, name and branch mapping.',
|
||||
|
||||
@@ -21,17 +21,17 @@ import { promptAsync, toggleConfirmAsync } from '../../prompts';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
|
||||
export default class ChannelDelete extends EasCommand {
|
||||
static hidden = true;
|
||||
static description = 'Delete a channel';
|
||||
static override hidden = true;
|
||||
static override description = 'Delete a channel';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
description: 'Name of the channel to delete',
|
||||
},
|
||||
];
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: 'print output as a JSON object',
|
||||
default: false,
|
||||
@@ -85,7 +85,7 @@ export default class ChannelDelete extends EasCommand {
|
||||
if (!nonInteractiveFlag) {
|
||||
Log.addNewLineIfNone();
|
||||
Log.warn(
|
||||
`You are about to permamently delete channel: "${name}".\nThis action is irreversible.`
|
||||
`You are about to permanently delete channel: "${name}".\nThis action is irreversible.`
|
||||
);
|
||||
Log.newLine();
|
||||
const confirmed = await toggleConfirmAsync({ message: 'Are you sure you wish to proceed?' });
|
||||
|
||||
@@ -93,9 +93,9 @@ export async function updateChannelBranchMappingAsync({
|
||||
}
|
||||
|
||||
export default class ChannelEdit extends EasCommand {
|
||||
static description = 'point a channel at a new branch';
|
||||
static override description = 'point a channel at a new branch';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
@@ -103,7 +103,7 @@ export default class ChannelEdit extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
branch: Flags.string({
|
||||
description: 'Name of the branch to point to',
|
||||
}),
|
||||
|
||||
@@ -67,9 +67,9 @@ async function getAllUpdateChannelForAppAsync({
|
||||
}
|
||||
|
||||
export default class ChannelList extends EasCommand {
|
||||
static description = 'list all channels';
|
||||
static override description = 'list all channels';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: 'print output as a JSON object with the channel ID, name and branch mapping.',
|
||||
default: false,
|
||||
|
||||
@@ -304,10 +304,10 @@ async function endRolloutAsync({
|
||||
}
|
||||
|
||||
export default class ChannelRollout extends EasCommand {
|
||||
static hidden = true;
|
||||
static description = 'Rollout a new branch out to a channel incrementally.';
|
||||
static override hidden = true;
|
||||
static override description = 'Rollout a new branch out to a channel incrementally.';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'channel',
|
||||
required: true,
|
||||
@@ -315,7 +315,7 @@ export default class ChannelRollout extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
branch: Flags.string({
|
||||
description: 'branch to rollout',
|
||||
required: false,
|
||||
|
||||
@@ -138,9 +138,9 @@ export function logChannelDetails(channel: {
|
||||
}
|
||||
|
||||
export default class ChannelView extends EasCommand {
|
||||
static description = 'view a channel';
|
||||
static override description = 'view a channel';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'name',
|
||||
required: false,
|
||||
@@ -148,7 +148,7 @@ export default class ChannelView extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: 'print output as a JSON object with the channel ID, name and branch mapping.',
|
||||
default: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getProjectConfigDescription } from '@expo/config';
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { EasJsonReader } from '@expo/eas-json';
|
||||
import { EasJsonAccessor, EasJsonUtils } from '@expo/eas-json';
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
@@ -13,14 +13,19 @@ import { findProjectRootAsync } from '../project/projectUtils';
|
||||
import { selectAsync } from '../prompts';
|
||||
|
||||
export default class Config extends EasCommand {
|
||||
static description = 'display project configuration (app.json + eas.json)';
|
||||
static override description = 'display project configuration (app.json + eas.json)';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({ char: 'p', options: ['android', 'ios'] }),
|
||||
profile: Flags.string(),
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
helpValue: 'PROFILE_NAME',
|
||||
}),
|
||||
};
|
||||
|
||||
protected requiresAuthentication = false;
|
||||
protected override requiresAuthentication = false;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { flags } = await this.parse(Config);
|
||||
@@ -31,13 +36,13 @@ export default class Config extends EasCommand {
|
||||
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
const reader = new EasJsonReader(projectDir);
|
||||
const accessor = new EasJsonAccessor(projectDir);
|
||||
const profileName =
|
||||
maybeProfile ??
|
||||
(await selectAsync(
|
||||
'Select build profile',
|
||||
(
|
||||
await reader.getBuildProfileNamesAsync()
|
||||
await EasJsonUtils.getBuildProfileNamesAsync(accessor)
|
||||
).map(profileName => ({
|
||||
title: profileName,
|
||||
value: profileName,
|
||||
@@ -56,7 +61,7 @@ export default class Config extends EasCommand {
|
||||
},
|
||||
]));
|
||||
|
||||
const profile = await reader.getBuildProfileAsync(platform, profileName);
|
||||
const profile = await EasJsonUtils.getBuildProfileAsync(accessor, platform, profileName);
|
||||
const config = getExpoConfig(projectDir, { env: profile.env, isPublicConfig: true });
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
|
||||
@@ -4,9 +4,9 @@ import EasCommand from '../commandUtils/EasCommand';
|
||||
import { SelectPlatform } from '../credentials/manager/SelectPlatform';
|
||||
|
||||
export default class Credentials extends EasCommand {
|
||||
static description = 'manage credentials';
|
||||
static override description = 'manage credentials';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({ char: 'p', options: ['android', 'ios'] }),
|
||||
};
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import DeviceManager from '../../devices/manager';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
|
||||
export default class DeviceCreate extends EasCommand {
|
||||
static description = 'register new Apple Devices to use for internal distribution';
|
||||
static override description = 'register new Apple Devices to use for internal distribution';
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const user = await ensureLoggedInAsync();
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Device, DeviceStatus } from '@expo/apple-utils';
|
||||
import { Flags } from '@oclif/core';
|
||||
import assert from 'assert';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import EasCommand, { CommandContext } from '../../commandUtils/EasCommand';
|
||||
import { chooseDevicesToDeleteAsync } from '../../credentials/ios/actions/DeviceUtils';
|
||||
import { AppleDeviceMutation } from '../../credentials/ios/api/graphql/mutations/AppleDeviceMutation';
|
||||
import {
|
||||
@@ -14,21 +14,18 @@ import { AppleTeamQuery } from '../../credentials/ios/api/graphql/queries/AppleT
|
||||
import { authenticateAsync, getRequestContext } from '../../credentials/ios/appstore/authenticate';
|
||||
import formatDevice from '../../devices/utils/formatDevice';
|
||||
import { AppleDevice, Maybe } from '../../graphql/generated';
|
||||
import Log from '../../log';
|
||||
import { ora } from '../../ora';
|
||||
import { getExpoConfig } from '../../project/expoConfig';
|
||||
import { findProjectRootAsync, getProjectAccountNameAsync } from '../../project/projectUtils';
|
||||
import { promptAsync, toggleConfirmAsync } from '../../prompts';
|
||||
|
||||
export default class DeviceDelete extends EasCommand {
|
||||
static description = 'remove a registered device from your account';
|
||||
static override description = 'remove a registered device from your account';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
'apple-team-id': Flags.string(),
|
||||
udid: Flags.string({ multiple: true }),
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
protected async runAsync(commandContext: CommandContext): Promise<{ jsonOutput: object }> {
|
||||
let {
|
||||
flags: { 'apple-team-id': appleTeamIdentifier, udid: udids },
|
||||
} = await this.parse(DeviceDelete);
|
||||
@@ -38,46 +35,61 @@ export default class DeviceDelete extends EasCommand {
|
||||
const accountName = await getProjectAccountNameAsync(exp);
|
||||
|
||||
if (!appleTeamIdentifier) {
|
||||
appleTeamIdentifier = await this.askForAppleTeamAsync(accountName);
|
||||
if (commandContext.nonInteractive) {
|
||||
throw new Error('Must supply `apple-team-id` in non-interactive mode');
|
||||
}
|
||||
appleTeamIdentifier = await this.askForAppleTeamAsync(commandContext, accountName);
|
||||
}
|
||||
|
||||
assert(appleTeamIdentifier, 'No team identifier is specified');
|
||||
|
||||
const appleDevicesResult = await this.getDevicesForTeamAsync(accountName, appleTeamIdentifier);
|
||||
const appleDevicesResult = await this.getDevicesForTeamAsync(
|
||||
commandContext,
|
||||
accountName,
|
||||
appleTeamIdentifier
|
||||
);
|
||||
|
||||
if (!appleDevicesResult) {
|
||||
return;
|
||||
return { jsonOutput: [] };
|
||||
}
|
||||
|
||||
const { appleTeamName, appleDevices } = appleDevicesResult;
|
||||
|
||||
const chosenDevices = await this.chooseDevicesToDeleteAsync(appleDevices, udids);
|
||||
const chosenDevices = await this.chooseDevicesToDeleteAsync(
|
||||
commandContext,
|
||||
appleDevices,
|
||||
udids
|
||||
);
|
||||
|
||||
if (chosenDevices.length === 0) {
|
||||
Log.newLine();
|
||||
Log.warn('No devices were chosen to be removed.');
|
||||
return;
|
||||
commandContext.logger.newLine();
|
||||
commandContext.logger.warn('No devices were chosen to be removed.');
|
||||
return { jsonOutput: [] };
|
||||
}
|
||||
|
||||
this.logChosenDevices(chosenDevices, appleTeamName, appleTeamIdentifier);
|
||||
|
||||
const hasRemoved = await this.askAndRemoveFromExpoAsync(chosenDevices);
|
||||
this.logChosenDevices(commandContext, chosenDevices, appleTeamName, appleTeamIdentifier);
|
||||
|
||||
const hasRemoved = await this.askAndRemoveFromExpoAsync(commandContext, chosenDevices);
|
||||
if (!hasRemoved) {
|
||||
return;
|
||||
return { jsonOutput: [] };
|
||||
}
|
||||
|
||||
await this.askAndDisableOnAppleAsync(chosenDevices, appleTeamIdentifier);
|
||||
await this.askAndDisableOnAppleAsync(commandContext, chosenDevices, appleTeamIdentifier);
|
||||
|
||||
return { jsonOutput: chosenDevices.map(it => it.id) };
|
||||
}
|
||||
|
||||
async askAndDisableOnAppleAsync(
|
||||
{ nonInteractive, logger, prompts: { toggleConfirmAsync }, ora }: CommandContext,
|
||||
chosenDevices: (AppleDevice | AppleDeviceQueryResult)[],
|
||||
appleTeamIdentifier: string
|
||||
): Promise<void> {
|
||||
Log.newLine();
|
||||
const deleteOnApple = await toggleConfirmAsync({
|
||||
message: 'Do you want to disable these devices on your Apple account as well?',
|
||||
});
|
||||
logger.newLine();
|
||||
const deleteOnApple = nonInteractive
|
||||
? true
|
||||
: await toggleConfirmAsync({
|
||||
message: 'Do you want to disable these devices on your Apple account as well?',
|
||||
});
|
||||
|
||||
if (!deleteOnApple) {
|
||||
return;
|
||||
@@ -86,12 +98,13 @@ export default class DeviceDelete extends EasCommand {
|
||||
const ctx = await authenticateAsync({ teamId: appleTeamIdentifier });
|
||||
const context = getRequestContext(ctx);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
logger.addNewLineIfNone();
|
||||
const removeAppleSpinner = ora('Disabling devices on Apple').start();
|
||||
try {
|
||||
let realDevices = await Device.getAllIOSProfileDevicesAsync(context);
|
||||
realDevices = realDevices.filter(d =>
|
||||
chosenDevices.map(cd => cd.identifier).includes(d.attributes.udid)
|
||||
const chosenDeviceIdentifiers = chosenDevices.map(cd => cd.identifier);
|
||||
const allDevices = await Device.getAsync(context);
|
||||
const realDevices = allDevices.filter(d =>
|
||||
chosenDeviceIdentifiers.includes(d.attributes.udid)
|
||||
);
|
||||
|
||||
for (const device of realDevices) {
|
||||
@@ -106,18 +119,21 @@ export default class DeviceDelete extends EasCommand {
|
||||
}
|
||||
|
||||
async askAndRemoveFromExpoAsync(
|
||||
{ nonInteractive, logger, prompts: { toggleConfirmAsync }, ora }: CommandContext,
|
||||
chosenDevices: (AppleDevice | AppleDeviceQueryResult)[]
|
||||
): Promise<boolean> {
|
||||
Log.warn(
|
||||
logger.warn(
|
||||
`You are about to remove the Apple device${
|
||||
chosenDevices.length > 1 ? 's' : ''
|
||||
} listed above from your Expo account.`
|
||||
);
|
||||
Log.newLine();
|
||||
logger.newLine();
|
||||
|
||||
const confirmed = await toggleConfirmAsync({
|
||||
message: 'Are you sure you wish to proceed?',
|
||||
});
|
||||
const confirmed = nonInteractive
|
||||
? true
|
||||
: await toggleConfirmAsync({
|
||||
message: 'Are you sure you wish to proceed?',
|
||||
});
|
||||
|
||||
if (confirmed) {
|
||||
const removalSpinner = ora(`Removing Apple devices on Expo`).start();
|
||||
@@ -136,49 +152,55 @@ export default class DeviceDelete extends EasCommand {
|
||||
}
|
||||
|
||||
logChosenDevices(
|
||||
{ logger }: CommandContext,
|
||||
chosenDevices: (AppleDevice | AppleDeviceQueryResult)[],
|
||||
appleTeamName: Maybe<string> | undefined,
|
||||
appleTeamIdentifier: string
|
||||
): void {
|
||||
Log.addNewLineIfNone();
|
||||
logger.addNewLineIfNone();
|
||||
chosenDevices.forEach(device => {
|
||||
Log.log(
|
||||
logger.log(
|
||||
formatDevice(device, {
|
||||
appleTeamName,
|
||||
appleTeamIdentifier: appleTeamIdentifier!,
|
||||
})
|
||||
);
|
||||
Log.newLine();
|
||||
logger.newLine();
|
||||
});
|
||||
}
|
||||
|
||||
async chooseDevicesToDeleteAsync(
|
||||
{ nonInteractive, logger }: CommandContext,
|
||||
appleDevices: AppleDeviceQueryResult[],
|
||||
udids: string[]
|
||||
): Promise<(AppleDevice | AppleDeviceQueryResult)[]> {
|
||||
let chosenDevices: (AppleDeviceQueryResult | AppleDevice)[] = [];
|
||||
Log.newLine();
|
||||
logger.newLine();
|
||||
if (udids) {
|
||||
udids.forEach(udid => {
|
||||
const foundDevice = appleDevices.find(device => device.identifier === udid);
|
||||
if (foundDevice) {
|
||||
chosenDevices.push(foundDevice);
|
||||
} else {
|
||||
Log.warn(`No device found with UDID ${udid}.`);
|
||||
logger.warn(`No device found with UDID ${udid}.`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (chosenDevices.length === 0) {
|
||||
Log.addNewLineIfNone();
|
||||
if (nonInteractive) {
|
||||
throw new Error('Must supply `udid` paramter in non-interactive mode');
|
||||
}
|
||||
logger.addNewLineIfNone();
|
||||
chosenDevices = await chooseDevicesToDeleteAsync(appleDevices);
|
||||
Log.newLine();
|
||||
logger.newLine();
|
||||
}
|
||||
|
||||
return chosenDevices;
|
||||
}
|
||||
|
||||
async getDevicesForTeamAsync(
|
||||
{ ora }: CommandContext,
|
||||
accountName: string,
|
||||
appleTeamIdentifier: string
|
||||
): Promise<AppleDevicesByTeamIdentifierQueryResult | undefined> {
|
||||
@@ -208,7 +230,10 @@ export default class DeviceDelete extends EasCommand {
|
||||
}
|
||||
}
|
||||
|
||||
async askForAppleTeamAsync(accountName: string): Promise<string | undefined> {
|
||||
async askForAppleTeamAsync(
|
||||
{ prompts: { promptAsync }, ora }: CommandContext,
|
||||
accountName: string
|
||||
): Promise<string | undefined> {
|
||||
const teamSpinner = ora().start('Fetching the list of teams for the project…');
|
||||
|
||||
try {
|
||||
|
||||
@@ -13,9 +13,9 @@ import { findProjectRootAsync, getProjectAccountNameAsync } from '../../project/
|
||||
import { promptAsync } from '../../prompts';
|
||||
|
||||
export default class BuildList extends EasCommand {
|
||||
static description = 'list all registered devices for your account';
|
||||
static override description = 'list all registered devices for your account';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
'apple-team-id': Flags.string(),
|
||||
};
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import { getExpoConfig } from '../../project/expoConfig';
|
||||
import { findProjectRootAsync, getProjectAccountNameAsync } from '../../project/projectUtils';
|
||||
|
||||
export default class DeviceView extends EasCommand {
|
||||
static description = 'view a device for your project';
|
||||
static override description = 'view a device for your project';
|
||||
|
||||
static args = [{ name: 'UDID' }];
|
||||
static override args = [{ name: 'UDID' }];
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { UDID } = (await this.parse(DeviceView)).args;
|
||||
|
||||
@@ -8,9 +8,9 @@ import { resolveWorkflowAsync } from '../project/workflow';
|
||||
import { easCliVersion } from '../utils/easCli';
|
||||
|
||||
export default class Diagnostics extends EasCommand {
|
||||
static description = 'display environment info';
|
||||
static override description = 'display environment info';
|
||||
|
||||
protected requiresAuthentication = false;
|
||||
protected override requiresAuthentication = false;
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const info = await envinfo.run(
|
||||
|
||||
@@ -14,10 +14,11 @@ import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUt
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
|
||||
export default class MetadataPull extends EasCommand {
|
||||
static description = 'generate the local store configuration from the app stores';
|
||||
static override description = 'generate the local store configuration from the app stores';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
}),
|
||||
|
||||
@@ -12,10 +12,11 @@ import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUt
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
|
||||
export default class MetadataPush extends EasCommand {
|
||||
static description = 'sync the local store configuration to the app stores';
|
||||
static override description = 'sync the local store configuration to the app stores';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
}),
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import openBrowserAsync from 'better-opn';
|
||||
|
||||
import { getProjectDashboardUrl } from '../build/utils/url';
|
||||
import EasCommand from '../commandUtils/EasCommand';
|
||||
import { ora } from '../ora';
|
||||
import { getExpoConfig } from '../project/expoConfig';
|
||||
import {
|
||||
fetchProjectIdFromServerAsync,
|
||||
findProjectRootAsync,
|
||||
getProjectAccountName,
|
||||
} from '../project/projectUtils';
|
||||
import { ensureLoggedInAsync } from '../user/actions';
|
||||
|
||||
export default class Open extends EasCommand {
|
||||
static override description = 'open the project page in a web browser';
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
const exp = getExpoConfig(projectDir);
|
||||
|
||||
// this ensures the project exists
|
||||
await fetchProjectIdFromServerAsync(exp);
|
||||
|
||||
const user = await ensureLoggedInAsync();
|
||||
const accountName = getProjectAccountName(exp, user);
|
||||
const projectName = exp.slug;
|
||||
|
||||
const projectDashboardUrl = getProjectDashboardUrl(accountName, projectName);
|
||||
const failedMessage = `Unable to open a web browser. Project page is available at: ${projectDashboardUrl}`;
|
||||
const spinner = ora(`Opening ${projectDashboardUrl}`).start();
|
||||
try {
|
||||
const opened = await openBrowserAsync(projectDashboardUrl);
|
||||
|
||||
if (opened) {
|
||||
spinner.succeed(`Opened ${projectDashboardUrl}`);
|
||||
} else {
|
||||
spinner.fail(failedMessage);
|
||||
}
|
||||
return;
|
||||
} catch (error) {
|
||||
spinner.fail(failedMessage);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ async function projectInfoByIdAsync(appId: string): Promise<AppInfoQuery> {
|
||||
}
|
||||
|
||||
export default class ProjectInfo extends EasCommand {
|
||||
static description = 'information about the current project';
|
||||
static override description = 'information about the current project';
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
} from '../../project/projectUtils';
|
||||
|
||||
export default class ProjectInit extends EasCommand {
|
||||
static description = 'create or link an EAS project';
|
||||
static aliases = ['init'];
|
||||
static override description = 'create or link an EAS project';
|
||||
static override aliases = ['init'];
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
@@ -20,9 +20,10 @@ import { getActorDisplayName } from '../../user/User';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
|
||||
export default class EnvironmentSecretCreate extends EasCommand {
|
||||
static description = 'create an environment secret on the current project or owner account';
|
||||
static override description =
|
||||
'create an environment secret on the current project or owner account';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
scope: Flags.enum({
|
||||
description: 'Scope for the secret',
|
||||
options: [EnvironmentSecretScope.ACCOUNT, EnvironmentSecretScope.PROJECT],
|
||||
|
||||
@@ -17,9 +17,9 @@ import {
|
||||
import { promptAsync, toggleConfirmAsync } from '../../prompts';
|
||||
|
||||
export default class EnvironmentSecretDelete extends EasCommand {
|
||||
static description = 'delete an environment secret by ID';
|
||||
static override description = 'delete an environment secret by ID';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
id: Flags.string({
|
||||
description: 'ID of the secret to delete',
|
||||
}),
|
||||
@@ -60,7 +60,7 @@ export default class EnvironmentSecretDelete extends EasCommand {
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.warn(
|
||||
`You are about to permamently delete secret${
|
||||
`You are about to permanently delete secret${
|
||||
secret?.name ? ` "${secret?.name}"` : ''
|
||||
} with id: "${id}".\nThis action is irreversible.`
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from '../../project/projectUtils';
|
||||
|
||||
export default class EnvironmentSecretList extends EasCommand {
|
||||
static description = 'list environment secrets available for your current app';
|
||||
static override description = 'list environment secrets available for your current app';
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { EasJsonReader } from '@expo/eas-json';
|
||||
import { EasJsonAccessor } from '@expo/eas-json';
|
||||
import { Errors, Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import EasCommand from '../commandUtils/EasCommand';
|
||||
import { SubmissionFragment } from '../graphql/generated';
|
||||
import { StatuspageServiceName, SubmissionFragment } from '../graphql/generated';
|
||||
import { toAppPlatform } from '../graphql/types/AppPlatform';
|
||||
import Log from '../log';
|
||||
import {
|
||||
@@ -23,6 +23,7 @@ import {
|
||||
} from '../submit/submit';
|
||||
import { printSubmissionDetailsUrls } from '../submit/utils/urls';
|
||||
import { getProfilesAsync } from '../utils/profiles';
|
||||
import { maybeWarnAboutEasOutagesAsync } from '../utils/statuspageService';
|
||||
|
||||
interface RawCommandFlags {
|
||||
platform?: string;
|
||||
@@ -46,15 +47,16 @@ interface CommandFlags {
|
||||
}
|
||||
|
||||
export default class Submit extends EasCommand {
|
||||
static description = 'submit app binary to App Store and/or Play Store';
|
||||
static aliases = ['build:submit'];
|
||||
static override description = 'submit app binary to App Store and/or Play Store';
|
||||
static override aliases = ['build:submit'];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
char: 'p',
|
||||
options: ['android', 'ios', 'all'],
|
||||
}),
|
||||
profile: Flags.string({
|
||||
char: 'e',
|
||||
description:
|
||||
'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
||||
}),
|
||||
@@ -91,18 +93,23 @@ export default class Submit extends EasCommand {
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
const { flags: rawFlags } = await this.parse(Submit);
|
||||
const flags = await this.sanitizeFlagsAsync(rawFlags);
|
||||
|
||||
const flags = this.sanitizeFlags(rawFlags);
|
||||
|
||||
const projectDir = await findProjectRootAsync();
|
||||
const exp = getExpoConfig(projectDir);
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
|
||||
const platforms = toPlatforms(flags.requestedPlatform);
|
||||
await maybeWarnAboutEasOutagesAsync([StatuspageServiceName.EasSubmit]);
|
||||
|
||||
const flagsWithPlatform = await this.ensurePlatformSelectedAsync(flags);
|
||||
|
||||
const platforms = toPlatforms(flagsWithPlatform.requestedPlatform);
|
||||
const submissionProfiles = await getProfilesAsync({
|
||||
type: 'submit',
|
||||
easJsonReader: new EasJsonReader(projectDir),
|
||||
easJsonAccessor: new EasJsonAccessor(projectDir),
|
||||
platforms,
|
||||
profileName: flags.profile,
|
||||
profileName: flagsWithPlatform.profile,
|
||||
});
|
||||
|
||||
const submissions: SubmissionFragment[] = [];
|
||||
@@ -112,8 +119,8 @@ export default class Submit extends EasCommand {
|
||||
projectDir,
|
||||
projectId,
|
||||
profile: submissionProfile.profile,
|
||||
archiveFlags: flags.archiveFlags,
|
||||
nonInteractive: flags.nonInteractive,
|
||||
archiveFlags: flagsWithPlatform.archiveFlags,
|
||||
nonInteractive: flagsWithPlatform.nonInteractive,
|
||||
});
|
||||
|
||||
if (submissionProfiles.length > 1) {
|
||||
@@ -133,15 +140,17 @@ export default class Submit extends EasCommand {
|
||||
Log.newLine();
|
||||
printSubmissionDetailsUrls(submissions);
|
||||
|
||||
if (flags.wait) {
|
||||
if (flagsWithPlatform.wait) {
|
||||
const completedSubmissions = await waitToCompleteAsync(submissions, {
|
||||
verbose: flags.verbose,
|
||||
verbose: flagsWithPlatform.verbose,
|
||||
});
|
||||
exitWithNonZeroCodeIfSomeSubmissionsDidntFinish(completedSubmissions);
|
||||
}
|
||||
}
|
||||
|
||||
private async sanitizeFlagsAsync(flags: RawCommandFlags): Promise<CommandFlags> {
|
||||
private sanitizeFlags(
|
||||
flags: RawCommandFlags
|
||||
): Omit<CommandFlags, 'requestedPlatform'> & { requestedPlatform?: RequestedPlatform } {
|
||||
const {
|
||||
platform,
|
||||
verbose,
|
||||
@@ -155,15 +164,11 @@ export default class Submit extends EasCommand {
|
||||
Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
|
||||
}
|
||||
|
||||
const requestedPlatform = await selectRequestedPlatformAsync(flags.platform);
|
||||
if (requestedPlatform === RequestedPlatform.All) {
|
||||
if (archiveFlags.id || archiveFlags.path || archiveFlags.url) {
|
||||
Errors.error(
|
||||
'--id, --path, and --url params are only supported when performing a single-platform submit',
|
||||
{ exit: 1 }
|
||||
);
|
||||
}
|
||||
}
|
||||
const requestedPlatform =
|
||||
flags.platform &&
|
||||
Object.values(RequestedPlatform).includes(flags.platform.toLowerCase() as RequestedPlatform)
|
||||
? (flags.platform.toLowerCase() as RequestedPlatform)
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
archiveFlags,
|
||||
@@ -174,4 +179,24 @@ export default class Submit extends EasCommand {
|
||||
nonInteractive,
|
||||
};
|
||||
}
|
||||
|
||||
private async ensurePlatformSelectedAsync(
|
||||
flags: Omit<CommandFlags, 'requestedPlatform'> & { requestedPlatform?: RequestedPlatform }
|
||||
): Promise<CommandFlags> {
|
||||
const requestedPlatform = await selectRequestedPlatformAsync(flags.requestedPlatform);
|
||||
|
||||
if (requestedPlatform === RequestedPlatform.All) {
|
||||
if (flags.archiveFlags.id || flags.archiveFlags.path || flags.archiveFlags.url) {
|
||||
Errors.error(
|
||||
'--id, --path, and --url params are only supported when performing a single-platform submit',
|
||||
{ exit: 1 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...flags,
|
||||
requestedPlatform,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -24,9 +24,9 @@ const DEFAULT_MANAGED_RUNTIME_VERSION = { policy: 'sdkVersion' } as const;
|
||||
const DEFAULT_BARE_RUNTIME_VERSION = '1.0.0' as const;
|
||||
|
||||
export default class UpdateConfigure extends EasCommand {
|
||||
static description = 'configure the project to support EAS Update';
|
||||
static override description = 'configure the project to support EAS Update';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
platform: Flags.enum({
|
||||
description: 'Platform to configure',
|
||||
char: 'p',
|
||||
@@ -117,6 +117,7 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
exp.ios?.runtimeVersion ?? exp.runtimeVersion ?? iosDefaultRuntimeVersion;
|
||||
|
||||
let newConfig: Partial<ExpoConfig>;
|
||||
let newConfigOnlyAddedValues: Partial<ExpoConfig>;
|
||||
switch (platform) {
|
||||
case RequestedPlatform.All: {
|
||||
if (isRuntimeEqual(newAndroidRuntimeVersion, newIosRuntimeVersion)) {
|
||||
@@ -129,6 +130,26 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
ios: { ...exp.ios, runtimeVersion: undefined },
|
||||
updates,
|
||||
};
|
||||
newConfigOnlyAddedValues = {
|
||||
runtimeVersion: newAndroidRuntimeVersion,
|
||||
...(exp.android && 'runtimeVersion' in exp.android
|
||||
? {
|
||||
android: {
|
||||
runtimeVersion: '<remove this key>',
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(exp.ios && 'runtimeVersion' in exp.ios
|
||||
? {
|
||||
ios: {
|
||||
runtimeVersion: '<remove this key>',
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
updates: {
|
||||
url: easUpdateURL,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
newConfig = {
|
||||
runtimeVersion: undefined, // top level runtime is redundant if it is specified in both android and ios
|
||||
@@ -142,6 +163,22 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
},
|
||||
updates,
|
||||
};
|
||||
newConfigOnlyAddedValues = {
|
||||
...('runtimeVersion' in exp
|
||||
? {
|
||||
runtimeVersion: '<remove this key>', // top level runtime is redundant if it is specified in both android and ios
|
||||
}
|
||||
: {}),
|
||||
android: {
|
||||
runtimeVersion: newAndroidRuntimeVersion,
|
||||
},
|
||||
ios: {
|
||||
runtimeVersion: newIosRuntimeVersion,
|
||||
},
|
||||
updates: {
|
||||
url: easUpdateURL,
|
||||
},
|
||||
};
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -153,6 +190,14 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
},
|
||||
updates,
|
||||
};
|
||||
newConfigOnlyAddedValues = {
|
||||
android: {
|
||||
runtimeVersion: newAndroidRuntimeVersion,
|
||||
},
|
||||
updates: {
|
||||
url: easUpdateURL,
|
||||
},
|
||||
};
|
||||
break;
|
||||
}
|
||||
case RequestedPlatform.Ios: {
|
||||
@@ -163,6 +208,14 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
},
|
||||
updates,
|
||||
};
|
||||
newConfigOnlyAddedValues = {
|
||||
ios: {
|
||||
runtimeVersion: newIosRuntimeVersion,
|
||||
},
|
||||
updates: {
|
||||
url: easUpdateURL,
|
||||
},
|
||||
};
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@@ -172,8 +225,8 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
|
||||
const result = await modifyConfigAsync(projectDir, newConfig);
|
||||
|
||||
const prexistingAndroidRuntimeVersion = exp.android?.runtimeVersion ?? exp.runtimeVersion;
|
||||
const prexistingIosRuntimeVersion = exp.ios?.runtimeVersion ?? exp.runtimeVersion;
|
||||
const preexistingAndroidRuntimeVersion = exp.android?.runtimeVersion ?? exp.runtimeVersion;
|
||||
const preexistingIosRuntimeVersion = exp.ios?.runtimeVersion ?? exp.runtimeVersion;
|
||||
switch (result.type) {
|
||||
case 'success':
|
||||
if (exp.updates?.url) {
|
||||
@@ -187,7 +240,7 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
}
|
||||
|
||||
if (
|
||||
!prexistingAndroidRuntimeVersion &&
|
||||
!preexistingAndroidRuntimeVersion &&
|
||||
[RequestedPlatform.Android, RequestedPlatform.All].includes(platform)
|
||||
) {
|
||||
Log.withTick(
|
||||
@@ -197,7 +250,7 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
);
|
||||
}
|
||||
if (
|
||||
!prexistingIosRuntimeVersion &&
|
||||
!preexistingIosRuntimeVersion &&
|
||||
[RequestedPlatform.Ios, RequestedPlatform.All].includes(platform)
|
||||
) {
|
||||
Log.withTick(
|
||||
@@ -219,7 +272,7 @@ async function configureAppJSONForEASUpdateAsync({
|
||||
'https://expo.fyi/eas-update-config.md'
|
||||
)}\n`
|
||||
);
|
||||
Log.log(chalk.bold(JSON.stringify(newConfig, null, 2)));
|
||||
Log.log(chalk.bold(JSON.stringify(newConfigOnlyAddedValues, null, 2)));
|
||||
Log.addNewLineIfNone();
|
||||
if (workflows['android'] === Workflow.GENERIC || workflows['ios'] === Workflow.GENERIC) {
|
||||
Log.warn(
|
||||
|
||||
@@ -36,9 +36,9 @@ async function deleteUpdateGroupAsync({
|
||||
}
|
||||
|
||||
export default class UpdateDelete extends EasCommand {
|
||||
static description = 'delete all the updates in an update group';
|
||||
static override description = 'delete all the updates in an update group';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'groupId',
|
||||
required: true,
|
||||
@@ -46,7 +46,7 @@ export default class UpdateDelete extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: `Return a json with the group ID of the deleted updates.`,
|
||||
default: false,
|
||||
@@ -69,7 +69,7 @@ export default class UpdateDelete extends EasCommand {
|
||||
'This is a permanent operation.'
|
||||
)}\n\n` +
|
||||
`If you want to revert to a previous publish, you should use 'update --republish' targeted at the last working update group instead.\n\n` +
|
||||
`An update group should only be deleted in an emergency like an accidental publish of a secret. In this case user 'update --republish' to revert to the last working update group first and then proceed with the deletion. Deleting an update group when it is the latest publish can lead to inconsistent cacheing behavior by clients.\n\n` +
|
||||
`An update group should only be deleted in an emergency like an accidental publish of a secret. In this case user 'update --republish' to revert to the last working update group first and then proceed with the deletion. Deleting an update group when it is the latest publish can lead to inconsistent caching behavior by clients.\n\n` +
|
||||
`Would you like to abort?`,
|
||||
});
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
PublishUpdateGroupInput,
|
||||
Robot,
|
||||
RootQueryUpdatesByGroupArgs,
|
||||
StatuspageServiceName,
|
||||
Update,
|
||||
UpdateInfoGroup,
|
||||
UpdatePublishMutation,
|
||||
@@ -59,6 +60,7 @@ import {
|
||||
import uniqBy from '../../utils/expodash/uniqBy';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { maybeWarnAboutEasOutagesAsync } from '../../utils/statuspageService';
|
||||
import { getVcsClient } from '../../vcs';
|
||||
import { createUpdateBranchOnAppAsync } from '../branch/create';
|
||||
import { createUpdateChannelOnAppAsync } from '../channel/create';
|
||||
@@ -159,9 +161,9 @@ export async function ensureBranchExistsAsync({
|
||||
}
|
||||
|
||||
export default class UpdatePublish extends EasCommand {
|
||||
static description = 'publish an update group';
|
||||
static override description = 'publish an update group';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
branch: Flags.string({
|
||||
description: 'Branch to publish the update group on',
|
||||
required: false,
|
||||
@@ -228,6 +230,7 @@ export default class UpdatePublish extends EasCommand {
|
||||
'non-interactive': nonInteractive,
|
||||
},
|
||||
} = await this.parse(UpdatePublish);
|
||||
|
||||
if (jsonFlag) {
|
||||
enableJsonOutput();
|
||||
}
|
||||
@@ -245,6 +248,8 @@ export default class UpdatePublish extends EasCommand {
|
||||
isPublicConfig: false,
|
||||
});
|
||||
|
||||
await maybeWarnAboutEasOutagesAsync([StatuspageServiceName.EasUpdate]);
|
||||
|
||||
const codeSigningInfo = await getCodeSigningInfoAsync(expPrivate, privateKeyPath);
|
||||
|
||||
const hasExpoUpdates = isExpoUpdatesInstalledOrAvailable(projectDir, exp.sdkVersion);
|
||||
|
||||
@@ -20,9 +20,9 @@ import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { getVcsClient } from '../../vcs';
|
||||
|
||||
export default class BranchView extends EasCommand {
|
||||
static description = 'view the recent updates for a branch';
|
||||
static override description = 'view the recent updates for a branch';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
branch: Flags.string({
|
||||
description: 'List all updates on this branch',
|
||||
exclusive: ['all'],
|
||||
|
||||
@@ -51,9 +51,9 @@ export async function viewUpdateAsync({
|
||||
return data;
|
||||
}
|
||||
export default class UpdateView extends EasCommand {
|
||||
static description = 'update group details';
|
||||
static override description = 'update group details';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'groupId',
|
||||
required: true,
|
||||
@@ -61,7 +61,7 @@ export default class UpdateView extends EasCommand {
|
||||
},
|
||||
];
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
json: Flags.boolean({
|
||||
description: `Return a json with the updates belonging to the group.`,
|
||||
default: false,
|
||||
|
||||
@@ -9,9 +9,9 @@ import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUt
|
||||
import { prepareInputParamsAsync } from '../../webhooks/input';
|
||||
|
||||
export default class WebhookCreate extends EasCommand {
|
||||
static description = 'create a webhook';
|
||||
static override description = 'create a webhook';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
event: Flags.enum({
|
||||
description: 'Event type that triggers the webhook',
|
||||
options: [WebhookType.Build, WebhookType.Submit],
|
||||
|
||||
@@ -14,9 +14,9 @@ import { promptAsync, toggleConfirmAsync } from '../../prompts';
|
||||
import { formatWebhook } from '../../webhooks/formatWebhook';
|
||||
|
||||
export default class WebhookDelete extends EasCommand {
|
||||
static description = 'delete a webhook';
|
||||
static override description = 'delete a webhook';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'ID',
|
||||
required: false,
|
||||
@@ -57,7 +57,7 @@ export default class WebhookDelete extends EasCommand {
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(formatWebhook(webhook));
|
||||
Log.newLine();
|
||||
Log.warn(`You are about to permamently delete this webhook.\nThis action is irreversible.`);
|
||||
Log.warn(`You are about to permanently delete this webhook.\nThis action is irreversible.`);
|
||||
Log.newLine();
|
||||
const confirmed = await toggleConfirmAsync({
|
||||
message: 'Are you sure you wish to proceed?',
|
||||
|
||||
@@ -15,9 +15,9 @@ import {
|
||||
import { formatWebhook } from '../../webhooks/formatWebhook';
|
||||
|
||||
export default class WebhookList extends EasCommand {
|
||||
static description = 'list webhooks';
|
||||
static override description = 'list webhooks';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
event: Flags.enum({
|
||||
description: 'Event type that triggers the webhook',
|
||||
options: [WebhookType.Build, WebhookType.Submit],
|
||||
|
||||
@@ -9,9 +9,9 @@ import pick from '../../utils/expodash/pick';
|
||||
import { prepareInputParamsAsync } from '../../webhooks/input';
|
||||
|
||||
export default class WebhookUpdate extends EasCommand {
|
||||
static description = 'update a webhook';
|
||||
static override description = 'update a webhook';
|
||||
|
||||
static flags = {
|
||||
static override flags = {
|
||||
id: Flags.string({
|
||||
description: 'Webhook ID',
|
||||
required: true,
|
||||
|
||||
@@ -5,9 +5,9 @@ import { ora } from '../../ora';
|
||||
import { formatWebhook } from '../../webhooks/formatWebhook';
|
||||
|
||||
export default class WebhookView extends EasCommand {
|
||||
static description = 'view a webhook';
|
||||
static override description = 'view a webhook';
|
||||
|
||||
static args = [
|
||||
static override args = [
|
||||
{
|
||||
name: 'ID',
|
||||
required: true,
|
||||
|
||||
@@ -76,9 +76,13 @@ export const testPushKey: ApplePushKeyFragment = {
|
||||
iosAppCredentialsList: [],
|
||||
};
|
||||
|
||||
export const testTargets: Target[] = [
|
||||
{ targetName: 'testapp', bundleIdentifier: 'foo.bar.com', entitlements: {} },
|
||||
];
|
||||
export const testTarget = {
|
||||
targetName: 'testapp',
|
||||
bundleIdentifier: 'foo.bar.com',
|
||||
entitlements: {},
|
||||
};
|
||||
|
||||
export const testTargets: Target[] = [testTarget];
|
||||
|
||||
export const testProvisioningProfileFragment: AppleProvisioningProfileFragment = {
|
||||
id: 'test-prov-prof-id-1',
|
||||
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
CommonAndroidAppCredentialsFragment,
|
||||
GoogleServiceAccountKeyFragment,
|
||||
} from '../../../graphql/generated';
|
||||
import { AppQuery } from '../../../graphql/queries/AppQuery';
|
||||
import { Account } from '../../../user/Account';
|
||||
import { AppQuery } from '../../ios/api/graphql/queries/AppQuery';
|
||||
import { GoogleServiceAccountKey, KeystoreWithType } from '../credentials';
|
||||
import { AndroidAppBuildCredentialsMutation } from './graphql/mutations/AndroidAppBuildCredentialsMutation';
|
||||
import { AndroidAppCredentialsMutation } from './graphql/mutations/AndroidAppCredentialsMutation';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
import { Env } from '@expo/eas-build-job';
|
||||
import { EasJson } from '@expo/eas-json';
|
||||
import chalk from 'chalk';
|
||||
|
||||
import Log from '../log';
|
||||
@@ -19,6 +20,7 @@ export class CredentialsContext {
|
||||
public readonly nonInteractive: boolean;
|
||||
public readonly projectDir: string;
|
||||
public readonly user: Actor;
|
||||
public readonly easJsonCliConfig?: EasJson['cli'];
|
||||
|
||||
private shouldAskAuthenticateAppStore: boolean = true;
|
||||
private resolvedExp?: ExpoConfig;
|
||||
@@ -26,12 +28,14 @@ export class CredentialsContext {
|
||||
constructor(
|
||||
private options: {
|
||||
exp?: ExpoConfig;
|
||||
easJsonCliConfig?: EasJson['cli'];
|
||||
nonInteractive?: boolean;
|
||||
projectDir: string;
|
||||
user: Actor;
|
||||
env?: Env;
|
||||
}
|
||||
) {
|
||||
this.easJsonCliConfig = options.easJsonCliConfig;
|
||||
this.projectDir = options.projectDir;
|
||||
this.user = options.user;
|
||||
this.nonInteractive = options.nonInteractive ?? false;
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { Platform } from '@expo/eas-build-job';
|
||||
import { CredentialsSource, DistributionType, IosEnterpriseProvisioning } from '@expo/eas-json';
|
||||
import {
|
||||
CredentialsSource,
|
||||
DistributionType,
|
||||
EasJsonAccessor,
|
||||
IosEnterpriseProvisioning,
|
||||
} from '@expo/eas-json';
|
||||
|
||||
import { CommonIosAppCredentialsFragment } from '../../graphql/generated';
|
||||
import Log from '../../log';
|
||||
import { findApplicationTarget } from '../../project/ios/target';
|
||||
import { confirmAsync } from '../../prompts';
|
||||
import { selectAsync } from '../../prompts';
|
||||
import { CredentialsContext } from '../context';
|
||||
import * as credentialsJsonReader from '../credentialsJson/read';
|
||||
import { ensureAllTargetsAreConfigured } from '../credentialsJson/utils';
|
||||
@@ -21,6 +26,12 @@ interface Options {
|
||||
enterpriseProvisioning?: IosEnterpriseProvisioning;
|
||||
}
|
||||
|
||||
enum PushNotificationSetupOption {
|
||||
YES,
|
||||
NO,
|
||||
NO_DONT_ASK_AGAIN,
|
||||
}
|
||||
|
||||
export default class IosCredentialsProvider {
|
||||
public readonly platform = Platform.IOS;
|
||||
|
||||
@@ -89,13 +100,45 @@ export default class IosCredentialsProvider {
|
||||
return null;
|
||||
}
|
||||
|
||||
const confirmSetup = await confirmAsync({
|
||||
message: `Would you like to set up Push Notifications for your project?`,
|
||||
});
|
||||
if (!confirmSetup) {
|
||||
if (ctx.easJsonCliConfig?.promptToConfigurePushNotifications === false) {
|
||||
return null;
|
||||
}
|
||||
return await setupPushKeyAction.runAsync(ctx);
|
||||
|
||||
const setupOption = await selectAsync(
|
||||
`Would you like to set up Push Notifications for your project?`,
|
||||
[
|
||||
{ title: 'Yes', value: PushNotificationSetupOption.YES },
|
||||
{ title: 'No', value: PushNotificationSetupOption.NO },
|
||||
{
|
||||
title: `No, don't ask again (preference will be saved to eas.json)`,
|
||||
value: PushNotificationSetupOption.NO_DONT_ASK_AGAIN,
|
||||
},
|
||||
]
|
||||
);
|
||||
if (setupOption === PushNotificationSetupOption.YES) {
|
||||
return await setupPushKeyAction.runAsync(ctx);
|
||||
} else {
|
||||
if (setupOption === PushNotificationSetupOption.NO_DONT_ASK_AGAIN) {
|
||||
await this.disablePushNotificationsSetupInEasJsonAsync(ctx);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private async disablePushNotificationsSetupInEasJsonAsync(
|
||||
ctx: CredentialsContext
|
||||
): Promise<void> {
|
||||
const easJsonAccessor = new EasJsonAccessor(ctx.projectDir);
|
||||
await easJsonAccessor.readRawJsonAsync();
|
||||
easJsonAccessor.patch(easJsonRawObject => {
|
||||
easJsonRawObject.cli = {
|
||||
...easJsonRawObject?.cli,
|
||||
promptToConfigurePushNotifications: false,
|
||||
};
|
||||
return easJsonRawObject;
|
||||
});
|
||||
await easJsonAccessor.writeAsync();
|
||||
Log.withTick('Updated eas.json');
|
||||
}
|
||||
|
||||
private assertProvisioningProfileType(provisioningProfile: string, targetName?: string): void {
|
||||
|
||||
@@ -17,6 +17,7 @@ jest.mock('fs');
|
||||
jest.mock('../validators/validateProvisioningProfile', () => ({
|
||||
validateProvisioningProfileAsync: async (
|
||||
_ctx: any,
|
||||
_target: any,
|
||||
_app: any,
|
||||
buildCredentials: Partial<IosAppBuildCredentialsFragment> | null
|
||||
): Promise<boolean> => {
|
||||
|
||||
@@ -7,16 +7,19 @@ import {
|
||||
} from '../../../graphql/generated';
|
||||
import Log from '../../../log';
|
||||
import { ora } from '../../../ora';
|
||||
import { getApplePlatformFromSdkRoot } from '../../../project/ios/target';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import { MissingCredentialsNonInteractiveError } from '../../errors';
|
||||
import { AppLookupParams } from '../api/GraphqlClient';
|
||||
import { AppleProvisioningProfileMutationResult } from '../api/graphql/mutations/AppleProvisioningProfileMutation';
|
||||
import { ProvisioningProfileStoreInfo } from '../appstore/Credentials.types';
|
||||
import { AuthCtx } from '../appstore/authenticateTypes';
|
||||
import { Target } from '../types';
|
||||
|
||||
export class ConfigureProvisioningProfile {
|
||||
constructor(
|
||||
private app: AppLookupParams,
|
||||
private target: Target,
|
||||
private distributionCertificate: AppleDistributionCertificateFragment,
|
||||
private originalProvisioningProfile: AppleProvisioningProfileFragment
|
||||
) {}
|
||||
@@ -43,8 +46,10 @@ export class ConfigureProvisioningProfile {
|
||||
return null;
|
||||
}
|
||||
|
||||
const applePlatform = await getApplePlatformFromSdkRoot(this.target);
|
||||
const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(
|
||||
this.app.bundleIdentifier
|
||||
this.app.bundleIdentifier,
|
||||
applePlatform
|
||||
);
|
||||
const [matchingProfile] = profilesFromApple.filter(appleInfo =>
|
||||
developerPortalIdentifier
|
||||
|
||||
@@ -11,12 +11,14 @@ import { AppleProvisioningProfileMutationResult } from '../api/graphql/mutations
|
||||
import { ProvisioningProfile } from '../appstore/Credentials.types';
|
||||
import { AuthCtx } from '../appstore/authenticateTypes';
|
||||
import { provisioningProfileSchema } from '../credentials';
|
||||
import { Target } from '../types';
|
||||
import { resolveAppleTeamIfAuthenticatedAsync } from './AppleTeamUtils';
|
||||
import { generateProvisioningProfileAsync } from './ProvisioningProfileUtils';
|
||||
|
||||
export class CreateProvisioningProfile {
|
||||
constructor(
|
||||
private app: AppLookupParams,
|
||||
private target: Target,
|
||||
private distributionCertificate: AppleDistributionCertificateFragment
|
||||
) {}
|
||||
|
||||
@@ -63,7 +65,7 @@ export class CreateProvisioningProfile {
|
||||
this.distributionCertificate.certificatePassword,
|
||||
'Distribution Certificate must have certificate password'
|
||||
);
|
||||
return await generateProvisioningProfileAsync(ctx, this.app.bundleIdentifier, {
|
||||
return await generateProvisioningProfileAsync(ctx, this.target, this.app.bundleIdentifier, {
|
||||
certId: this.distributionCertificate.developerPortalIdentifier ?? undefined,
|
||||
certP12: this.distributionCertificate.certificateP12,
|
||||
certPassword: this.distributionCertificate.certificatePassword,
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import chalk from 'chalk';
|
||||
|
||||
import { getApplePlatformFromSdkRoot } from '../../../project/ios/target';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import {
|
||||
DistributionCertificate,
|
||||
ProvisioningProfile,
|
||||
ProvisioningProfileStoreInfo,
|
||||
} from '../appstore/Credentials.types';
|
||||
import { Target } from '../types';
|
||||
|
||||
export function formatProvisioningProfileFromApple(
|
||||
appleInfo: ProvisioningProfileStoreInfo
|
||||
@@ -20,11 +22,18 @@ export function formatProvisioningProfileFromApple(
|
||||
|
||||
export async function generateProvisioningProfileAsync(
|
||||
ctx: CredentialsContext,
|
||||
target: Target,
|
||||
bundleIdentifier: string,
|
||||
distCert: DistributionCertificate
|
||||
): Promise<ProvisioningProfile> {
|
||||
const appleAuthCtx = await ctx.appStore.ensureAuthenticatedAsync();
|
||||
const type = appleAuthCtx.team.inHouse ? 'Enterprise ' : 'AppStore';
|
||||
const profileName = `*[expo] ${bundleIdentifier} ${type} ${new Date().toISOString()}`; // Apple drops [ if its the first char (!!)
|
||||
return await ctx.appStore.createProvisioningProfileAsync(bundleIdentifier, distCert, profileName);
|
||||
const applePlatform = await getApplePlatformFromSdkRoot(target);
|
||||
return await ctx.appStore.createProvisioningProfileAsync(
|
||||
bundleIdentifier,
|
||||
distCert,
|
||||
profileName,
|
||||
applePlatform
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { ProfileType } from '@expo/apple-utils';
|
||||
import assert from 'assert';
|
||||
import chalk from 'chalk';
|
||||
import nullthrows from 'nullthrows';
|
||||
@@ -12,11 +13,14 @@ import {
|
||||
IosDistributionType,
|
||||
} from '../../../graphql/generated';
|
||||
import Log from '../../../log';
|
||||
import { getApplePlatformFromSdkRoot } from '../../../project/ios/target';
|
||||
import { confirmAsync, pressAnyKeyToContinueAsync, promptAsync } from '../../../prompts';
|
||||
import differenceBy from '../../../utils/expodash/differenceBy';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import { MissingCredentialsNonInteractiveError } from '../../errors';
|
||||
import { AppLookupParams } from '../api/GraphqlClient';
|
||||
import { ApplePlatform } from '../appstore/constants';
|
||||
import { Target } from '../types';
|
||||
import { validateProvisioningProfileAsync } from '../validators/validateProvisioningProfile';
|
||||
import { resolveAppleTeamIfAuthenticatedAsync } from './AppleTeamUtils';
|
||||
import { assignBuildCredentialsAsync, getBuildCredentialsAsync } from './BuildCredentialsUtils';
|
||||
@@ -29,12 +33,18 @@ enum ReuseAction {
|
||||
No,
|
||||
}
|
||||
|
||||
interface Options {
|
||||
app: AppLookupParams;
|
||||
target: Target;
|
||||
}
|
||||
|
||||
export class SetUpAdhocProvisioningProfile {
|
||||
constructor(private app: AppLookupParams) {}
|
||||
constructor(private options: Options) {}
|
||||
|
||||
async runAsync(ctx: CredentialsContext): Promise<IosAppBuildCredentialsFragment> {
|
||||
const { app } = this.options;
|
||||
const distCert = await new SetUpDistributionCertificate(
|
||||
this.app,
|
||||
app,
|
||||
IosDistributionType.AdHoc
|
||||
).runAsync(ctx);
|
||||
|
||||
@@ -42,7 +52,7 @@ export class SetUpAdhocProvisioningProfile {
|
||||
|
||||
if (ctx.nonInteractive) {
|
||||
if (areBuildCredentialsSetup) {
|
||||
return nullthrows(await getBuildCredentialsAsync(ctx, this.app, IosDistributionType.AdHoc));
|
||||
return nullthrows(await getBuildCredentialsAsync(ctx, app, IosDistributionType.AdHoc));
|
||||
} else {
|
||||
throw new MissingCredentialsNonInteractiveError(
|
||||
'Provisioning profile is not configured correctly. Run this command again in interactive mode.'
|
||||
@@ -52,7 +62,7 @@ export class SetUpAdhocProvisioningProfile {
|
||||
|
||||
const currentBuildCredentials = await getBuildCredentialsAsync(
|
||||
ctx,
|
||||
this.app,
|
||||
app,
|
||||
IosDistributionType.AdHoc
|
||||
);
|
||||
if (areBuildCredentialsSetup) {
|
||||
@@ -69,9 +79,11 @@ export class SetUpAdhocProvisioningProfile {
|
||||
ctx: CredentialsContext,
|
||||
distCert: AppleDistributionCertificateFragment
|
||||
): Promise<IosAppBuildCredentialsFragment> {
|
||||
const { app, target } = this.options;
|
||||
|
||||
const currentBuildCredentials = await getBuildCredentialsAsync(
|
||||
ctx,
|
||||
this.app,
|
||||
app,
|
||||
IosDistributionType.AdHoc
|
||||
);
|
||||
|
||||
@@ -80,12 +92,12 @@ export class SetUpAdhocProvisioningProfile {
|
||||
distCert.appleTeam ?? currentBuildCredentials?.provisioningProfile?.appleTeam ?? null;
|
||||
if (!appleTeam) {
|
||||
await ctx.appStore.ensureAuthenticatedAsync();
|
||||
appleTeam = await resolveAppleTeamIfAuthenticatedAsync(ctx, this.app);
|
||||
appleTeam = await resolveAppleTeamIfAuthenticatedAsync(ctx, app);
|
||||
}
|
||||
assert(appleTeam, 'Apple Team must be defined here');
|
||||
|
||||
// 2. Fetch devices registered on EAS servers
|
||||
let registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(this.app, appleTeam);
|
||||
let registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(app, appleTeam);
|
||||
if (registeredAppleDevices.length === 0) {
|
||||
const shouldRegisterDevices = await confirmAsync({
|
||||
message: `You don't have any registered devices yet. Would you like to register them now?`,
|
||||
@@ -109,16 +121,22 @@ export class SetUpAdhocProvisioningProfile {
|
||||
);
|
||||
|
||||
// 4. Reuse or create the profile on Apple Developer Portal
|
||||
const applePlatform = await getApplePlatformFromSdkRoot(target);
|
||||
const profileType =
|
||||
applePlatform === ApplePlatform.TV_OS
|
||||
? ProfileType.TVOS_APP_ADHOC
|
||||
: ProfileType.IOS_APP_ADHOC;
|
||||
const provisioningProfileStoreInfo =
|
||||
await ctx.appStore.createOrReuseAdhocProvisioningProfileAsync(
|
||||
chosenDevices.map(({ identifier }) => identifier),
|
||||
this.app.bundleIdentifier,
|
||||
distCert.serialNumber
|
||||
app.bundleIdentifier,
|
||||
distCert.serialNumber,
|
||||
profileType
|
||||
);
|
||||
|
||||
// 5. Create or update the profile on servers
|
||||
const appleAppIdentifier = await ctx.ios.createOrGetExistingAppleAppIdentifierAsync(
|
||||
this.app,
|
||||
app,
|
||||
appleTeam
|
||||
);
|
||||
let appleProvisioningProfile: AppleProvisioningProfileFragment | null = null;
|
||||
@@ -131,7 +149,7 @@ export class SetUpAdhocProvisioningProfile {
|
||||
currentBuildCredentials.provisioningProfile.id,
|
||||
]);
|
||||
appleProvisioningProfile = await ctx.ios.createProvisioningProfileAsync(
|
||||
this.app,
|
||||
app,
|
||||
appleAppIdentifier,
|
||||
{
|
||||
appleProvisioningProfile: provisioningProfileStoreInfo.provisioningProfile,
|
||||
@@ -143,7 +161,7 @@ export class SetUpAdhocProvisioningProfile {
|
||||
}
|
||||
} else {
|
||||
appleProvisioningProfile = await ctx.ios.createProvisioningProfileAsync(
|
||||
this.app,
|
||||
app,
|
||||
appleAppIdentifier,
|
||||
{
|
||||
appleProvisioningProfile: provisioningProfileStoreInfo.provisioningProfile,
|
||||
@@ -156,7 +174,7 @@ export class SetUpAdhocProvisioningProfile {
|
||||
assert(appleProvisioningProfile);
|
||||
return await assignBuildCredentialsAsync(
|
||||
ctx,
|
||||
this.app,
|
||||
app,
|
||||
IosDistributionType.AdHoc,
|
||||
distCert,
|
||||
appleProvisioningProfile,
|
||||
@@ -165,22 +183,20 @@ export class SetUpAdhocProvisioningProfile {
|
||||
}
|
||||
|
||||
private async areBuildCredentialsSetupAsync(ctx: CredentialsContext): Promise<boolean> {
|
||||
const buildCredentials = await getBuildCredentialsAsync(
|
||||
ctx,
|
||||
this.app,
|
||||
IosDistributionType.AdHoc
|
||||
);
|
||||
return await validateProvisioningProfileAsync(ctx, this.app, buildCredentials);
|
||||
const { app, target } = this.options;
|
||||
const buildCredentials = await getBuildCredentialsAsync(ctx, app, IosDistributionType.AdHoc);
|
||||
return await validateProvisioningProfileAsync(ctx, target, app, buildCredentials);
|
||||
}
|
||||
|
||||
private async shouldUseExistingProfileAsync(
|
||||
ctx: CredentialsContext,
|
||||
buildCredentials: IosAppBuildCredentialsFragment
|
||||
): Promise<boolean> {
|
||||
const { app } = this.options;
|
||||
const provisioningProfile = nullthrows(buildCredentials.provisioningProfile);
|
||||
|
||||
const appleTeam = nullthrows(provisioningProfile.appleTeam);
|
||||
const registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(this.app, appleTeam);
|
||||
const registeredAppleDevices = await ctx.ios.getDevicesForAppleTeamAsync(app, appleTeam);
|
||||
|
||||
const provisionedDevices = provisioningProfile.appleDevices;
|
||||
|
||||
@@ -254,7 +270,8 @@ export class SetUpAdhocProvisioningProfile {
|
||||
ctx: CredentialsContext,
|
||||
appleTeam: AppleTeamFragment
|
||||
): Promise<AppleDeviceFragment[]> {
|
||||
const action = new DeviceCreateAction(ctx.appStore, this.app.account, appleTeam);
|
||||
const { app } = this.options;
|
||||
const action = new DeviceCreateAction(ctx.appStore, app.account, appleTeam);
|
||||
const method = await action.runAsync();
|
||||
|
||||
while (true) {
|
||||
@@ -265,7 +282,7 @@ export class SetUpAdhocProvisioningProfile {
|
||||
}
|
||||
Log.newLine();
|
||||
|
||||
const devices = await ctx.ios.getDevicesForAppleTeamAsync(this.app, appleTeam, {
|
||||
const devices = await ctx.ios.getDevicesForAppleTeamAsync(app, appleTeam, {
|
||||
useCache: false,
|
||||
});
|
||||
if (devices.length === 0) {
|
||||
|
||||
@@ -51,6 +51,7 @@ export class SetUpBuildCredentials {
|
||||
enterpriseProvisioning: this.options.enterpriseProvisioning,
|
||||
distribution: this.options.distribution,
|
||||
entitlements: target.entitlements,
|
||||
target,
|
||||
app: {
|
||||
...this.options.app,
|
||||
bundleIdentifier: target.bundleIdentifier,
|
||||
|
||||
@@ -3,6 +3,7 @@ import Log, { learnMore } from '../../../log';
|
||||
import { promptAsync } from '../../../prompts';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import { AppLookupParams } from '../api/GraphqlClient';
|
||||
import { Target } from '../types';
|
||||
import { getAllBuildCredentialsAsync } from './BuildCredentialsUtils';
|
||||
import { SetUpAdhocProvisioningProfile } from './SetUpAdhocProvisioningProfile';
|
||||
import { SetUpProvisioningProfile } from './SetUpProvisioningProfile';
|
||||
@@ -14,11 +15,17 @@ import { SetUpProvisioningProfile } from './SetUpProvisioningProfile';
|
||||
* to choose if they want to set up an adhoc or universal distribution provisioning profile. Otherwise, always
|
||||
* set up an adhoc provisioning profile.
|
||||
*/
|
||||
|
||||
interface Options {
|
||||
app: AppLookupParams;
|
||||
target: Target;
|
||||
}
|
||||
|
||||
export class SetUpInternalProvisioningProfile {
|
||||
constructor(private app: AppLookupParams) {}
|
||||
constructor(private options: Options) {}
|
||||
|
||||
async runAsync(ctx: CredentialsContext): Promise<IosAppBuildCredentialsFragment> {
|
||||
const buildCredentials = await getAllBuildCredentialsAsync(ctx, this.app);
|
||||
const buildCredentials = await getAllBuildCredentialsAsync(ctx, this.options.app);
|
||||
|
||||
const adhocBuildCredentialsExist =
|
||||
buildCredentials.filter(
|
||||
@@ -87,15 +94,18 @@ export class SetUpInternalProvisioningProfile {
|
||||
private async setupAdhocProvisioningProfileAsync(
|
||||
ctx: CredentialsContext
|
||||
): Promise<IosAppBuildCredentialsFragment> {
|
||||
return await new SetUpAdhocProvisioningProfile(this.app).runAsync(ctx);
|
||||
const { app, target } = this.options;
|
||||
return await new SetUpAdhocProvisioningProfile({ app, target }).runAsync(ctx);
|
||||
}
|
||||
|
||||
private async setupUniversalProvisioningProfileAsync(
|
||||
ctx: CredentialsContext
|
||||
): Promise<IosAppBuildCredentialsFragment> {
|
||||
return await new SetUpProvisioningProfile(this.app, IosDistributionType.Enterprise).runAsync(
|
||||
ctx
|
||||
);
|
||||
return await new SetUpProvisioningProfile(
|
||||
this.options.app,
|
||||
this.options.target,
|
||||
IosDistributionType.Enterprise
|
||||
).runAsync(ctx);
|
||||
}
|
||||
|
||||
private async askForDistributionTypeAndSetupAsync(
|
||||
|
||||
@@ -6,11 +6,13 @@ import {
|
||||
IosAppBuildCredentialsFragment,
|
||||
IosDistributionType,
|
||||
} from '../../../graphql/generated';
|
||||
import { getApplePlatformFromSdkRoot } from '../../../project/ios/target';
|
||||
import { confirmAsync } from '../../../prompts';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import { MissingCredentialsNonInteractiveError } from '../../errors';
|
||||
import { AppLookupParams } from '../api/GraphqlClient';
|
||||
import { ProvisioningProfileStoreInfo } from '../appstore/Credentials.types';
|
||||
import { Target } from '../types';
|
||||
import { validateProvisioningProfileAsync } from '../validators/validateProvisioningProfile';
|
||||
import {
|
||||
assignBuildCredentialsAsync,
|
||||
@@ -26,11 +28,15 @@ import { SetUpDistributionCertificate } from './SetUpDistributionCertificate';
|
||||
* Sets up either APP_STORE or ENTERPRISE provisioning profiles
|
||||
*/
|
||||
export class SetUpProvisioningProfile {
|
||||
constructor(private app: AppLookupParams, private distributionType: IosDistributionType) {}
|
||||
constructor(
|
||||
private app: AppLookupParams,
|
||||
private target: Target,
|
||||
private distributionType: IosDistributionType
|
||||
) {}
|
||||
|
||||
async areBuildCredentialsSetupAsync(ctx: CredentialsContext): Promise<boolean> {
|
||||
const buildCredentials = await getBuildCredentialsAsync(ctx, this.app, this.distributionType);
|
||||
return await validateProvisioningProfileAsync(ctx, this.app, buildCredentials);
|
||||
return await validateProvisioningProfileAsync(ctx, this.target, this.app, buildCredentials);
|
||||
}
|
||||
|
||||
async assignNewAndDeleteOldProfileAsync(
|
||||
@@ -48,9 +54,11 @@ export class SetUpProvisioningProfile {
|
||||
ctx: CredentialsContext,
|
||||
distCert: AppleDistributionCertificateFragment
|
||||
): Promise<IosAppBuildCredentialsFragment> {
|
||||
const provisioningProfile = await new CreateProvisioningProfile(this.app, distCert).runAsync(
|
||||
ctx
|
||||
);
|
||||
const provisioningProfile = await new CreateProvisioningProfile(
|
||||
this.app,
|
||||
this.target,
|
||||
distCert
|
||||
).runAsync(ctx);
|
||||
return await assignBuildCredentialsAsync(
|
||||
ctx,
|
||||
this.app,
|
||||
@@ -67,6 +75,7 @@ export class SetUpProvisioningProfile {
|
||||
): Promise<IosAppBuildCredentialsFragment | null> {
|
||||
const profileConfigurator = new ConfigureProvisioningProfile(
|
||||
this.app,
|
||||
this.target,
|
||||
distCert,
|
||||
originalProvisioningProfile
|
||||
);
|
||||
@@ -105,8 +114,10 @@ export class SetUpProvisioningProfile {
|
||||
}
|
||||
|
||||
// See if the profile we have exists on the Apple Servers
|
||||
const applePlatform = await getApplePlatformFromSdkRoot(this.target);
|
||||
const existingProfiles = await ctx.appStore.listProvisioningProfilesAsync(
|
||||
this.app.bundleIdentifier
|
||||
this.app.bundleIdentifier,
|
||||
applePlatform
|
||||
);
|
||||
const currentProfileFromServer = this.getCurrentProfileStoreInfo(
|
||||
existingProfiles,
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
import Log from '../../../log';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import { AppLookupParams as GraphQLAppLookupParams } from '../api/GraphqlClient';
|
||||
import { Target } from '../types';
|
||||
import { SetUpAdhocProvisioningProfile } from './SetUpAdhocProvisioningProfile';
|
||||
import { SetUpInternalProvisioningProfile } from './SetUpInternalProvisioningProfile';
|
||||
import { SetUpProvisioningProfile } from './SetUpProvisioningProfile';
|
||||
@@ -17,6 +18,7 @@ interface Options {
|
||||
distribution: DistributionType;
|
||||
enterpriseProvisioning?: IosEnterpriseProvisioning;
|
||||
entitlements: JSONObject;
|
||||
target: Target;
|
||||
}
|
||||
export class SetUpTargetBuildCredentials {
|
||||
constructor(private options: Options) {}
|
||||
@@ -47,22 +49,25 @@ export class SetUpTargetBuildCredentials {
|
||||
async setupBuildCredentialsAsync(
|
||||
ctx: CredentialsContext
|
||||
): Promise<IosAppBuildCredentialsFragment> {
|
||||
const { app, distribution, enterpriseProvisioning } = this.options;
|
||||
const { app, distribution, enterpriseProvisioning, target } = this.options;
|
||||
if (distribution === 'internal') {
|
||||
if (enterpriseProvisioning === 'adhoc') {
|
||||
return await new SetUpAdhocProvisioningProfile(app).runAsync(ctx);
|
||||
return await new SetUpAdhocProvisioningProfile({ app, target }).runAsync(ctx);
|
||||
} else if (enterpriseProvisioning === 'universal') {
|
||||
return await new SetUpProvisioningProfile(
|
||||
app,
|
||||
target,
|
||||
GraphQLIosDistributionType.Enterprise
|
||||
).runAsync(ctx);
|
||||
} else {
|
||||
return await new SetUpInternalProvisioningProfile(app).runAsync(ctx);
|
||||
return await new SetUpInternalProvisioningProfile({ app, target }).runAsync(ctx);
|
||||
}
|
||||
} else {
|
||||
return await new SetUpProvisioningProfile(app, GraphQLIosDistributionType.AppStore).runAsync(
|
||||
ctx
|
||||
);
|
||||
return await new SetUpProvisioningProfile(
|
||||
app,
|
||||
target,
|
||||
GraphQLIosDistributionType.AppStore
|
||||
).runAsync(ctx);
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
@@ -6,6 +6,7 @@ import {
|
||||
testDistCertFragmentNoDependencies,
|
||||
testProvisioningProfile,
|
||||
testProvisioningProfileFragment,
|
||||
testTarget,
|
||||
testTargets,
|
||||
} from '../../../__tests__/fixtures-ios';
|
||||
import { MissingCredentialsNonInteractiveError } from '../../../errors';
|
||||
@@ -36,6 +37,7 @@ describe('ConfigureProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const provProfConfigurator = new ConfigureProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
testDistCertFragmentNoDependencies,
|
||||
testProvisioningProfileFragment
|
||||
);
|
||||
@@ -53,6 +55,7 @@ describe('ConfigureProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const provProfConfigurator = new ConfigureProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
testDistCertFragmentNoDependencies,
|
||||
testProvisioningProfileFragment
|
||||
);
|
||||
|
||||
+3
@@ -5,6 +5,7 @@ import { createCtxMock } from '../../../__tests__/fixtures-context';
|
||||
import {
|
||||
testDistCertFragmentNoDependencies,
|
||||
testProvisioningProfile,
|
||||
testTarget,
|
||||
testTargets,
|
||||
} from '../../../__tests__/fixtures-ios';
|
||||
import { MissingCredentialsNonInteractiveError } from '../../../errors';
|
||||
@@ -28,6 +29,7 @@ describe('CreateProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const createProvProfAction = new CreateProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
testDistCertFragmentNoDependencies
|
||||
);
|
||||
await createProvProfAction.runAsync(ctx);
|
||||
@@ -44,6 +46,7 @@ describe('CreateProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const createProvProfAction = new CreateProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
testDistCertFragmentNoDependencies
|
||||
);
|
||||
await expect(createProvProfAction.runAsync(ctx)).rejects.toThrowError(
|
||||
|
||||
+61
-30
@@ -2,6 +2,7 @@ import { IosAppBuildCredentialsFragment, IosDistributionType } from '../../../..
|
||||
import { promptAsync } from '../../../../prompts';
|
||||
import { getAppstoreMock, testAuthCtx } from '../../../__tests__/fixtures-appstore';
|
||||
import { createCtxMock } from '../../../__tests__/fixtures-context';
|
||||
import { testTarget } from '../../../__tests__/fixtures-ios';
|
||||
import { getAllBuildCredentialsAsync } from '../BuildCredentialsUtils';
|
||||
import { SetUpAdhocProvisioningProfile } from '../SetUpAdhocProvisioningProfile';
|
||||
import { SetUpInternalProvisioningProfile } from '../SetUpInternalProvisioningProfile';
|
||||
@@ -41,9 +42,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
return buildCredentials;
|
||||
});
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: false,
|
||||
@@ -72,9 +76,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
});
|
||||
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: false,
|
||||
@@ -110,9 +117,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
});
|
||||
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: false,
|
||||
@@ -141,9 +151,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
});
|
||||
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: false,
|
||||
@@ -174,9 +187,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
});
|
||||
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: false,
|
||||
@@ -205,9 +221,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
});
|
||||
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: false,
|
||||
@@ -235,9 +254,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
return buildCredentials;
|
||||
});
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: true,
|
||||
@@ -253,9 +275,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
return buildCredentials;
|
||||
});
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: true,
|
||||
@@ -269,9 +294,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
return buildCredentials;
|
||||
});
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: true,
|
||||
@@ -291,9 +319,12 @@ describe(SetUpInternalProvisioningProfile, () => {
|
||||
return buildCredentials;
|
||||
});
|
||||
const action = new SetUpInternalProvisioningProfile({
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
app: {
|
||||
account: { id: 'account-id', name: 'account-name' },
|
||||
bundleIdentifier: 'com.expo.test',
|
||||
projectName: 'testproject',
|
||||
},
|
||||
target: testTarget,
|
||||
});
|
||||
const ctx = createCtxMock({
|
||||
nonInteractive: true,
|
||||
|
||||
+6
@@ -10,6 +10,7 @@ import {
|
||||
testAppleAppIdentifierFragment,
|
||||
testCommonIosAppCredentialsFragment,
|
||||
testIosAppBuildCredentialsFragment,
|
||||
testTarget,
|
||||
testTargets,
|
||||
} from '../../../__tests__/fixtures-ios';
|
||||
import { MissingCredentialsNonInteractiveError } from '../../../errors';
|
||||
@@ -55,6 +56,7 @@ describe('SetUpProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const setupProvisioningProfileAction = new SetUpProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
IosDistributionType.AppStore
|
||||
);
|
||||
await setupProvisioningProfileAction.runAsync(ctx);
|
||||
@@ -87,6 +89,7 @@ describe('SetUpProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const setupProvisioningProfileAction = new SetUpProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
IosDistributionType.AppStore
|
||||
);
|
||||
await setupProvisioningProfileAction.runAsync(ctx);
|
||||
@@ -119,6 +122,7 @@ describe('SetUpProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const setupProvisioningProfileAction = new SetUpProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
IosDistributionType.AppStore
|
||||
);
|
||||
await setupProvisioningProfileAction.runAsync(ctx);
|
||||
@@ -147,6 +151,7 @@ describe('SetUpProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const setupProvisioningProfileAction = new SetUpProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
IosDistributionType.AppStore
|
||||
);
|
||||
await setupProvisioningProfileAction.runAsync(ctx);
|
||||
@@ -166,6 +171,7 @@ describe('SetUpProvisioningProfile', () => {
|
||||
const appLookupParams = getAppLookupParamsFromContext(ctx, findApplicationTarget(testTargets));
|
||||
const setupProvisioningProfileAction = new SetUpProvisioningProfile(
|
||||
appLookupParams,
|
||||
testTarget,
|
||||
IosDistributionType.AppStore
|
||||
);
|
||||
await expect(setupProvisioningProfileAction.runAsync(ctx)).rejects.toThrowError(
|
||||
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
IosAppBuildCredentialsFragment,
|
||||
IosDistributionType,
|
||||
} from '../../../graphql/generated';
|
||||
import { AppQuery } from '../../../graphql/queries/AppQuery';
|
||||
import { isWildcardBundleIdentifier } from '../../../project/ios/bundleIdentifier';
|
||||
import { Account } from '../../../user/Account';
|
||||
import { DistributionCertificate, PushKey } from '../appstore/Credentials.types';
|
||||
@@ -33,7 +34,6 @@ import { ApplePushKeyMutation } from './graphql/mutations/ApplePushKeyMutation';
|
||||
import { AppleTeamMutation } from './graphql/mutations/AppleTeamMutation';
|
||||
import { IosAppBuildCredentialsMutation } from './graphql/mutations/IosAppBuildCredentialsMutation';
|
||||
import { IosAppCredentialsMutation } from './graphql/mutations/IosAppCredentialsMutation';
|
||||
import { AppQuery } from './graphql/queries/AppQuery';
|
||||
import { AppStoreConnectApiKeyQuery } from './graphql/queries/AppStoreConnectApiKeyQuery';
|
||||
import { AppleAppIdentifierQuery } from './graphql/queries/AppleAppIdentifierQuery';
|
||||
import { AppleDeviceQuery } from './graphql/queries/AppleDeviceQuery';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { ProfileType } from '@expo/app-store';
|
||||
|
||||
import Log from '../../../log';
|
||||
import {
|
||||
AscApiKey,
|
||||
@@ -22,6 +24,7 @@ import {
|
||||
isUserAuthCtx,
|
||||
} from './authenticate';
|
||||
import { AuthCtx, AuthenticationMode, UserAuthCtx } from './authenticateTypes';
|
||||
import { ApplePlatform } from './constants';
|
||||
import {
|
||||
createDistributionCertificateAsync,
|
||||
listDistributionCertificatesAsync,
|
||||
@@ -129,16 +132,18 @@ export default class AppStoreApi {
|
||||
|
||||
public async listProvisioningProfilesAsync(
|
||||
bundleIdentifier: string,
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass?: ProfileClass
|
||||
): Promise<ProvisioningProfileStoreInfo[]> {
|
||||
const ctx = await this.ensureAuthenticatedAsync();
|
||||
return await listProvisioningProfilesAsync(ctx, bundleIdentifier, profileClass);
|
||||
return await listProvisioningProfilesAsync(ctx, bundleIdentifier, applePlatform, profileClass);
|
||||
}
|
||||
|
||||
public async createProvisioningProfileAsync(
|
||||
bundleIdentifier: string,
|
||||
distCert: DistributionCertificate,
|
||||
profileName: string,
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass?: ProfileClass
|
||||
): Promise<ProvisioningProfile> {
|
||||
const ctx = await this.ensureAuthenticatedAsync();
|
||||
@@ -147,29 +152,33 @@ export default class AppStoreApi {
|
||||
bundleIdentifier,
|
||||
distCert,
|
||||
profileName,
|
||||
applePlatform,
|
||||
profileClass
|
||||
);
|
||||
}
|
||||
|
||||
public async revokeProvisioningProfileAsync(
|
||||
bundleIdentifier: string,
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass?: ProfileClass
|
||||
): Promise<void> {
|
||||
const ctx = await this.ensureAuthenticatedAsync();
|
||||
return await revokeProvisioningProfileAsync(ctx, bundleIdentifier, profileClass);
|
||||
return await revokeProvisioningProfileAsync(ctx, bundleIdentifier, applePlatform, profileClass);
|
||||
}
|
||||
|
||||
public async createOrReuseAdhocProvisioningProfileAsync(
|
||||
udids: string[],
|
||||
bundleIdentifier: string,
|
||||
distCertSerialNumber: string
|
||||
distCertSerialNumber: string,
|
||||
profileType: ProfileType
|
||||
): Promise<ProvisioningProfile> {
|
||||
const ctx = await this.ensureAuthenticatedAsync();
|
||||
return await createOrReuseAdhocProvisioningProfileAsync(
|
||||
ctx,
|
||||
udids,
|
||||
bundleIdentifier,
|
||||
distCertSerialNumber
|
||||
distCertSerialNumber,
|
||||
profileType
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,21 +1,5 @@
|
||||
import { UserRole } from '@expo/apple-utils';
|
||||
|
||||
export interface Device {
|
||||
id: string;
|
||||
teamId: string;
|
||||
identifier: string;
|
||||
name?: string;
|
||||
model?: string;
|
||||
deviceClass?: DeviceClass;
|
||||
softwareVersion?: string;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export enum DeviceClass {
|
||||
IPHONE = 'iphone',
|
||||
IPAD = 'ipad',
|
||||
}
|
||||
|
||||
export interface DistributionCertificateStoreInfo {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { ApiKey, ApiKeyType, UserRole } from '@expo/apple-utils';
|
||||
import { ApiKey, ApiKeyType, UnexpectedResponse, UserRole } from '@expo/apple-utils';
|
||||
|
||||
import {
|
||||
createAscApiKeyAsync,
|
||||
downloadWithRetryAsync,
|
||||
getAscApiKeyAsync,
|
||||
listAscApiKeysAsync,
|
||||
revokeAscApiKeyAsync,
|
||||
} from '../ascApiKey';
|
||||
import { getRequestContext } from '../authenticate';
|
||||
|
||||
jest.mock('@expo/apple-utils');
|
||||
jest.mock('../authenticate');
|
||||
jest.mock('../../../../ora');
|
||||
|
||||
@@ -96,3 +96,38 @@ test(`revokeAscApiKeyAsync`, async () => {
|
||||
expect(mockApiKey.revokeAsync).toBeCalled();
|
||||
expect(result).toEqual(mockAscApiKeyInfo);
|
||||
});
|
||||
|
||||
test(`downloadWithRetryAsync`, async () => {
|
||||
const cacheFailureMessage = `The specified resource does not exist - There is no resource of type 'apiKeys' with id 'TEST-ID'`;
|
||||
|
||||
// complete failure
|
||||
const mockApiKeyWithDownloadError = {
|
||||
...mockApiKey,
|
||||
downloadAsync: jest.fn(() => {
|
||||
throw new UnexpectedResponse(cacheFailureMessage);
|
||||
}),
|
||||
} as unknown as ApiKey;
|
||||
await expect(
|
||||
downloadWithRetryAsync(mockApiKeyWithDownloadError, { minTimeout: 1 }) // stay within jest timeout window
|
||||
).rejects.toThrowError(cacheFailureMessage);
|
||||
// expect to try once and retry 3 times = 4 total
|
||||
expect(mockApiKeyWithDownloadError.downloadAsync as jest.Mock).toBeCalledTimes(7);
|
||||
|
||||
// one time failure
|
||||
const mockApiKeyWithOneTimeDownloadError = mockApiKey as unknown as ApiKey;
|
||||
(mockApiKeyWithOneTimeDownloadError.downloadAsync as jest.Mock).mockClear();
|
||||
(mockApiKeyWithOneTimeDownloadError.downloadAsync as jest.Mock).mockImplementationOnce(() => {
|
||||
throw new UnexpectedResponse(cacheFailureMessage);
|
||||
});
|
||||
const keyP8AfterOneFailure = await downloadWithRetryAsync(mockApiKeyWithOneTimeDownloadError, {
|
||||
minTimeout: 1,
|
||||
});
|
||||
expect(keyP8AfterOneFailure).toBe('super secret');
|
||||
|
||||
// successful case
|
||||
(mockApiKey.downloadAsync as jest.Mock).mockClear();
|
||||
const keyP8NoFailure = await downloadWithRetryAsync(mockApiKeyWithOneTimeDownloadError, {
|
||||
minTimeout: 1,
|
||||
});
|
||||
expect(keyP8NoFailure).toBe('super secret');
|
||||
});
|
||||
+169
-28
@@ -94,6 +94,30 @@ describe(syncCapabilitiesForEntitlementsAsync, () => {
|
||||
'com.apple.security.application-groups': [
|
||||
'group.CY-A5149AC2-49FC-11E7-B3F3-0335A16FFB8D.com.cydia.Extender',
|
||||
],
|
||||
|
||||
'com.apple.developer.fileprovider.testing-mode': true,
|
||||
'com.apple.developer.healthkit.recalibrate-estimates': true,
|
||||
'com.apple.developer.maps': true,
|
||||
'com.apple.developer.user-management': true,
|
||||
'com.apple.developer.networking.custom-protocol': true,
|
||||
'com.apple.developer.system-extension.install': true,
|
||||
'com.apple.developer.push-to-talk': true,
|
||||
'com.apple.developer.driverkit.transport.usb': true,
|
||||
'com.apple.developer.kernel.increased-memory-limit': true,
|
||||
'com.apple.developer.driverkit.communicates-with-drivers': true,
|
||||
'com.apple.developer.media-device-discovery-extension': true,
|
||||
'com.apple.developer.driverkit.allow-third-party-userclients': true,
|
||||
'com.apple.developer.weatherkit': true,
|
||||
'com.apple.developer.on-demand-install-capable': true,
|
||||
'com.apple.developer.driverkit.family.scsicontroller': true,
|
||||
'com.apple.developer.driverkit.family.serial': true,
|
||||
'com.apple.developer.driverkit.family.networking': true,
|
||||
'com.apple.developer.driverkit.family.hid.eventservice': true,
|
||||
'com.apple.developer.driverkit.family.hid.device': true,
|
||||
'com.apple.developer.driverkit': true,
|
||||
'com.apple.developer.driverkit.transport.hid': true,
|
||||
'com.apple.developer.driverkit.family.audio': true,
|
||||
'com.apple.developer.shared-with-you': true,
|
||||
});
|
||||
|
||||
expect(bundleId.updateBundleIdCapabilityAsync).toBeCalledWith([
|
||||
@@ -135,36 +159,153 @@ describe(syncCapabilitiesForEntitlementsAsync, () => {
|
||||
},
|
||||
{ capabilityType: 'AUTOFILL_CREDENTIAL_PROVIDER', option: 'ON' },
|
||||
{ capabilityType: 'APP_GROUPS', option: 'ON' },
|
||||
{
|
||||
capabilityType: 'FILEPROVIDER_TESTINGMODE',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'HEALTHKIT_RECALIBRATE_ESTIMATES',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'MAPS',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'USER_MANAGEMENT',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'NETWORK_CUSTOM_PROTOCOL',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'SYSTEM_EXTENSION_INSTALL',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'PUSH_TO_TALK',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_USBTRANSPORT_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'INCREASED_MEMORY_LIMIT',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_COMMUNICATESWITHDRIVERS',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'MEDIA_DEVICE_DISCOVERY',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_ALLOWTHIRDPARTY_USERCLIENTS',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'WEATHERKIT',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'ONDEMANDINSTALL_EXTENSIONS',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_FAMILY_SCSICONTROLLER_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_FAMILY_SERIAL_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_FAMILY_NETWORKING_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_FAMILY_HIDEVENTSERVICE_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_FAMILY_HIDDEVICE_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_PUBLIC',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_TRANSPORT_HID_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'DRIVERKIT_FAMILY_AUDIO_PUB',
|
||||
option: 'ON',
|
||||
},
|
||||
{
|
||||
capabilityType: 'SHARED_WITH_YOU',
|
||||
option: 'ON',
|
||||
},
|
||||
]);
|
||||
|
||||
expect(results.enabled).toStrictEqual([
|
||||
'HealthKit',
|
||||
'Apple Pay Payment Processing',
|
||||
'iCloud',
|
||||
'ClassKit',
|
||||
'Data Protection',
|
||||
'Network Extensions',
|
||||
'Personal VPN',
|
||||
'Hotspot',
|
||||
'Extended Virtual Address Space',
|
||||
'HomeKit',
|
||||
'Multipath',
|
||||
'Wireless Accessory Configuration',
|
||||
'Inter-App Audio',
|
||||
'Wallet',
|
||||
'Fonts',
|
||||
'App Attest',
|
||||
'NFC Tag Reading',
|
||||
'Sign In with Apple',
|
||||
'SiriKit',
|
||||
'Access WiFi Information',
|
||||
'Communication Notifications',
|
||||
'Time Sensitive Notifications',
|
||||
'Group Activities',
|
||||
'Family Controls',
|
||||
'AutoFill Credential Provider',
|
||||
'App Groups',
|
||||
]);
|
||||
expect(results.enabled).toMatchInlineSnapshot(`
|
||||
Array [
|
||||
"HealthKit",
|
||||
"Apple Pay Payment Processing",
|
||||
"iCloud",
|
||||
"ClassKit",
|
||||
"Data Protection",
|
||||
"Network Extensions",
|
||||
"Personal VPN",
|
||||
"Hotspot",
|
||||
"Extended Virtual Address Space",
|
||||
"HomeKit",
|
||||
"Multipath",
|
||||
"Wireless Accessory Configuration",
|
||||
"Inter-App Audio",
|
||||
"Wallet",
|
||||
"Fonts",
|
||||
"App Attest",
|
||||
"NFC Tag Reading",
|
||||
"Sign In with Apple",
|
||||
"SiriKit",
|
||||
"Access WiFi Information",
|
||||
"Communication Notifications",
|
||||
"Time Sensitive Notifications",
|
||||
"Group Activities",
|
||||
"Family Controls",
|
||||
"AutoFill Credential Provider",
|
||||
"App Groups",
|
||||
"FileProvider TestingMode",
|
||||
"Recalibrate Estimates",
|
||||
"Maps",
|
||||
"TV Services",
|
||||
"Custom Network Protocol",
|
||||
"System Extension",
|
||||
"Push to Talk",
|
||||
"DriverKit USB Transport (development)",
|
||||
"Increased Memory Limit",
|
||||
"Communicates with Drivers",
|
||||
"Media Device Discovery",
|
||||
"DriverKit Allow Third Party UserClients",
|
||||
"WeatherKit",
|
||||
"On Demand Install Capable for App Clip Extensions",
|
||||
"DriverKit Family SCSIController (development)",
|
||||
"DriverKit Family Serial (development)",
|
||||
"DriverKit Family Networking (development)",
|
||||
"DriverKit Family HID EventService (development)",
|
||||
"DriverKit Family HID Device (development)",
|
||||
"DriverKit for Development",
|
||||
"DriverKit Transport HID (development)",
|
||||
"DriverKit Family Audio (development)",
|
||||
"Shared with You",
|
||||
]
|
||||
`);
|
||||
expect(results.disabled).toStrictEqual([]);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ApiKey, ApiKeyProps, ApiKeyType, UserRole } from '@expo/apple-utils';
|
||||
import promiseRetry from 'promise-retry';
|
||||
|
||||
import Log from '../../../log';
|
||||
import { Analytics, SubmissionEvent } from '../../../analytics/events';
|
||||
import Log, { learnMore } from '../../../log';
|
||||
import { ora } from '../../../ora';
|
||||
import { AscApiKey, AscApiKeyInfo } from './Credentials.types';
|
||||
import { getRequestContext } from './authenticate';
|
||||
@@ -49,6 +51,73 @@ export async function getAscApiKeyAsync(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* There is a bug in Apple's infrastructure that does not propagate newly created objects for a
|
||||
* while. If the key has not propagated and you try to download it, Apple will error saying that
|
||||
* the resource does not exist. We retry with exponential backoff until the key propagates and
|
||||
* is available for download.
|
||||
* */
|
||||
export async function downloadWithRetryAsync(
|
||||
key: ApiKey,
|
||||
{
|
||||
minTimeout = 1000,
|
||||
retries = 6,
|
||||
factor = 2,
|
||||
}: { minTimeout?: number; retries?: number; factor?: number } = {}
|
||||
): Promise<string | null> {
|
||||
const RESOURCE_DOES_NOT_EXIST_MESSAGE =
|
||||
'The specified resource does not exist - There is no resource of type';
|
||||
try {
|
||||
const keyP8 = await promiseRetry(
|
||||
async (retry, number) => {
|
||||
try {
|
||||
return await key.downloadAsync();
|
||||
} catch (e: any) {
|
||||
if (
|
||||
e.name === 'UnexpectedAppleResponse' &&
|
||||
e.message.includes(RESOURCE_DOES_NOT_EXIST_MESSAGE)
|
||||
) {
|
||||
const secondsToRetry = Math.pow(factor, number);
|
||||
Log.log(
|
||||
`Received an unexpected response from Apple, retrying in ${secondsToRetry} seconds...`
|
||||
);
|
||||
Analytics.logEvent(SubmissionEvent.API_KEY_DOWNLOAD_RETRY, {
|
||||
errorName: e.name,
|
||||
reason: e.message,
|
||||
retry: number,
|
||||
});
|
||||
return retry(e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
},
|
||||
{
|
||||
retries,
|
||||
factor,
|
||||
minTimeout,
|
||||
}
|
||||
);
|
||||
Analytics.logEvent(SubmissionEvent.API_KEY_DOWNLOAD_SUCCESS, {});
|
||||
return keyP8;
|
||||
} catch (e: any) {
|
||||
if (
|
||||
e.name === 'UnexpectedAppleResponse' &&
|
||||
e.message.includes(RESOURCE_DOES_NOT_EXIST_MESSAGE)
|
||||
) {
|
||||
Log.warn(
|
||||
`Unable to download Api Key from Apple at this time. Create and upload your key manually by running 'eas credentials' ${learnMore(
|
||||
'https://expo.fyi/creating-asc-api-key'
|
||||
)}`
|
||||
);
|
||||
}
|
||||
Analytics.logEvent(SubmissionEvent.API_KEY_DOWNLOAD_FAIL, {
|
||||
errorName: e.name,
|
||||
reason: e.message,
|
||||
});
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an App Store Connect API Key.
|
||||
* **Does not support App Store Connect API (CI).**
|
||||
@@ -71,7 +140,7 @@ export async function createAscApiKeyAsync(
|
||||
roles: roles ?? [UserRole.ADMIN],
|
||||
keyType: keyType ?? ApiKeyType.PUBLIC_API,
|
||||
});
|
||||
const keyP8 = await key.downloadAsync();
|
||||
const keyP8 = await downloadWithRetryAsync(key);
|
||||
if (!keyP8) {
|
||||
const { nickname, roles } = key.attributes;
|
||||
const humanReadableKey = `App Store Connect Key '${nickname}' (${
|
||||
|
||||
@@ -484,6 +484,7 @@ export const CapabilityMapping: CapabilityClassifier[] = [
|
||||
{
|
||||
// https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_networking_vpn_api
|
||||
name: 'Push Notifications',
|
||||
// com.apple.developer.aps-environment
|
||||
entitlement: 'aps-environment',
|
||||
capability: CapabilityType.PUSH_NOTIFICATIONS,
|
||||
validateOptions: validateDevProdString,
|
||||
@@ -522,6 +523,181 @@ export const CapabilityMapping: CapabilityClassifier[] = [
|
||||
validateOptions: validateDevProdString,
|
||||
getOptions: getDefinedOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.coremedia.hls.low-latency',
|
||||
name: 'Low Latency HLS',
|
||||
capability: CapabilityType.HLS_LOW_LATENCY,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.associated-domains.mdm-managed',
|
||||
name: 'MDM Managed Associated Domains',
|
||||
capability: CapabilityType.MDM_MANAGED_ASSOCIATED_DOMAINS,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.fileprovider.testing-mode',
|
||||
name: 'FileProvider TestingMode',
|
||||
capability: CapabilityType.FILE_PROVIDER_TESTING_MODE,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.healthkit.recalibrate-estimates',
|
||||
name: 'Recalibrate Estimates',
|
||||
capability: CapabilityType.HEALTH_KIT_RECALIBRATE_ESTIMATES,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.maps',
|
||||
name: 'Maps',
|
||||
capability: CapabilityType.MAPS,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.user-management',
|
||||
name: 'TV Services',
|
||||
capability: CapabilityType.USER_MANAGEMENT,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.networking.custom-protocol',
|
||||
name: 'Custom Network Protocol',
|
||||
capability: CapabilityType.NETWORK_CUSTOM_PROTOCOL,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.system-extension.install',
|
||||
name: 'System Extension',
|
||||
capability: CapabilityType.SYSTEM_EXTENSION_INSTALL,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.push-to-talk',
|
||||
name: 'Push to Talk',
|
||||
capability: CapabilityType.PUSH_TO_TALK,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.transport.usb',
|
||||
name: 'DriverKit USB Transport (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_USB_TRANSPORT_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.kernel.increased-memory-limit',
|
||||
name: 'Increased Memory Limit',
|
||||
capability: CapabilityType.INCREASED_MEMORY_LIMIT,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.communicates-with-drivers',
|
||||
name: 'Communicates with Drivers',
|
||||
capability: CapabilityType.DRIVER_KIT_COMMUNICATES_WITH_DRIVERS,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.media-device-discovery-extension',
|
||||
name: 'Media Device Discovery',
|
||||
capability: CapabilityType.MEDIA_DEVICE_DISCOVERY,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.allow-third-party-userclients',
|
||||
name: 'DriverKit Allow Third Party UserClients',
|
||||
capability: CapabilityType.DRIVER_KIT_ALLOW_THIRD_PARTY_USER_CLIENTS,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.weatherkit',
|
||||
name: 'WeatherKit',
|
||||
capability: CapabilityType.WEATHER_KIT,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.on-demand-install-capable',
|
||||
name: 'On Demand Install Capable for App Clip Extensions',
|
||||
capability: CapabilityType.ON_DEMAND_INSTALL_EXTENSIONS,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.family.scsicontroller',
|
||||
name: 'DriverKit Family SCSIController (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_FAMILY_SCSI_CONTROLLER_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.family.serial',
|
||||
name: 'DriverKit Family Serial (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_FAMILY_SERIAL_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.family.networking',
|
||||
name: 'DriverKit Family Networking (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_FAMILY_NETWORKING_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.family.hid.eventservice',
|
||||
name: 'DriverKit Family HID EventService (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_FAMILY_HID_EVENT_SERVICE_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.family.hid.device',
|
||||
name: 'DriverKit Family HID Device (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_FAMILY_HID_DEVICE_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit',
|
||||
name: 'DriverKit for Development',
|
||||
capability: CapabilityType.DRIVER_KIT_PUBLIC,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.transport.hid',
|
||||
name: 'DriverKit Transport HID (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_TRANSPORT_HID_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.driverkit.family.audio',
|
||||
name: 'DriverKit Family Audio (development)',
|
||||
capability: CapabilityType.DRIVER_KIT_FAMILY_AUDIO_PUB,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
{
|
||||
entitlement: 'com.apple.developer.shared-with-you',
|
||||
name: 'Shared with You',
|
||||
capability: CapabilityType.SHARED_WITH_YOU,
|
||||
validateOptions: validateBooleanOptions,
|
||||
getOptions: getBooleanOptions,
|
||||
},
|
||||
|
||||
// These don't appear to have entitlements, so it's unclear how we can automatically enable / disable them at this time.
|
||||
// TODO: Maybe add a warning about manually enabling features?
|
||||
@@ -534,24 +710,9 @@ export const CapabilityMapping: CapabilityClassifier[] = [
|
||||
// },
|
||||
// {
|
||||
// entitlement: '',
|
||||
// name: 'FileProvider TestingMode',
|
||||
// capability: 'FILEPROVIDER_TESTINGMODE',
|
||||
// },
|
||||
// {
|
||||
// entitlement: '',
|
||||
// name: 'HLS Interstitial Previews',
|
||||
// capability: 'HLS_INTERSTITIAL_PREVIEW',
|
||||
// },
|
||||
// {
|
||||
// entitlement: '',
|
||||
// name: 'Low Latency HLS',
|
||||
// capability: 'COREMEDIA_HLS_LOW_LATENCY',
|
||||
// },
|
||||
// {
|
||||
// entitlement: '',
|
||||
// name: 'MDM Managed Associated Domains',
|
||||
// capability: 'MDM_MANAGED_ASSOCIATED_DOMAINS',
|
||||
// },
|
||||
|
||||
// "Game Controllers" doesn't appear in Dev Portal but it does show up in Xcode,
|
||||
// toggling in Xcode causes no network request to be sent.
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// Renamed to avoid conflation with Android/iOS/Web Platform constants
|
||||
export { Platform as ApplePlatform } from '@expo/apple-utils';
|
||||
@@ -33,7 +33,7 @@ export async function getDistributionCertificateAsync(
|
||||
const certificates = await Certificate.getAsync(context, {
|
||||
query: {
|
||||
filter: {
|
||||
certificateType: CertificateType.IOS_DISTRIBUTION,
|
||||
certificateType: [CertificateType.IOS_DISTRIBUTION, CertificateType.DISTRIBUTION],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
import { getRequestContext } from './authenticate';
|
||||
import { AuthCtx } from './authenticateTypes';
|
||||
import { getBundleIdForIdentifierAsync, getProfilesForBundleIdAsync } from './bundleId';
|
||||
import { ApplePlatform } from './constants';
|
||||
import { getCertificateBySerialNumberAsync, transformCertificate } from './distributionCertificate';
|
||||
|
||||
export enum ProfileClass {
|
||||
@@ -18,7 +19,37 @@ export enum ProfileClass {
|
||||
General = 'general',
|
||||
}
|
||||
|
||||
function resolveProfileType(profileClass: ProfileClass, isEnterprise?: boolean): ProfileType {
|
||||
function resolveProfileType(
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass: ProfileClass,
|
||||
isEnterprise?: boolean
|
||||
): ProfileType {
|
||||
switch (applePlatform) {
|
||||
case ApplePlatform.IOS:
|
||||
return resolveProfileTypeIos(profileClass, isEnterprise);
|
||||
case ApplePlatform.TV_OS:
|
||||
return resolveProfileTypeAppleTv(profileClass, isEnterprise);
|
||||
case ApplePlatform.MAC_OS:
|
||||
throw new Error(`${applePlatform} profiles are not supported`);
|
||||
}
|
||||
}
|
||||
|
||||
function resolveProfileTypeAppleTv(
|
||||
profileClass: ProfileClass,
|
||||
isEnterprise?: boolean
|
||||
): ProfileType {
|
||||
if (isEnterprise) {
|
||||
return profileClass === ProfileClass.Adhoc
|
||||
? ProfileType.TVOS_APP_ADHOC
|
||||
: ProfileType.TVOS_APP_INHOUSE;
|
||||
} else {
|
||||
return profileClass === ProfileClass.Adhoc
|
||||
? ProfileType.TVOS_APP_ADHOC
|
||||
: ProfileType.TVOS_APP_STORE;
|
||||
}
|
||||
}
|
||||
|
||||
function resolveProfileTypeIos(profileClass: ProfileClass, isEnterprise?: boolean): ProfileType {
|
||||
if (isEnterprise) {
|
||||
return profileClass === ProfileClass.Adhoc
|
||||
? ProfileType.IOS_APP_ADHOC
|
||||
@@ -141,12 +172,13 @@ export async function useExistingProvisioningProfileAsync(
|
||||
export async function listProvisioningProfilesAsync(
|
||||
authCtx: AuthCtx,
|
||||
bundleIdentifier: string,
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass: ProfileClass = ProfileClass.General
|
||||
): Promise<ProvisioningProfileStoreInfo[]> {
|
||||
const spinner = ora(`Fetching Apple provisioning profiles`).start();
|
||||
try {
|
||||
const context = getRequestContext(authCtx);
|
||||
const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
|
||||
const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
|
||||
const profiles = (await getProfilesForBundleIdAsync(context, bundleIdentifier)).filter(
|
||||
profile => profile.attributes.profileType === profileType
|
||||
);
|
||||
@@ -168,6 +200,7 @@ export async function createProvisioningProfileAsync(
|
||||
bundleIdentifier: string,
|
||||
distCert: DistributionCertificate,
|
||||
profileName: string,
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass: ProfileClass = ProfileClass.General
|
||||
): Promise<ProvisioningProfile> {
|
||||
const spinner = ora(`Creating Apple provisioning profile`).start();
|
||||
@@ -180,7 +213,7 @@ export async function createProvisioningProfileAsync(
|
||||
}
|
||||
|
||||
const context = getRequestContext(authCtx);
|
||||
const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
|
||||
const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
|
||||
|
||||
const certificate = await getCertificateBySerialNumberAsync(
|
||||
context,
|
||||
@@ -210,6 +243,7 @@ export async function createProvisioningProfileAsync(
|
||||
export async function revokeProvisioningProfileAsync(
|
||||
authCtx: AuthCtx,
|
||||
bundleIdentifier: string,
|
||||
applePlatform: ApplePlatform,
|
||||
profileClass: ProfileClass = ProfileClass.General
|
||||
): Promise<void> {
|
||||
const spinner = ora(`Revoking Apple provisioning profile`).start();
|
||||
@@ -217,7 +251,7 @@ export async function revokeProvisioningProfileAsync(
|
||||
const context = getRequestContext(authCtx);
|
||||
|
||||
const profiles = await getProfilesForBundleIdAsync(context, bundleIdentifier);
|
||||
const profileType = resolveProfileType(profileClass, authCtx.team.inHouse);
|
||||
const profileType = resolveProfileType(applePlatform, profileClass, authCtx.team.inHouse);
|
||||
await Promise.all(
|
||||
profiles
|
||||
.filter(profile => profile.attributes.profileType === profileType)
|
||||
|
||||
@@ -25,10 +25,8 @@ async function registerMissingDevicesAsync(
|
||||
context: RequestContext,
|
||||
udids: string[]
|
||||
): Promise<Device[]> {
|
||||
const allIosProfileDevices = await Device.getAllIOSProfileDevicesAsync(context);
|
||||
const alreadyAdded = allIosProfileDevices.filter(device =>
|
||||
udids.includes(device.attributes.udid)
|
||||
);
|
||||
const allDevices = await Device.getAsync(context);
|
||||
const alreadyAdded = allDevices.filter(device => udids.includes(device.attributes.udid));
|
||||
const alreadyAddedUdids = alreadyAdded.map(i => i.attributes.udid);
|
||||
|
||||
await Promise.all(
|
||||
@@ -46,17 +44,20 @@ async function registerMissingDevicesAsync(
|
||||
return alreadyAdded;
|
||||
}
|
||||
|
||||
async function findProfileByBundleIdAsync(
|
||||
async function findProfileAsync(
|
||||
context: RequestContext,
|
||||
bundleId: string,
|
||||
certSerialNumber: string
|
||||
{
|
||||
bundleId,
|
||||
certSerialNumber,
|
||||
profileType,
|
||||
}: { bundleId: string; certSerialNumber: string; profileType: ProfileType }
|
||||
): Promise<{
|
||||
profile: Profile | null;
|
||||
didUpdate: boolean;
|
||||
}> {
|
||||
const expoProfiles = (await getProfilesForBundleIdAsync(context, bundleId)).filter(profile => {
|
||||
return (
|
||||
profile.attributes.profileType === ProfileType.IOS_APP_ADHOC &&
|
||||
profile.attributes.profileType === profileType &&
|
||||
profile.attributes.name.startsWith('*[expo]') &&
|
||||
profile.attributes.profileState !== ProfileState.EXPIRED
|
||||
);
|
||||
@@ -132,11 +133,13 @@ async function manageAdHocProfilesAsync(
|
||||
bundleId,
|
||||
certSerialNumber,
|
||||
profileId,
|
||||
profileType,
|
||||
}: {
|
||||
udids: string[];
|
||||
bundleId: string;
|
||||
certSerialNumber: string;
|
||||
profileId?: string;
|
||||
profileType: ProfileType;
|
||||
}
|
||||
): Promise<ProfileResults> {
|
||||
// We register all missing devices on the Apple Developer Portal. They are identified by UDIDs.
|
||||
@@ -155,7 +158,7 @@ async function manageAdHocProfilesAsync(
|
||||
}
|
||||
} else {
|
||||
// If no profile id is passed, try to find a suitable provisioning profile for the App ID.
|
||||
const results = await findProfileByBundleIdAsync(context, bundleId, certSerialNumber);
|
||||
const results = await findProfileAsync(context, { bundleId, certSerialNumber, profileType });
|
||||
existingProfile = results.profile;
|
||||
didUpdate = results.didUpdate;
|
||||
}
|
||||
@@ -192,8 +195,9 @@ async function manageAdHocProfilesAsync(
|
||||
await existingProfile.regenerateAsync();
|
||||
}
|
||||
|
||||
const updatedProfile = (await findProfileByBundleIdAsync(context, bundleId, certSerialNumber))
|
||||
.profile;
|
||||
const updatedProfile = (
|
||||
await findProfileAsync(context, { bundleId, certSerialNumber, profileType })
|
||||
).profile;
|
||||
if (!updatedProfile) {
|
||||
throw new Error(
|
||||
`Failed to locate updated profile for bundle identifier "${bundleId}" and serial number "${certSerialNumber}"`
|
||||
@@ -226,7 +230,7 @@ async function manageAdHocProfilesAsync(
|
||||
name: `*[expo] ${bundleId} AdHoc ${Date.now()}`,
|
||||
certificates: [distributionCertificate.id],
|
||||
devices: devices.map(device => device.id),
|
||||
profileType: ProfileType.IOS_APP_ADHOC,
|
||||
profileType,
|
||||
});
|
||||
|
||||
return {
|
||||
@@ -242,7 +246,8 @@ export async function createOrReuseAdhocProvisioningProfileAsync(
|
||||
authCtx: AuthCtx,
|
||||
udids: string[],
|
||||
bundleIdentifier: string,
|
||||
distCertSerialNumber: string
|
||||
distCertSerialNumber: string,
|
||||
profileType: ProfileType
|
||||
): Promise<ProvisioningProfile> {
|
||||
const spinner = ora(`Handling Apple ad hoc provisioning profiles`).start();
|
||||
try {
|
||||
@@ -252,6 +257,7 @@ export async function createOrReuseAdhocProvisioningProfileAsync(
|
||||
udids,
|
||||
bundleId: bundleIdentifier,
|
||||
certSerialNumber: distCertSerialNumber,
|
||||
profileType,
|
||||
});
|
||||
|
||||
if (didCreate) {
|
||||
|
||||
@@ -6,14 +6,17 @@ import nullthrows from 'nullthrows';
|
||||
|
||||
import { IosAppBuildCredentialsFragment, IosDistributionType } from '../../../graphql/generated';
|
||||
import Log from '../../../log';
|
||||
import { getApplePlatformFromSdkRoot } from '../../../project/ios/target';
|
||||
import { CredentialsContext } from '../../context';
|
||||
import { AppLookupParams } from '../api/GraphqlClient';
|
||||
import { ProfileClass } from '../appstore/provisioningProfile';
|
||||
import { Target } from '../types';
|
||||
import { getP12CertFingerprint } from '../utils/p12Certificate';
|
||||
import { parse as parseProvisioningProfile } from '../utils/provisioningProfile';
|
||||
|
||||
export async function validateProvisioningProfileAsync(
|
||||
ctx: CredentialsContext,
|
||||
target: Target,
|
||||
app: AppLookupParams,
|
||||
buildCredentials: Partial<IosAppBuildCredentialsFragment> | null
|
||||
): Promise<boolean> {
|
||||
@@ -37,7 +40,7 @@ export async function validateProvisioningProfileAsync(
|
||||
return true;
|
||||
}
|
||||
|
||||
return await validateProvisioningProfileWithAppleAsync(ctx, app, buildCredentials);
|
||||
return await validateProvisioningProfileWithAppleAsync(ctx, target, app, buildCredentials);
|
||||
}
|
||||
|
||||
function validateProvisioningProfileWithoutApple(
|
||||
@@ -84,14 +87,17 @@ function validateProvisioningProfileWithoutApple(
|
||||
|
||||
async function validateProvisioningProfileWithAppleAsync(
|
||||
ctx: CredentialsContext,
|
||||
target: Target,
|
||||
app: AppLookupParams,
|
||||
buildCredentials: Partial<IosAppBuildCredentialsFragment>
|
||||
): Promise<boolean> {
|
||||
assert(buildCredentials.provisioningProfile, 'Provisioning Profile must be defined');
|
||||
const { developerPortalIdentifier, provisioningProfile } = buildCredentials.provisioningProfile;
|
||||
|
||||
const applePlatform = await getApplePlatformFromSdkRoot(target);
|
||||
const profilesFromApple = await ctx.appStore.listProvisioningProfilesAsync(
|
||||
app.bundleIdentifier,
|
||||
applePlatform,
|
||||
buildCredentials.iosDistributionType === IosDistributionType.AdHoc
|
||||
? ProfileClass.Adhoc
|
||||
: ProfileClass.General
|
||||
|
||||
@@ -4,10 +4,7 @@ import assert from 'assert';
|
||||
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { GradleBuildContext, resolveGradleBuildContextAsync } from '../../project/android/gradle';
|
||||
import {
|
||||
getProjectAccountName,
|
||||
promptToCreateProjectIfNotExistsAsync,
|
||||
} from '../../project/projectUtils';
|
||||
import { getProjectAccountName, getProjectIdAsync } from '../../project/projectUtils';
|
||||
import { promptAsync } from '../../prompts';
|
||||
import { findAccountByName } from '../../user/Account';
|
||||
import { ensureActorHasUsername, ensureLoggedInAsync } from '../../user/actions';
|
||||
@@ -80,12 +77,6 @@ export class ManageAndroid {
|
||||
while (true) {
|
||||
try {
|
||||
if (ctx.hasProjectContext) {
|
||||
const maybeProjectId = await promptToCreateProjectIfNotExistsAsync(ctx.exp);
|
||||
if (!maybeProjectId) {
|
||||
throw new Error(
|
||||
'Your project must be registered with EAS in order to use the credentials manager.'
|
||||
);
|
||||
}
|
||||
const appLookupParams = await getAppLookupParamsFromContextAsync(ctx, gradleContext);
|
||||
const appCredentials = await ctx.android.getAndroidAppCredentialsWithCommonFieldsAsync(
|
||||
appLookupParams
|
||||
@@ -156,12 +147,10 @@ export class ManageAndroid {
|
||||
buildProfile: BuildProfile<Platform.ANDROID>
|
||||
): Promise<GradleBuildContext | undefined> {
|
||||
assert(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.');
|
||||
const maybeProjectId = await promptToCreateProjectIfNotExistsAsync(ctx.exp);
|
||||
if (!maybeProjectId) {
|
||||
throw new Error(
|
||||
'Your project must be registered with EAS in order to use the credentials manager.'
|
||||
);
|
||||
}
|
||||
|
||||
// ensure the project exists on the EAS server
|
||||
await getProjectIdAsync(ctx.exp);
|
||||
|
||||
return await resolveGradleBuildContextAsync(ctx.projectDir, buildProfile);
|
||||
}
|
||||
|
||||
|
||||
@@ -11,10 +11,7 @@ import {
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { resolveXcodeBuildContextAsync } from '../../project/ios/scheme';
|
||||
import { resolveTargetsAsync } from '../../project/ios/target';
|
||||
import {
|
||||
getProjectAccountName,
|
||||
promptToCreateProjectIfNotExistsAsync,
|
||||
} from '../../project/projectUtils';
|
||||
import { getProjectAccountName, getProjectIdAsync } from '../../project/projectUtils';
|
||||
import { confirmAsync, promptAsync, selectAsync } from '../../prompts';
|
||||
import { Account, findAccountByName } from '../../user/Account';
|
||||
import { ensureActorHasUsername, ensureLoggedInAsync } from '../../user/actions';
|
||||
@@ -175,12 +172,9 @@ export class ManageIos {
|
||||
targets: Target[];
|
||||
}> {
|
||||
assert(ctx.hasProjectContext, 'createProjectContextAsync: must have project context.');
|
||||
const maybeProjectId = await promptToCreateProjectIfNotExistsAsync(ctx.exp);
|
||||
if (!maybeProjectId) {
|
||||
throw new Error(
|
||||
'Your project must be registered with EAS in order to use the credentials manager.'
|
||||
);
|
||||
}
|
||||
|
||||
// ensure the project exists on the EAS server
|
||||
await getProjectIdAsync(ctx.exp);
|
||||
|
||||
const app = { account, projectName: ctx.exp.slug };
|
||||
const xcodeBuildContext = await resolveXcodeBuildContextAsync(
|
||||
@@ -264,6 +258,7 @@ export class ManageIos {
|
||||
}
|
||||
await this.setupProvisioningProfileWithSpecificDistCertAsync(
|
||||
ctx,
|
||||
target,
|
||||
appLookupParams,
|
||||
distCert,
|
||||
distributionType
|
||||
@@ -280,6 +275,7 @@ export class ManageIos {
|
||||
if (confirm) {
|
||||
await this.setupProvisioningProfileWithSpecificDistCertAsync(
|
||||
ctx,
|
||||
target,
|
||||
appLookupParams,
|
||||
distCert,
|
||||
distributionType
|
||||
@@ -383,6 +379,7 @@ export class ManageIos {
|
||||
|
||||
private async setupProvisioningProfileWithSpecificDistCertAsync(
|
||||
ctx: CredentialsContext,
|
||||
target: Target,
|
||||
appLookupParams: AppLookupParams,
|
||||
distCert: AppleDistributionCertificateFragment,
|
||||
distributionType: IosDistributionTypeGraphql
|
||||
@@ -390,12 +387,14 @@ export class ManageIos {
|
||||
Log.log(`Setting up ${appLookupParams.projectName} to use Distribution Certificate`);
|
||||
Log.log(`Creating provisioning profile...`);
|
||||
if (distributionType === IosDistributionTypeGraphql.AdHoc) {
|
||||
return await new SetUpAdhocProvisioningProfile(
|
||||
appLookupParams
|
||||
).runWithDistributionCertificateAsync(ctx, distCert);
|
||||
return await new SetUpAdhocProvisioningProfile({
|
||||
app: appLookupParams,
|
||||
target,
|
||||
}).runWithDistributionCertificateAsync(ctx, distCert);
|
||||
} else {
|
||||
return await new SetUpProvisioningProfile(
|
||||
appLookupParams,
|
||||
target,
|
||||
distributionType
|
||||
).createAndAssignProfileAsync(ctx, distCert);
|
||||
}
|
||||
|
||||
Loaded 100 of 154 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user