Compare commits

...
36 Commits
Author SHA1 Message Date
Dominik Sokal dc11c1c487 v0.42.4 2021-12-21 15:09:15 +01:00
Dominik Sokal 805865356c install missing @oclif/plugin-help (#865)
* install missing @oclif/plugin-help

* update CHANGELOG.md
2021-12-21 14:59:37 +01:00
Expo CI 5fc0757fb0 update CHANGELOG.md 2021-12-21 13:42:56 +00:00
Dominik Sokal 2c6d92745f v0.42.3 2021-12-21 14:34:00 +01:00
Dominik Sokal f677e038cf upgrade eas-cli-local-build-plugin to 0.0.57 2021-12-21 14:33:45 +01:00
Dominik Sokal ef13c2bf0e really fix windows release process 2021-12-21 14:33:32 +01:00
Dominik Sokal 68e552010e v0.42.2 2021-12-21 14:25:19 +01:00
Dominik Sokal c5143fabad fix windows release process 2021-12-21 14:22:53 +01:00
Dominik Sokal 64efdad61d v0.42.1 2021-12-21 14:03:49 +01:00
Dominik Sokal 8bc07ca452 fix release process (#864)
* fix release process

* run learna version with --exact

* fix build-for-size-check
2021-12-21 14:02:03 +01:00
Dominik Sokal ea4d28e7d9 v0.42.0 2021-12-21 11:22:21 +01:00
Dominik Sokal e1fce4a066 upgrade oclif deps (#858) 2021-12-21 10:42:09 +01:00
jkh 76d75e9c17 [eas-cli] allow eas-cli to be run outside of expo projects (#851) 2021-12-17 09:25:11 -08:00
Dominik Sokal 9278b3c17d use default for function argument 2021-12-17 10:15:11 +01:00
jkh ef9fbe84c0 [eas-cli] clean up eas update logs (#850) 2021-12-16 12:22:05 -08:00
Expo CI b3a69e8863 update CHANGELOG.md 2021-12-16 17:58:52 +00:00
jonsamp 5e4663ac44 v0.41.1 2021-12-16 12:53:18 -05:00
jkh ca18a555c1 [eas-cli] support staging and local Update URLs (#849) 2021-12-16 07:14:11 -08:00
Jon Samp c446bbb016 [eas-cli] Make all EAS Update related commands public (#854) 2021-12-16 09:34:49 -05:00
Dominik Sokal d5254434c6 print expo-updates version in eas diagnostics 2021-12-16 09:58:40 +01:00
Bartłomiej Klocek e2277b9482 [eas-cli] Fix ASC prompt displayed in --non-interactive (#841)
* [eas-cli] Fix ASC prompt displayed in --non-interactive

* Update CHANGELOG.md

* Apply feedback - fail in non-interactive
2021-12-15 13:28:59 +01:00
Test User 739502aef9 [eas-cli] fix typo in branch:delete description 2021-12-13 17:26:36 -05:00
Expo CI de42624992 update CHANGELOG.md 2021-12-13 15:44:24 +00:00
Wojciech Kozyra 0ccfbe5dd6 v0.41.0 2021-12-13 16:19:53 +01:00
Wojciech Kozyra 3ffad12681 upgrade eas-cli-local-build-plugin to 0.0.56 2021-12-13 16:19:40 +01:00
Wojciech Kozyra 565867b5a8 Update CHANGELOG.md 2021-12-13 15:16:51 +01:00
Wojciech KozyraandDominik Sokal 303cc82a06 [eas-cli] add build inspect command (#834)
* [eas-cli] add build inspect command

* Apply suggestions from code review

Co-authored-by: Dominik Sokal <[email protected]>

* Apply suggestions from code review

Co-authored-by: Dominik Sokal <[email protected]>

* review feedback

Co-authored-by: Dominik Sokal <[email protected]>
2021-12-13 14:56:25 +01:00
Dominik Sokal 4c2abc0693 fix submission url (#845)
* fix submission url

* update CHANGELOG.md
2021-12-13 14:41:19 +01:00
Dominik SokalandWojciech Kozyra b63167fbae [ENG-2052] ask user to select profile if release does not exist (#829)
* ask user to select profile if release does not exist

* Apply suggestions from code review

Co-authored-by: Wojciech Kozyra <[email protected]>

* update CHANGELOG.md

Co-authored-by: Wojciech Kozyra <[email protected]>
2021-12-13 11:00:09 +01:00
Dominik Sokal 8adb6434bf [ENG-2279] warn when attempting to use EAS CLI on managed SDK < 41 project (#833)
* warn when attempting to use EAS CLI on managed SDK < 41 project

* update CHANGELOG.md

* Update CHANGELOG.md
2021-12-13 09:48:00 +01:00
Dominik Sokal 4c9e407fef [eas-json] use semver for version validation (#832)
* [eas-json] use semver for version validation

* update CHANGELOG.md
2021-12-13 09:44:44 +01:00
jkh ef566b3f9c [eas-cli] fix missing republish message (#839) 2021-12-12 15:34:22 -05:00
jkh 895231ea98 [eas-cli] fix table column names (#840) 2021-12-12 15:34:13 -05:00
jkh c7000a754e [eas-cli] Make default runtime version 1.0.0 for bare workflow (#838) 2021-12-12 15:34:04 -05:00
jkh 9ac8404681 [eas-cli] handle 'eas update' when there are no branches (#837) 2021-12-10 15:18:48 -05:00
Expo CI 6c0b7d5951 update CHANGELOG.md 2021-12-08 20:59:10 +00:00
80 changed files with 3974 additions and 1060 deletions

No files matched your search

+28 -13
View File
@@ -32,15 +32,23 @@ jobs:
- run: yarn build
- name: Build tarballs
working-directory: ${{ github.workspace }}/packages/eas-cli
run: yarn oclif-dev pack --targets linux-x64,linux-arm
run: |
yarn pretarball-ci
yarn oclif pack:tarballs --no-xz --targets linux-x64,linux-arm
- id: x64
run: echo "::set-output name=filename::$(ls eas-*-x64.tar.gz)"
working-directory: ${{ github.workspace }}/packages/eas-cli/dist
- id: arm
run: echo "::set-output name=filename::$(ls eas-*-arm.tar.gz)"
working-directory: ${{ github.workspace }}/packages/eas-cli/dist
- name: Upload linux-x64 tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: packages/eas-cli/dist/eas-linux-x64.tar.gz
asset_name: eas-linux-x64.tar.gz
asset_path: packages/eas-cli/dist/${{ steps.x64.outputs.filename }}
asset_name: ${{ steps.x64.outputs.filename }}
asset_content_type: application/gzip
- name: Upload linux-arm tarball
uses: actions/upload-release-asset@v1
@@ -48,8 +56,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: packages/eas-cli/dist/eas-linux-arm.tar.gz
asset_name: eas-linux-arm.tar.gz
asset_path: packages/eas-cli/dist/${{ steps.arm.outputs.filename }}
asset_name: ${{ steps.arm.outputs.filename }}
asset_content_type: application/gzip
build-mac:
name: Build for macOS
@@ -65,15 +73,20 @@ jobs:
- run: yarn build
- name: Build tarballs
working-directory: ${{ github.workspace }}/packages/eas-cli
run: yarn oclif-dev pack --targets darwin-x64
run: |
yarn pretarball-ci
yarn oclif pack:tarballs --no-xz --targets darwin-x64
- id: x64
run: echo "::set-output name=filename::$(ls eas-*-x64.tar.gz)"
working-directory: ${{ github.workspace }}/packages/eas-cli/dist
- name: Upload darwin-x64 tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: packages/eas-cli/dist/eas-darwin-x64.tar.gz
asset_name: eas-darwin-x64.tar.gz
asset_path: packages/eas-cli/dist/${{ steps.x64.outputs.filename }}
asset_name: ${{ steps.x64.outputs.filename }}
asset_content_type: application/gzip
build-windows:
name: Build for Windows
@@ -87,21 +100,23 @@ jobs:
- run: yarn install --frozen-lockfile --check-files
- run: sudo apt-get install nsis
- run: yarn build
- run: yarn oclif-dev pack:win
- run: |
yarn pretarball-ci
yarn oclif pack:win
working-directory: ${{ github.workspace }}/packages/eas-cli
- id: x64
run: echo "::set-output name=filename::$(ls eas-*-x64.exe)"
working-directory: ${{ github.workspace }}/packages/eas-cli/dist/win
working-directory: ${{ github.workspace }}/packages/eas-cli/dist/win32
- id: x86
run: echo "::set-output name=filename::$(ls eas-*-x86.exe)"
working-directory: ${{ github.workspace }}/packages/eas-cli/dist/win
working-directory: ${{ github.workspace }}/packages/eas-cli/dist/win32
- name: Upload x64 installer
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: packages/eas-cli/dist/win/${{ steps.x64.outputs.filename }}
asset_path: packages/eas-cli/dist/win32/${{ steps.x64.outputs.filename }}
asset_name: ${{ steps.x64.outputs.filename }}
asset_content_type: application/gzip
- name: Upload x86 installer
@@ -110,7 +125,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: packages/eas-cli/dist/win/${{ steps.x86.outputs.filename }}
asset_path: packages/eas-cli/dist/win32/${{ steps.x86.outputs.filename }}
asset_name: ${{ steps.x86.outputs.filename }}
asset_content_type: application/gzip
publish-to-npm:
+3 -1
View File
@@ -9,10 +9,12 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
node-version: 16
- uses: preactjs/compressed-size-action@v2
with:
build-script: 'build:tarballs:linux'
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: './packages/eas-cli/dist/*.tar.gz'
compression: 'none'
strip-hash: "v\\d+.\\d+.\\d+-\\w+-"
clean-script: 'clean'
+1
View File
@@ -1,6 +1,7 @@
# Build directories
packages/*/build
packages/eas-cli/dist
packages/eas-cli/tmp
# Code editors
.idea
+51 -3
View File
@@ -6,16 +6,64 @@ This is the log of notable changes to EAS CLI and related packages.
### 🛠 Breaking changes
- [eas-cli] change eas update:publish to eas update. ([#830](https://github.com/expo/eas-cli/pull/830) by [@jkhales](https://github.com/jkhales))
### 🎉 New features
### 🐛 Bug fixes
- Pass build profile environment to credentials command. ([#828](https://github.com/expo/eas-cli/pull/828) by [@quinlanj](https://github.com/quinlanj))
- Add missing dependency - `@oclif/plugin-help`. ([#865](https://github.com/expo/eas-cli/pull/865) by [@dsokal](https://github.com/dsokal))
### 🧹 Chores
## [0.42.3](https://github.com/expo/eas-cli/releases/tag/v0.42.3) - 2021-12-21
### 🐛 Bug fixes
- Allow select eas commands to be run outside of a project. ([#851](https://github.com/expo/eas-cli/pull/851) by [@jkhales](https://github.com/jkhales))
### 🧹 Chores
- Replace all oclif dependencies with `@oclif/core`. ([#858](https://github.com/expo/eas-cli/pull/858) by [@dsokal](https://github.com/dsokal))
## [0.41.1](https://github.com/expo/eas-cli/releases/tag/v0.41.1) - 2021-12-16
### 🎉 New features
- Adds commands for EAS Update, which is now in preview for subscribers. EAS Update makes fixing small bugs and pushing quick fixes a snap in between app store submissions. It accomplishes this by allowing an end-user's app to swap out the non-native parts of their app (for example, JS, styling, and image changes) with a new update that contains bug fixes and other updates.
- Adds `eas update`, which can bundle and publish updates on a branch.
- Adds `eas branch`, which manages branches. Branches contain a list of updates and are linked to channels.
- Adds `eas channel`, which manages channels. Channels are specified inside builds and are linked to branches, allowing us to link specific updates with specific builds.
- Read more in our [feature preview docs](https://docs.expo.dev/eas-update/introduction/).
### 🐛 Bug fixes
- Fix `eas submit` displaying a prompt in non-interactive mode when some ASC API credentials are missing in `eas.json`. ([#841](https://github.com/expo/eas-cli/pull/841) by [@barthap](https://github.com/barthap))
## [0.41.0](https://github.com/expo/eas-cli/releases/tag/v0.41.0) - 2021-12-13
### 🎉 New features
- Ask user to select profile if `release` does not exist. ([#829](https://github.com/expo/eas-cli/pull/829) by [@dsokal](https://github.com/dsokal))
- Add `build:inspect` command. ([#834](https://github.com/expo/eas-cli/pull/834) by [@wkozyra95](https://github.com/wkozyra95))
### 🐛 Bug fixes
- Fix validating tool versions in eas.json. ([#832](https://github.com/expo/eas-cli/pull/832) by [@dsokal](https://github.com/dsokal))
- Fix submission URL. ([#845](https://github.com/expo/eas-cli/pull/845) by [@dsokal](https://github.com/dsokal))
### 🧹 Chores
- Warn when building managed project with SDK < 41. ([#833](https://github.com/expo/eas-cli/pull/833) by [@dsokal](https://github.com/dsokal))
## [0.40.0](https://github.com/expo/eas-cli/releases/tag/v0.40.0) - 2021-12-08
### 🛠 Breaking changes
- [eas-cli] change eas update:publish to eas update. ([#830](https://github.com/expo/eas-cli/pull/830) by [@jkhales](https://github.com/jkhales))
### 🐛 Bug fixes
- Pass build profile environment to credentials command. ([#828](https://github.com/expo/eas-cli/pull/828) by [@quinlanj](https://github.com/quinlanj))
## [0.39.0](https://github.com/expo/eas-cli/releases/tag/v0.39.0) - 2021-12-06
### 🎉 New features
+1 -1
View File
@@ -1,5 +1,5 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.40.0"
"version": "0.42.4"
}
+4 -3
View File
@@ -5,18 +5,18 @@
],
"scripts": {
"build": "lerna run build",
"build:tarballs:linux": "yarn build && yarn workspace eas-cli oclif-dev pack --targets linux-x64",
"build:tarballs:linux": "yarn build-for-size-check",
"build-for-size-check": "yarn build && yarn workspace eas-cli pretarball-ci && CLI_SIZE_CHECK=1 yarn workspace eas-cli oclif pack:tarballs --no-xz --targets linux-x64",
"typecheck": "lerna run typecheck",
"start": "lerna run watch --parallel",
"watch": "yarn start",
"eas": "packages/eas-cli/bin/run",
"lint": "eslint .",
"release": "./scripts/bin/run update-local-plugin && lerna version",
"release": "./scripts/bin/run update-local-plugin && lerna version --exact",
"test": "jest",
"clean": "lerna run clean && rm -rf node_modules coverage"
},
"devDependencies": {
"@expo/oclif-dev-cli": "1.24.0-expo",
"@types/jest": "27.0.1",
"@types/node": "16.7.8",
"eslint": "7.32.0",
@@ -26,6 +26,7 @@
"jest": "27.1.0",
"jest-watch-typeahead": "0.6.4",
"lerna": "4.0.0",
"oclif": "2.0.1",
"prettier": "2.4.1",
"ts-jest": "27.0.5",
"typescript": "4.5.2"
+467 -103
View File
@@ -37,11 +37,21 @@ eas --help COMMAND
* [`eas account:logout`](#eas-accountlogout)
* [`eas account:view`](#eas-accountview)
* [`eas analytics [STATUS]`](#eas-analytics-status)
* [`eas branch:create [NAME]`](#eas-branchcreate-name)
* [`eas branch:delete [NAME]`](#eas-branchdelete-name)
* [`eas branch:list`](#eas-branchlist)
* [`eas branch:rename`](#eas-branchrename)
* [`eas branch:view [NAME]`](#eas-branchview-name)
* [`eas build`](#eas-build)
* [`eas build:cancel [BUILD_ID]`](#eas-buildcancel-build_id)
* [`eas build:configure`](#eas-buildconfigure)
* [`eas build:inspect`](#eas-buildinspect)
* [`eas build:list`](#eas-buildlist)
* [`eas build:view [BUILD_ID]`](#eas-buildview-build_id)
* [`eas channel:create [NAME]`](#eas-channelcreate-name)
* [`eas channel:edit [NAME]`](#eas-channeledit-name)
* [`eas channel:list`](#eas-channellist)
* [`eas channel:view [NAME]`](#eas-channelview-name)
* [`eas config`](#eas-config)
* [`eas credentials`](#eas-credentials)
* [`eas device:create`](#eas-devicecreate)
@@ -55,6 +65,10 @@ eas --help COMMAND
* [`eas secret:delete`](#eas-secretdelete)
* [`eas secret:list`](#eas-secretlist)
* [`eas submit`](#eas-submit)
* [`eas update`](#eas-update)
* [`eas update:configure`](#eas-updateconfigure)
* [`eas update:delete GROUPID`](#eas-updatedelete-groupid)
* [`eas update:view GROUPID`](#eas-updateview-groupid)
* [`eas webhook:create`](#eas-webhookcreate)
* [`eas webhook:delete [ID]`](#eas-webhookdelete-id)
* [`eas webhook:list`](#eas-webhooklist)
@@ -69,11 +83,14 @@ log in with your Expo account
USAGE
$ eas account:login
DESCRIPTION
log in with your Expo account
ALIASES
$ eas login
```
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/account/login.ts)_
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/account/login.ts)_
## `eas account:logout`
@@ -83,11 +100,14 @@ log out
USAGE
$ eas account:logout
DESCRIPTION
log out
ALIASES
$ eas logout
```
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/account/logout.ts)_
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/account/logout.ts)_
## `eas account:view`
@@ -97,11 +117,14 @@ show the username you are logged in as
USAGE
$ eas account:view
DESCRIPTION
show the username you are logged in as
ALIASES
$ eas whoami
```
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/account/view.ts)_
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/account/view.ts)_
## `eas analytics [STATUS]`
@@ -110,9 +133,108 @@ view or change analytics settings
```
USAGE
$ eas analytics [STATUS]
DESCRIPTION
view or change analytics settings
```
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/analytics.ts)_
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/analytics.ts)_
## `eas branch:create [NAME]`
Create a branch on the current project.
```
USAGE
$ eas branch:create [NAME] [--json]
ARGUMENTS
NAME Name of the branch to create
FLAGS
--json return a json with the new branch ID and name.
DESCRIPTION
Create a branch on the current project.
```
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/branch/create.ts)_
## `eas branch:delete [NAME]`
Delete a branch on the current project
```
USAGE
$ eas branch:delete [NAME] [--json]
ARGUMENTS
NAME Name of the branch to delete
FLAGS
--json return JSON with the edited branch's ID and name.
DESCRIPTION
Delete a branch on the current project
```
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/branch/delete.ts)_
## `eas branch:list`
List all branches on this project.
```
USAGE
$ eas branch:list [--json]
FLAGS
--json return output as JSON
DESCRIPTION
List all branches on this project.
```
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/branch/list.ts)_
## `eas branch:rename`
Rename a branch.
```
USAGE
$ eas branch:rename [--from <value>] [--to <value>] [--json]
FLAGS
--from=<value> current name of the branch.
--json return a json with the edited branch's ID and name.
--to=<value> new name of the branch.
DESCRIPTION
Rename a branch.
```
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/branch/rename.ts)_
## `eas branch:view [NAME]`
View a branch.
```
USAGE
$ eas branch:view [NAME] [--json]
ARGUMENTS
NAME Name of the branch to view
FLAGS
--json return a json with the branch's ID name and recent update groups.
DESCRIPTION
View a branch.
```
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/branch/view.ts)_
## `eas build`
@@ -120,33 +242,28 @@ Start a build
```
USAGE
$ eas build
$ eas build [-p android|ios|all] [--json] [--skip-project-configuration] [--profile <value>]
[--non-interactive] [--local] [--wait] [--clear-cache] [--auto-submit | --auto-submit-with-profile <value>]
OPTIONS
FLAGS
-p, --platform=(android|ios|all)
--auto-submit Submit on build complete using the submit profile with the same name as the
build profile
--auto-submit-with-profile=PROFILE_NAME Submit on build complete using the submit profile with provided name
--clear-cache Clear cache before the build
--json Enable JSON output, non-JSON messages will be printed to stderr
--local Run build locally [experimental]
--non-interactive Run command in non-interactive mode
--profile=PROFILE_NAME Name of the build profile from eas.json. Defaults to "production" if defined
in eas.json.
--skip-project-configuration Skip project configuration
--[no-]wait Wait for build(s) to complete
DESCRIPTION
Start a build
```
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/index.ts)_
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/build/index.ts)_
## `eas build:cancel [BUILD_ID]`
@@ -155,9 +272,12 @@ Cancel a build.
```
USAGE
$ eas build:cancel [BUILD_ID]
DESCRIPTION
Cancel a build.
```
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/cancel.ts)_
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/build/cancel.ts)_
## `eas build:configure`
@@ -165,13 +285,52 @@ Configure the project to support EAS Build.
```
USAGE
$ eas build:configure
$ eas build:configure [-p android|ios|all]
OPTIONS
FLAGS
-p, --platform=(android|ios|all) Platform to configure
DESCRIPTION
Configure the project to support EAS Build.
```
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/configure.ts)_
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/build/configure.ts)_
## `eas build:inspect`
Inspect the state of the project at specific build stages. Useful for troubleshooting.
```
USAGE
$ eas build:inspect -p android|ios -s archive|pre-build|post-build --output <value> [--profile <value>] [--force]
[--verbose]
FLAGS
-p, --platform=(android|ios)
(required)
-s, --stage=(archive|pre-build|post-build)
(required) Stage of the build you want to inspect.
archive - builds the project archive that would be uploaded to EAS when building
pre-build - prepares the project to be built with Gradle/Xcode. Does not run the native build.
post-build - builds the native project and leaves the output directory for inspection
--force
Delete OUTPUT_DIRECTORY if it already exists.
--output=OUTPUT_DIRECTORY
(required) Output directory.
--profile=PROFILE_NAME
Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.
--verbose
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/v0.42.4/packages/eas-cli/src/commands/build/inspect.ts)_
## `eas build:list`
@@ -179,32 +338,32 @@ list all builds for your project
```
USAGE
$ eas build:list
$ eas build:list [--platform all|android|ios] [--json] [--status
new|in-queue|in-progress|errored|finished|canceled] [--distribution store|internal|simulator] [--channel <value>]
[--appVersion <value>] [--appBuildVersion <value>] [--sdkVersion <value>] [--runtimeVersion <value>]
[--appIdentifier <value>] [--buildProfile <value>] [--gitCommitHash <value>] [--limit <value>]
OPTIONS
--appBuildVersion=appBuildVersion
--appIdentifier=appIdentifier
--appVersion=appVersion
--buildProfile=buildProfile
--channel=channel
FLAGS
--appBuildVersion=<value>
--appIdentifier=<value>
--appVersion=<value>
--buildProfile=<value>
--channel=<value>
--distribution=(store|internal|simulator)
--gitCommitHash=gitCommitHash
--gitCommitHash=<value>
--json Enable JSON output, non-JSON messages will be printed
to stderr
--limit=limit
--limit=<value>
--platform=(all|android|ios)
--runtimeVersion=runtimeVersion
--sdkVersion=sdkVersion
--runtimeVersion=<value>
--sdkVersion=<value>
--status=(new|in-queue|in-progress|errored|finished|canceled)
DESCRIPTION
list all builds for your project
```
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/list.ts)_
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/build/list.ts)_
## `eas build:view [BUILD_ID]`
@@ -212,13 +371,94 @@ view a build for your project
```
USAGE
$ eas build:view [BUILD_ID]
$ eas build:view [BUILD_ID] [--json]
OPTIONS
FLAGS
--json Enable JSON output, non-JSON messages will be printed to stderr
DESCRIPTION
view a build for your project
```
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/build/view.ts)_
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/build/view.ts)_
## `eas channel:create [NAME]`
Create a channel on the current project.
```
USAGE
$ eas channel:create [NAME] [--json]
ARGUMENTS
NAME Name of the channel to create
FLAGS
--json print output as a JSON object with the new channel ID, name and branch mapping.
DESCRIPTION
Create a channel on the current project.
```
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/channel/create.ts)_
## `eas channel:edit [NAME]`
Point a channel at a new branch.
```
USAGE
$ eas channel:edit [NAME] [--branch <value>] [--json]
ARGUMENTS
NAME Name of the channel to edit
FLAGS
--branch=<value> Name of the branch to point to
--json print output as a JSON object with the channel ID, name and branch mapping.
DESCRIPTION
Point a channel at a new branch.
```
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/channel/edit.ts)_
## `eas channel:list`
List all channels on the current project.
```
USAGE
$ eas channel:list [--json]
FLAGS
--json print output as a JSON object with the channel ID, name and branch mapping.
DESCRIPTION
List all channels on the current project.
```
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/channel/list.ts)_
## `eas channel:view [NAME]`
View a channel on the current project.
```
USAGE
$ eas channel:view [NAME] [--json]
ARGUMENTS
NAME Name of the channel to view
FLAGS
--json print output as a JSON object with the channel ID, name and branch mapping.
DESCRIPTION
View a channel on the current project.
```
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/channel/view.ts)_
## `eas config`
@@ -226,14 +466,17 @@ show the eas.json config
```
USAGE
$ eas config
$ eas config [-p android|ios] [--profile <value>]
OPTIONS
FLAGS
-p, --platform=(android|ios)
--profile=profile
--profile=<value>
DESCRIPTION
show the eas.json config
```
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/config.ts)_
## `eas credentials`
@@ -242,9 +485,12 @@ manage your credentials
```
USAGE
$ eas credentials
DESCRIPTION
manage your credentials
```
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/credentials.ts)_
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/credentials.ts)_
## `eas device:create`
@@ -253,9 +499,12 @@ register new Apple Devices to use for internal distribution
```
USAGE
$ eas device:create
DESCRIPTION
register new Apple Devices to use for internal distribution
```
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/device/create.ts)_
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/device/create.ts)_
## `eas device:list`
@@ -263,13 +512,16 @@ list all registered devices for your account
```
USAGE
$ eas device:list
$ eas device:list [--apple-team-id <value>]
OPTIONS
--apple-team-id=apple-team-id
FLAGS
--apple-team-id=<value>
DESCRIPTION
list all registered devices for your account
```
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/device/list.ts)_
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/device/list.ts)_
## `eas device:view [UDID]`
@@ -278,9 +530,12 @@ view a device for your project
```
USAGE
$ eas device:view [UDID]
DESCRIPTION
view a device for your project
```
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/device/view.ts)_
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/device/view.ts)_
## `eas diagnostics`
@@ -289,26 +544,32 @@ log environment info to the console
```
USAGE
$ eas diagnostics
DESCRIPTION
log environment info to the console
```
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/diagnostics.ts)_
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/diagnostics.ts)_
## `eas help [COMMAND]`
display help for eas
Display help for eas.
```
USAGE
$ eas help [COMMAND]
$ eas help [COMMAND] [-n]
ARGUMENTS
COMMAND command to show help for
COMMAND Command to show help for.
OPTIONS
--all see all commands in CLI
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for eas.
```
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.5/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.10/src/commands/help.ts)_
## `eas project:info`
@@ -317,9 +578,12 @@ information about the current project
```
USAGE
$ eas project:info
DESCRIPTION
information about the current project
```
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/project/info.ts)_
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/project/info.ts)_
## `eas project:init`
@@ -329,11 +593,14 @@ create or link an EAS project
USAGE
$ eas project:init
DESCRIPTION
create or link an EAS project
ALIASES
$ eas init
```
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/project/init.ts)_
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/project/init.ts)_
## `eas secret:create`
@@ -341,16 +608,19 @@ Create an environment secret on the current project or owner account.
```
USAGE
$ eas secret:create
$ eas secret:create [--scope account|project] [--name <value>] [--value <value>] [--force]
OPTIONS
FLAGS
--force Delete and recreate existing secrets
--name=name Name of the secret
--name=<value> Name of the secret
--scope=(account|project) [default: project] Scope for the secret
--value=value Value of the secret
--value=<value> Value of the secret
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/v0.40.0/packages/eas-cli/src/commands/secret/create.ts)_
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/secret/create.ts)_
## `eas secret:delete`
@@ -358,16 +628,18 @@ Delete an environment secret by ID.
```
USAGE
$ eas secret:delete
$ eas secret:delete [--id <value>]
OPTIONS
--id=id ID of the secret to delete
FLAGS
--id=<value> ID of the secret to delete
DESCRIPTION
Delete an environment secret by ID.
Unsure where to find the secret's ID? Run eas secret:list
```
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/secret/delete.ts)_
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/secret/delete.ts)_
## `eas secret:list`
@@ -376,9 +648,12 @@ Lists environment secrets available for your current app
```
USAGE
$ eas secret:list
DESCRIPTION
Lists environment secrets available for your current app
```
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/secret/list.ts)_
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/secret/list.ts)_
## `eas submit`
@@ -386,33 +661,111 @@ Submit build archive to App Store Connect
```
USAGE
$ eas submit
$ eas submit [-p android|ios|all] [--profile <value>] [--latest | --id <value> | --path <value> | --url
<value>] [--verbose] [--wait] [--non-interactive]
OPTIONS
FLAGS
-p, --platform=(android|ios|all)
--id=id ID of the build to submit
--id=<value> ID of the build to submit
--latest Submit the latest build for specified platform
--non-interactive Run command in non-interactive mode
--path=path Path to the .apk/.aab/.ipa file
--profile=profile Name of the submit profile from eas.json. Defaults to "production" if defined in
--path=<value> Path to the .apk/.aab/.ipa file
--profile=<value> Name of the submit profile from eas.json. Defaults to "production" if defined in
eas.json.
--url=url App archive url
--url=<value> App archive url
--verbose Always print logs from Submission Service
--[no-]wait Wait for submission to complete
DESCRIPTION
See how to configure submits with eas.json:
https://docs.expo.dev/submit/eas-json/
Submit build archive to App Store Connect
See how to configure submits with eas.json: https://docs.expo.dev/submit/eas-json/
ALIASES
$ eas build:submit
```
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/submit.ts)_
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/submit.ts)_
## `eas update`
Publish an update group.
```
USAGE
$ eas update [--branch <value>] [--message <value>] [--republish | --input-dir <value> | --skip-bundler]
[--group <value> | | ] [-p android|ios|all] [--json] [--auto]
FLAGS
-p, --platform=(android|ios|all) [default: all]
--auto Use the current git branch and commit message for the EAS branch and update message
--branch=<value> Branch to publish the update group on
--group=<value> Update group to republish
--input-dir=<value> [default: dist] Location of the bundle
--json Enable JSON output, non-JSON messages will be printed to stderr
--message=<value> A short message describing the update
--republish Republish an update group
--skip-bundler Skip running Expo CLI to bundle the app before publishing
DESCRIPTION
Publish an update group.
```
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/update/index.ts)_
## `eas update:configure`
Configure the project to support EAS Update.
```
USAGE
$ eas update:configure
DESCRIPTION
Configure the project to support EAS Update.
```
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/update/configure.ts)_
## `eas update:delete GROUPID`
Delete all the updates in an update Group.
```
USAGE
$ eas update:delete [GROUPID] [--json]
ARGUMENTS
GROUPID The ID of an update group to delete.
FLAGS
--json Return a json with the group ID of the deleted updates.
DESCRIPTION
Delete all the updates in an update Group.
```
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/update/delete.ts)_
## `eas update:view GROUPID`
Update group details.
```
USAGE
$ eas update:view [GROUPID] [--json]
ARGUMENTS
GROUPID The ID of an update group.
FLAGS
--json Return a json with the updates belonging to the group.
DESCRIPTION
Update group details.
```
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/update/view.ts)_
## `eas webhook:create`
@@ -420,18 +773,19 @@ Create a webhook on the current project.
```
USAGE
$ eas webhook:create
$ eas webhook:create [--event BUILD|SUBMIT] [--url <value>] [--secret <value>]
OPTIONS
FLAGS
--event=(BUILD|SUBMIT) Event type that triggers the webhook
--secret=secret Secret used to create a hash signature of the request payload, provided in the
--secret=<value> Secret used to create a hash signature of the request payload, provided in the
'Expo-Signature' header.
--url=<value> Webhook URL
--url=url Webhook URL
DESCRIPTION
Create a webhook on the current project.
```
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/create.ts)_
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/webhook/create.ts)_
## `eas webhook:delete [ID]`
@@ -443,9 +797,12 @@ USAGE
ARGUMENTS
ID ID of the webhook to delete
DESCRIPTION
Delete a webhook on the current project.
```
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/delete.ts)_
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/webhook/delete.ts)_
## `eas webhook:list`
@@ -453,13 +810,16 @@ List webhooks on the current project.
```
USAGE
$ eas webhook:list
$ eas webhook:list [--event BUILD|SUBMIT]
OPTIONS
FLAGS
--event=(BUILD|SUBMIT) Event type that triggers the webhook
DESCRIPTION
List webhooks on the current project.
```
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/list.ts)_
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/webhook/list.ts)_
## `eas webhook:update`
@@ -467,19 +827,20 @@ Create a webhook on the current project.
```
USAGE
$ eas webhook:update
$ eas webhook:update --id <value> [--event BUILD|SUBMIT] [--url <value>] [--secret <value>]
OPTIONS
FLAGS
--event=(BUILD|SUBMIT) Event type that triggers the webhook
--id=id (required) Webhook ID
--secret=secret Secret used to create a hash signature of the request payload, provided in the
--id=<value> (required) Webhook ID
--secret=<value> Secret used to create a hash signature of the request payload, provided in the
'Expo-Signature' header.
--url=<value> Webhook URL
--url=url Webhook URL
DESCRIPTION
Create a webhook on the current project.
```
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/update.ts)_
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/webhook/update.ts)_
## `eas webhook:view ID`
@@ -487,11 +848,14 @@ View a webhook on the current project.
```
USAGE
$ eas webhook:view ID
$ eas webhook:view [ID]
ARGUMENTS
ID ID of the webhook to view
DESCRIPTION
View a webhook on the current project.
```
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.40.0/packages/eas-cli/src/commands/webhook/view.ts)_
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.42.4/packages/eas-cli/src/commands/webhook/view.ts)_
<!-- commandsstop -->
+3 -4
View File
@@ -1,6 +1,5 @@
#!/usr/bin/env node
require('@oclif/command')
.run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'));
const oclif = require('@oclif/core')
oclif.run().then(require('@oclif/core/flush')).catch(require('@oclif/core/handle'))
+202
View File
@@ -4807,6 +4807,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "reactNativeVersion",
"description": "",
"args": [],
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "releaseChannel",
"description": "",
@@ -12902,6 +12914,18 @@
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "couponCode",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
@@ -12991,6 +13015,34 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "discount",
"description": "",
"args": [],
"type": {
"kind": "OBJECT",
"name": "InvoiceDiscount",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "totalDiscountedAmount",
"description": "",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "lineItems",
"description": "",
@@ -13085,6 +13137,132 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "InvoiceDiscount",
"description": "",
"fields": [
{
"name": "id",
"description": "",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "name",
"description": "",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "type",
"description": "",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "InvoiceDiscountType",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "duration",
"description": "",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "durationInMonths",
"description": "",
"args": [],
"type": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "amount",
"description": "The coupon's discount value, in percentage or in dollar amount",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Int",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "InvoiceDiscountType",
"description": "",
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "PERCENTAGE",
"description": "",
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "AMOUNT",
"description": "",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "InvoiceLineItem",
@@ -14864,6 +15042,18 @@
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "couponCode",
"description": null,
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"type": {
@@ -18829,6 +19019,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "reactNativeVersion",
"description": "",
"type": {
"kind": "SCALAR",
"name": "String",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "releaseChannel",
"description": "",
+16 -11
View File
@@ -1,7 +1,7 @@
{
"name": "eas-cli",
"description": "EAS command line tool",
"version": "0.40.0",
"version": "0.42.4",
"author": "Expo <[email protected]>",
"bin": {
"eas": "./bin/run"
@@ -12,20 +12,18 @@
"@expo/config": "6.0.11",
"@expo/config-plugins": "4.0.11",
"@expo/eas-build-job": "0.2.61",
"@expo/eas-json": "^0.40.0",
"@expo/eas-json": "0.42.3",
"@expo/json-file": "8.2.34",
"@expo/pkcs12": "0.0.6",
"@expo/plist": "0.0.16",
"@expo/plugin-warn-if-update-available": "1.7.1",
"@expo/plugin-warn-if-update-available": "2.0.1",
"@expo/prebuild-config": "3.0.11",
"@expo/results": "1.0.0",
"@expo/rudder-sdk-node": "1.1.1",
"@expo/spawn-async": "1.5.0",
"@expo/timeago.js": "1.0.0",
"@oclif/command": "1.8.3",
"@oclif/config": "1.17.1",
"@oclif/errors": "1.3.5",
"@oclif/plugin-help": "3.2.5",
"@oclif/core": "1.0.10",
"@oclif/plugin-help": "5.1.10",
"@urql/core": "2.3.1",
"@urql/exchange-retry": "0.3.0",
"chalk": "4.1.2",
@@ -165,18 +163,25 @@
}
}
}
}
},
"additionalHelpFlags": [
"-h"
],
"additionalVersionFlags": [
"-v"
]
},
"repository": "expo/eas-cli",
"scripts": {
"postpack": "rm -f oclif.manifest.json",
"prepack": "rm -rf build && yarn build && yarn oclif-dev manifest && yarn oclif-dev readme && node patch-readme",
"prepack": "./scripts/prepack.sh",
"pretarball-ci": "./scripts/pretarball-ci.sh",
"build": "tsc --project tsconfig.build.json",
"watch": "yarn build --watch --preserveWatchOutput",
"typecheck": "tsc",
"test": "jest",
"version": "yarn oclif-dev readme && node patch-readme && git add README.md",
"version": "yarn oclif readme && node scripts/patch-readme && git add README.md",
"generate-graphql-code": "graphql-codegen --config graphql-codegen.yml",
"clean": "rm -rf dist build node_modules yarn-error.log"
"clean": "rm -rf dist build tmp node_modules yarn-error.log"
}
}
@@ -1,7 +1,7 @@
const { promises: fs } = require('fs');
(async () => {
// Patch `oclif-dev readme` path and link generation
// Patch `oclif readme` path and link generation
let readmeContent = await fs.readFile('README.md', 'utf8');
readmeContent = readmeContent.replace(/\[build\//g, '[src/');
readmeContent = readmeContent.replace(/build\/commands/g, 'packages/eas-cli/src/commands');
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -eo pipefail
rm -rf build
yarn build
if [ -z "$CLI_SIZE_CHECK" ]; then
yarn oclif manifest
fi
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -eo pipefail
EAS_CLI_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )"
PACKAGE_JSON_PATH="$EAS_CLI_DIR/package.json"
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' "s/\\\"@expo\/eas-json\\\": \\\".*\\\"/\\\"@expo\/eas-json\\\": \\\"file:..\/..\/..\/eas-json\\\"/g" $PACKAGE_JSON_PATH
else
sed -i "s/\\\"@expo\/eas-json\\\": \\\".*\\\"/\\\"@expo\/eas-json\\\": \\\"file:..\/..\/..\/eas-json\\\"/g" $PACKAGE_JSON_PATH
fi
+10
View File
@@ -57,3 +57,13 @@ export function getExpoWebsiteBaseUrl(): string {
return `https://expo.dev`;
}
}
export function getEASUpdateURL(projectId: string): string {
if (process.env.EXPO_STAGING) {
return new URL(projectId, `https://staging-u.expo.dev`).href;
} else if (process.env.EXPO_LOCAL) {
return new URL(`expo-updates/${projectId}`, `http://127.0.0.1:3000`).href;
} else {
return new URL(projectId, `https://u.expo.dev`).href;
}
}
+3 -3
View File
@@ -77,7 +77,7 @@ export async function prepareBuildRequestForPlatformAsync<
);
}
const projectArchive = ctx.local
const projectArchive = ctx.localBuildOptions.enable
? ({
type: ArchiveSourceType.PATH,
path: (await makeProjectTarballAsync()).path,
@@ -94,8 +94,8 @@ export async function prepareBuildRequestForPlatformAsync<
});
return async () => {
if (ctx.local) {
await runLocalBuildAsync(job);
if (ctx.localBuildOptions.enable) {
await runLocalBuildAsync(job, ctx.localBuildOptions);
return undefined;
} else {
try {
+3 -3
View File
@@ -1,7 +1,7 @@
import { getConfig } from '@expo/config';
import { Platform, Workflow } from '@expo/eas-build-job';
import { EasJson, EasJsonReader } from '@expo/eas-json';
import { error } from '@oclif/errors';
import { Errors } from '@oclif/core';
import chalk from 'chalk';
import fs from 'fs-extra';
@@ -39,13 +39,13 @@ export async function ensureProjectConfiguredAsync(
platform: requestedPlatform,
});
if (await getVcsClient().isCommitRequiredAsync()) {
error(
Errors.error(
'Build process requires clean working tree, please commit all your changes and run `eas build` again',
{ exit: 1 }
);
}
} else {
error(
Errors.error(
`Aborting, please run ${chalk.bold('eas build:configure')} or create eas.json (${learnMore(
'https://docs.expo.dev/build/eas-json'
)})`,
+2 -1
View File
@@ -10,6 +10,7 @@ import { RequestedPlatform } from '../platform';
import { GradleBuildContext } from '../project/android/gradle';
import { XcodeBuildContext } from '../project/ios/scheme';
import { Actor } from '../user/User';
import { LocalBuildOptions } from './local';
export interface ConfigureContext {
user: Actor;
@@ -44,7 +45,7 @@ export interface BuildContext<T extends Platform> {
clearCache: boolean;
credentialsCtx: CredentialsContext;
exp: ExpoConfig;
local: boolean;
localBuildOptions: LocalBuildOptions;
nonInteractive: boolean;
platform: T;
projectDir: string;
+4 -3
View File
@@ -15,12 +15,13 @@ import { ensureLoggedInAsync } from '../user/actions';
import { createAndroidContextAsync } from './android/build';
import { BuildContext, CommonContext } from './context';
import { createIosContextAsync } from './ios/build';
import { LocalBuildOptions } from './local';
export async function createBuildContextAsync<T extends Platform>({
buildProfileName,
buildProfile,
clearCache = false,
local,
localBuildOptions,
nonInteractive = false,
platform,
projectDir,
@@ -29,7 +30,7 @@ export async function createBuildContextAsync<T extends Platform>({
buildProfileName: string;
buildProfile: BuildProfile<T>;
clearCache: boolean;
local: boolean;
localBuildOptions: LocalBuildOptions;
nonInteractive: boolean;
platform: T;
projectDir: string;
@@ -74,7 +75,7 @@ export async function createBuildContextAsync<T extends Platform>({
clearCache,
credentialsCtx,
exp,
local,
localBuildOptions,
nonInteractive,
platform,
projectDir,
+45 -6
View File
@@ -1,15 +1,54 @@
import { Job } from '@expo/eas-build-job';
import spawnAsync from '@expo/spawn-async';
import { ChildProcess } from 'child_process';
import semver from 'semver';
const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
const PLUGIN_PACKAGE_VERSION = '0.0.54';
import { ora } from '../ora';
export async function runLocalBuildAsync(job: Job): Promise<void> {
const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
const PLUGIN_PACKAGE_VERSION = '0.0.57';
export interface LocalBuildOptions {
enable: boolean;
skipCleanup?: boolean;
skipNativeBuild?: boolean;
artifactsDir?: string;
workingdir?: string;
verbose?: boolean;
}
export async function runLocalBuildAsync(job: Job, options: LocalBuildOptions): Promise<void> {
const { command, args } = await getCommandAndArgsAsync(job);
await spawnAsync(command, args, {
stdio: 'inherit',
});
let spinner;
if (!options.verbose) {
spinner = ora().start(options.skipNativeBuild ? 'Preparing project' : 'Building project');
}
let childProcess: ChildProcess | undefined;
const interruptHandler = (): void => {
if (childProcess) {
childProcess.kill();
}
};
process.on('SIGINT', interruptHandler);
try {
const spawnPromise = spawnAsync(command, args, {
stdio: options.verbose ? 'inherit' : 'pipe',
env: {
...process.env,
EAS_LOCAL_BUILD_WORKINGDIR: options.workingdir ?? process.env.EAS_LOCAL_BUILD_WORKINGDIR,
...(options.skipCleanup || options.skipNativeBuild
? { EAS_LOCAL_BUILD_SKIP_CLEANUP: '1' }
: {}),
...(options.skipNativeBuild ? { EAS_LOCAL_BUILD_SKIP_NATIVE_BUILD: '1' } : {}),
...(options.artifactsDir ? { EAS_LOCAL_BUILD_ARTIFACTS_DIR: options.artifactsDir } : {}),
},
});
childProcess = spawnPromise.child;
await spawnPromise;
} finally {
process.removeListener('SIGINT', interruptHandler);
spinner?.stop();
}
}
async function getCommandAndArgsAsync(job: Job): Promise<{ command: string; args: string[] }> {
@@ -0,0 +1,257 @@
import { Platform, Workflow } from '@expo/eas-build-job';
import { BuildProfile, SubmitProfile } from '@expo/eas-json';
import chalk from 'chalk';
import nullthrows from 'nullthrows';
import { AppPlatform, BuildFragment, BuildStatus, SubmissionFragment } from '../graphql/generated';
import { toAppPlatform, toPlatform } from '../graphql/types/AppPlatform';
import Log from '../log';
import {
RequestedPlatform,
appPlatformDisplayNames,
appPlatformEmojis,
toPlatforms,
} from '../platform';
import { checkExpoSdkIsSupportedAsync } from '../project/expoSdk';
import { validateMetroConfigForManagedWorkflowAsync } from '../project/metroConfig';
import { createSubmissionContextAsync } from '../submit/context';
import {
submitAsync,
waitToCompleteAsync as waitForSubmissionsToCompleteAsync,
} from '../submit/submit';
import { printSubmissionDetailsUrls } from '../submit/utils/urls';
import { ProfileData, getProfilesAsync } from '../utils/profiles';
import { getVcsClient } from '../vcs';
import { prepareAndroidBuildAsync } from './android/build';
import { BuildRequestSender, waitForBuildEndAsync } from './build';
import { ensureProjectConfiguredAsync } from './configure';
import { BuildContext } from './context';
import { createBuildContextAsync } from './createContext';
import { prepareIosBuildAsync } from './ios/build';
import { LocalBuildOptions } from './local';
import { ensureExpoDevClientInstalledForDevClientBuildsAsync } from './utils/devClient';
import { printBuildResults, printLogsUrls } from './utils/printBuildInfo';
import { ensureRepoIsCleanAsync } from './utils/repository';
let metroConfigValidated = false;
let sdkVersionChecked = false;
export interface BuildFlags {
requestedPlatform: RequestedPlatform;
skipProjectConfiguration: boolean;
profile?: string;
nonInteractive: boolean;
wait: boolean;
clearCache: boolean;
json: boolean;
autoSubmit: boolean;
submitProfile?: string;
localBuildOptions: LocalBuildOptions;
}
export async function runBuildAndSubmitAsync(projectDir: string, flags: BuildFlags): Promise<void> {
await getVcsClient().ensureRepoExistsAsync();
await ensureRepoIsCleanAsync(flags.nonInteractive);
await ensureProjectConfiguredAsync(projectDir, flags.requestedPlatform);
const platforms = toPlatforms(flags.requestedPlatform);
const buildProfiles = await getProfilesAsync({
type: 'build',
projectDir,
platforms,
profileName: flags.profile ?? undefined,
});
await ensureExpoDevClientInstalledForDevClientBuildsAsync({
projectDir,
nonInteractive: flags.nonInteractive,
buildProfiles,
});
const startedBuilds: {
build: BuildFragment;
buildProfile: ProfileData<'build'>;
}[] = [];
const buildCtxByPlatform: { [p in AppPlatform]?: BuildContext<Platform> } = {};
for (const buildProfile of buildProfiles) {
const { build: maybeBuild, buildCtx } = await prepareAndStartBuildAsync({
projectDir,
flags,
moreBuilds: platforms.length > 1,
buildProfile,
});
if (maybeBuild) {
startedBuilds.push({ build: maybeBuild, buildProfile });
}
buildCtxByPlatform[toAppPlatform(buildProfile.platform)] = buildCtx;
}
if (flags.localBuildOptions.enable) {
return;
}
Log.newLine();
printLogsUrls(startedBuilds.map(startedBuild => startedBuild.build));
Log.newLine();
const submissions: SubmissionFragment[] = [];
if (flags.autoSubmit) {
const submitProfiles = await getProfilesAsync({
projectDir,
platforms,
profileName: flags.submitProfile,
type: 'submit',
});
for (const startedBuild of startedBuilds) {
const submitProfile = nullthrows(
submitProfiles.find(
({ platform }) => toAppPlatform(platform) === startedBuild.build.platform
)
).profile;
const submission = await prepareAndStartSubmissionAsync({
build: startedBuild.build,
buildCtx: nullthrows(buildCtxByPlatform[startedBuild.build.platform]),
moreBuilds: startedBuilds.length > 1,
projectDir,
buildProfile: startedBuild.buildProfile.profile,
submitProfile,
nonInteractive: flags.nonInteractive,
});
submissions.push(submission);
}
Log.newLine();
printSubmissionDetailsUrls(submissions);
Log.newLine();
}
if (!flags.wait) {
return;
}
const builds = await waitForBuildEndAsync(startedBuilds.map(({ build }) => build.id));
printBuildResults(builds, flags.json);
const haveAllBuildsFailedOrCanceled = builds.every(
build => build?.status && [BuildStatus.Errored, BuildStatus.Canceled].includes(build?.status)
);
if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
exitWithNonZeroCodeIfSomeBuildsFailed(builds);
} else {
// the following function also exits with non zero code if any of the submissions failed
await waitForSubmissionsToCompleteAsync(submissions);
}
}
async function prepareAndStartBuildAsync({
projectDir,
flags,
moreBuilds,
buildProfile,
}: {
projectDir: string;
flags: BuildFlags;
moreBuilds: boolean;
buildProfile: ProfileData<'build'>;
}): Promise<{ build: BuildFragment | undefined; buildCtx: BuildContext<Platform> }> {
const buildCtx = await createBuildContextAsync({
buildProfileName: buildProfile.profileName,
clearCache: flags.clearCache,
buildProfile: buildProfile.profile,
nonInteractive: flags.nonInteractive,
platform: buildProfile.platform,
projectDir,
skipProjectConfiguration: flags.skipProjectConfiguration,
localBuildOptions: flags.localBuildOptions,
});
if (moreBuilds) {
Log.newLine();
const appPlatform = toAppPlatform(buildProfile.platform);
Log.log(
`${appPlatformEmojis[appPlatform]} ${chalk.bold(
`${appPlatformDisplayNames[appPlatform]} build`
)}`
);
}
if (buildCtx.workflow === Workflow.MANAGED) {
if (!sdkVersionChecked) {
await checkExpoSdkIsSupportedAsync(buildCtx);
sdkVersionChecked = true;
}
if (!metroConfigValidated) {
await validateMetroConfigForManagedWorkflowAsync(buildCtx);
metroConfigValidated = true;
}
}
const build = await startBuildAsync(buildCtx);
return {
build,
buildCtx,
};
}
async function startBuildAsync(ctx: BuildContext<Platform>): Promise<BuildFragment | undefined> {
let sendBuildRequestAsync: BuildRequestSender;
if (ctx.platform === Platform.ANDROID) {
sendBuildRequestAsync = await prepareAndroidBuildAsync(ctx as BuildContext<Platform.ANDROID>);
} else {
sendBuildRequestAsync = await prepareIosBuildAsync(ctx as BuildContext<Platform.IOS>);
}
return await sendBuildRequestAsync();
}
async function prepareAndStartSubmissionAsync({
build,
buildCtx,
moreBuilds,
projectDir,
buildProfile,
submitProfile,
nonInteractive,
}: {
build: BuildFragment;
buildCtx: BuildContext<Platform>;
moreBuilds: boolean;
projectDir: string;
buildProfile: BuildProfile;
submitProfile: SubmitProfile;
nonInteractive: boolean;
}): Promise<SubmissionFragment> {
const platform = toPlatform(build.platform);
const submissionCtx = await createSubmissionContextAsync({
platform,
projectDir,
projectId: build.project.id,
profile: submitProfile,
archiveFlags: { id: build.id },
nonInteractive,
env: buildProfile.env,
credentialsCtx: buildCtx.credentialsCtx,
applicationIdentifier: buildCtx.android?.applicationId ?? buildCtx.ios?.bundleIdentifier,
});
if (moreBuilds) {
Log.newLine();
Log.log(
`${appPlatformEmojis[build.platform]} ${chalk.bold(
`${appPlatformDisplayNames[build.platform]} submission`
)}`
);
}
return await submitAsync(submissionCtx);
}
function exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds: (BuildFragment | null)[]): void {
const failedBuilds = (maybeBuilds.filter(i => i) as BuildFragment[]).filter(
i => i.status === BuildStatus.Errored
);
if (failedBuilds.length > 0) {
process.exit(1);
}
}
@@ -1,5 +1,5 @@
import { Workflow } from '@expo/eas-build-job';
import { error } from '@oclif/errors';
import { Errors } from '@oclif/core';
import chalk from 'chalk';
import resolveFrom from 'resolve-from';
@@ -64,7 +64,7 @@ export async function ensureExpoDevClientInstalledForDevClientBuildsAsync({
if (install) {
await installExpoDevClientAsync(projectDir, { nonInteractive });
} else {
error(`Install ${chalk.bold('expo-dev-client')} manually and come back later.`, {
Errors.error(`Install ${chalk.bold('expo-dev-client')} manually and come back later.`, {
exit: 1,
});
}
@@ -83,7 +83,7 @@ export async function ensureExpoDevClientInstalledForDevClientBuildsAsync({
initial: false,
});
if (!shouldContinue) {
error('Come back later', { exit: 1 });
Errors.error('Come back later', { exit: 1 });
}
}
}
@@ -1,5 +1,5 @@
import { EasJsonReader } from '@expo/eas-json';
import { Command } from '@oclif/command';
import { Command } from '@oclif/core';
import semver from 'semver';
import {
@@ -21,16 +21,19 @@ export default abstract class EasCommand extends Command {
* force the user to log in
*/
protected requiresAuthentication = true;
protected mustBeRunInsideProject = true;
protected abstract runAsync(): Promise<any>;
// eslint-disable-next-line async-protect/async-suffix
async run(): Promise<any> {
await initAnalyticsAsync();
await this.applyCliConfigAsync();
if (this.mustBeRunInsideProject) {
await this.applyCliConfigAsync();
}
if (this.requiresAuthentication) {
const { flags } = this.parse();
const { flags } = await this.parse();
const nonInteractive = (flags as any)['non-interactive'] ?? false;
await ensureLoggedInAsync({ nonInteractive });
} else {
@@ -6,6 +6,7 @@ export default class AccountLogin extends EasCommand {
static description = 'log in with your Expo account';
static aliases = ['login'];
protected mustBeRunInsideProject = false;
protected requiresAuthentication = false;
async runAsync(): Promise<void> {
@@ -6,6 +6,7 @@ export default class AccountLogout extends EasCommand {
static description = 'log out';
static aliases = ['logout'];
protected mustBeRunInsideProject = false;
protected requiresAuthentication = false;
async runAsync(): Promise<void> {
@@ -8,6 +8,7 @@ export default class AccountView extends EasCommand {
static description = 'show the username you are logged in as';
static aliases = ['whoami'];
protected mustBeRunInsideProject = false;
protected requiresAuthentication = false;
async runAsync(): Promise<void> {
+1 -1
View File
@@ -10,7 +10,7 @@ export default class AnalyticsView extends EasCommand {
protected requiresAuthentication = false;
async runAsync(): Promise<void> {
const { STATUS: status } = this.parse(AnalyticsView).args;
const { STATUS: status } = (await this.parse(AnalyticsView)).args;
if (status) {
await UserSettings.setAsync('analyticsEnabled', status === 'on');
Log.withTick(`${status === 'on' ? 'Enabling' : 'Disabling'} analytics.`);
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';
@@ -51,7 +51,6 @@ export async function createUpdateBranchOnAppAsync({
}
export default class BranchCreate extends EasCommand {
static hidden = true;
static description = 'Create a branch on the current project.';
static args = [
@@ -63,7 +62,7 @@ export default class BranchCreate extends EasCommand {
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: 'return a json with the new branch ID and name.',
default: false,
}),
@@ -73,7 +72,7 @@ export default class BranchCreate extends EasCommand {
let {
args: { name },
flags,
} = this.parse(BranchCreate);
} = await this.parse(BranchCreate);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';
@@ -76,8 +76,7 @@ async function deleteBranchOnAppAsync({
}
export default class BranchDelete extends EasCommand {
static hidden = true;
static description = 'Republish an update group';
static description = 'Delete a branch on the current project';
static args = [
{
@@ -87,7 +86,7 @@ export default class BranchDelete extends EasCommand {
},
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: `return JSON with the edited branch's ID and name.`,
default: false,
}),
@@ -97,7 +96,7 @@ export default class BranchDelete extends EasCommand {
let {
args: { name },
flags: { json: jsonFlag },
} = this.parse(BranchDelete);
} = await this.parse(BranchDelete);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
+4 -6
View File
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import CliTable from 'cli-table3';
import { print } from 'graphql';
@@ -54,19 +54,17 @@ export async function listBranchesAsync({
}
export default class BranchList extends EasCommand {
static hidden = true;
static description = 'List all branches on this project.';
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: 'return output as JSON',
default: false,
}),
};
async runAsync(): Promise<void> {
const { flags } = this.parse(BranchList);
const { flags } = await this.parse(BranchList);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -76,7 +74,7 @@ export default class BranchList extends EasCommand {
Log.log(JSON.stringify(branches, null, 2));
} else {
const table = new CliTable({
head: ['branch', ...UPDATE_COLUMNS],
head: ['Branch', ...UPDATE_COLUMNS],
wordWrap: true,
});
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';
@@ -51,19 +51,18 @@ async function renameUpdateBranchOnAppAsync({
}
export default class BranchRename extends EasCommand {
static hidden = true;
static description = 'Rename a branch.';
static flags = {
from: flags.string({
from: Flags.string({
description: 'current name of the branch.',
required: false,
}),
to: flags.string({
to: Flags.string({
description: 'new name of the branch.',
required: false,
}),
json: flags.boolean({
json: Flags.boolean({
description: `return a json with the edited branch's ID and name.`,
default: false,
}),
@@ -72,7 +71,7 @@ export default class BranchRename extends EasCommand {
async runAsync(): Promise<void> {
let {
flags: { json: jsonFlag, from: currentName, to: newName },
} = this.parse(BranchRename);
} = await this.parse(BranchRename);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
+3 -4
View File
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import Table from 'cli-table3';
import gql from 'graphql-tag';
@@ -67,7 +67,6 @@ export async function viewUpdateBranchAsync({
}
export default class BranchView extends EasCommand {
static hidden = true;
static description = 'View a branch.';
static args = [
@@ -79,7 +78,7 @@ export default class BranchView extends EasCommand {
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: `return a json with the branch's ID name and recent update groups.`,
default: false,
}),
@@ -89,7 +88,7 @@ export default class BranchView extends EasCommand {
let {
args: { name },
flags: { json: jsonFlag },
} = this.parse(BranchView);
} = await this.parse(BranchView);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -115,7 +115,7 @@ export default class BuildCancel extends EasCommand {
static args = [{ name: 'BUILD_ID' }];
async runAsync(): Promise<void> {
const { BUILD_ID: buildIdFromArg } = this.parse(BuildCancel).args;
const { BUILD_ID: buildIdFromArg } = (await this.parse(BuildCancel)).args;
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,4 +1,4 @@
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import { configureAsync } from '../../build/configure';
@@ -13,7 +13,7 @@ export default class BuildConfigure extends EasCommand {
static description = 'Configure the project to support EAS Build.';
static flags = {
platform: flags.enum({
platform: Flags.enum({
description: 'Platform to configure',
char: 'p',
options: ['android', 'ios', 'all'],
@@ -21,7 +21,7 @@ export default class BuildConfigure extends EasCommand {
};
async runAsync(): Promise<void> {
const { flags } = this.parse(BuildConfigure);
const { flags } = await this.parse(BuildConfigure);
Log.log(
'💡 The following process will configure your iOS and/or Android project to be compatible with EAS Build. These changes only apply to your local project files and you can safely revert them at any time.'
+29 -267
View File
@@ -1,49 +1,18 @@
import { Platform, Workflow } from '@expo/eas-build-job';
import { BuildProfile, EasJsonReader, SubmitProfile } from '@expo/eas-json';
import { flags } from '@oclif/command';
import { error } from '@oclif/errors';
import { EasJsonReader } from '@expo/eas-json';
import { Errors, Flags } from '@oclif/core';
import chalk from 'chalk';
import figures from 'figures';
import fs from 'fs-extra';
import nullthrows from 'nullthrows';
import { prepareAndroidBuildAsync } from '../../build/android/build';
import { BuildRequestSender, waitForBuildEndAsync } from '../../build/build';
import { ensureProjectConfiguredAsync } from '../../build/configure';
import { BuildContext } from '../../build/context';
import { createBuildContextAsync } from '../../build/createContext';
import { prepareIosBuildAsync } from '../../build/ios/build';
import { ensureExpoDevClientInstalledForDevClientBuildsAsync } from '../../build/utils/devClient';
import { printBuildResults, printLogsUrls } from '../../build/utils/printBuildInfo';
import { BuildFlags, runBuildAndSubmitAsync } from '../../build/runBuildAndSubmit';
import { ensureRepoIsCleanAsync, reviewAndCommitChangesAsync } from '../../build/utils/repository';
import EasCommand from '../../commandUtils/EasCommand';
import {
AppPlatform,
BuildFragment,
BuildStatus,
SubmissionFragment,
} from '../../graphql/generated';
import { toAppPlatform, toPlatform } from '../../graphql/types/AppPlatform';
import Log, { learnMore, link } from '../../log';
import {
RequestedPlatform,
appPlatformDisplayNames,
appPlatformEmojis,
selectRequestedPlatformAsync,
toPlatforms,
} from '../../platform';
import { validateMetroConfigForManagedWorkflowAsync } from '../../project/metroConfig';
import { RequestedPlatform, selectRequestedPlatformAsync } from '../../platform';
import { findProjectRootAsync } from '../../project/projectUtils';
import { selectAsync } from '../../prompts';
import { createSubmissionContextAsync } from '../../submit/context';
import {
submitAsync,
waitToCompleteAsync as waitForSubmissionsToCompleteAsync,
} from '../../submit/submit';
import { printSubmissionDetailsUrls } from '../../submit/utils/urls';
import { easCliVersion } from '../../utils/easCli';
import { enableJsonOutput } from '../../utils/json';
import { ProfileData, getProfilesAsync } from '../../utils/profiles';
import { getVcsClient, setVcsClient } from '../../vcs';
import GitClient from '../../vcs/clients/git';
@@ -61,202 +30,96 @@ interface RawBuildFlags {
'auto-submit-with-profile'?: string;
}
interface BuildFlags {
requestedPlatform: RequestedPlatform;
skipProjectConfiguration: boolean;
profile?: string;
nonInteractive: boolean;
local: boolean;
wait: boolean;
clearCache: boolean;
json: boolean;
autoSubmit: boolean;
submitProfile?: string;
}
export default class Build extends EasCommand {
static description = 'Start a build';
static flags = {
platform: flags.enum({
platform: Flags.enum({
char: 'p',
options: ['android', 'ios', 'all'],
}),
'skip-credentials-check': flags.boolean({
'skip-credentials-check': Flags.boolean({
default: false,
hidden: true,
}),
json: flags.boolean({
json: Flags.boolean({
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
default: false,
}),
'skip-project-configuration': flags.boolean({
'skip-project-configuration': Flags.boolean({
default: false,
description: 'Skip project configuration',
}),
profile: flags.string({
profile: Flags.string({
description:
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
helpValue: 'PROFILE_NAME',
}),
'non-interactive': flags.boolean({
'non-interactive': Flags.boolean({
default: false,
description: 'Run command in non-interactive mode',
}),
local: flags.boolean({
local: Flags.boolean({
default: false,
description: 'Run build locally [experimental]',
}),
wait: flags.boolean({
wait: Flags.boolean({
default: true,
allowNo: true,
description: 'Wait for build(s) to complete',
}),
'clear-cache': flags.boolean({
'clear-cache': Flags.boolean({
default: false,
description: 'Clear cache before the build',
}),
'auto-submit': flags.boolean({
'auto-submit': Flags.boolean({
default: false,
description:
'Submit on build complete using the submit profile with the same name as the build profile',
exclusive: ['auto-submit-with-profile'],
}),
'auto-submit-with-profile': flags.string({
'auto-submit-with-profile': Flags.string({
description: 'Submit on build complete using the submit profile with provided name',
helpValue: 'PROFILE_NAME',
exclusive: ['auto-submit'],
}),
};
private metroConfigValidated = false;
async runAsync(): Promise<void> {
const { flags: rawFlags } = this.parse(Build);
const { flags: rawFlags } = await this.parse(Build);
if (rawFlags.json) {
enableJsonOutput();
}
const flags = await this.sanitizeFlagsAsync(rawFlags);
const { requestedPlatform } = flags;
const projectDir = await findProjectRootAsync();
await handleDeprecatedEasJsonAsync(projectDir, flags.nonInteractive);
await getVcsClient().ensureRepoExistsAsync();
await ensureRepoIsCleanAsync(flags.nonInteractive);
await ensureProjectConfiguredAsync(projectDir, requestedPlatform);
const platforms = toPlatforms(requestedPlatform);
const buildProfiles = await getProfilesAsync({
type: 'build',
projectDir,
platforms,
profileName: flags.profile ?? undefined,
});
await ensureExpoDevClientInstalledForDevClientBuildsAsync({
projectDir,
nonInteractive: flags.nonInteractive,
buildProfiles,
});
const startedBuilds: {
build: BuildFragment;
buildProfile: ProfileData<'build'>;
}[] = [];
const buildCtxByPlatform: { [p in AppPlatform]?: BuildContext<Platform> } = {};
for (const buildProfile of buildProfiles) {
const { build: maybeBuild, buildCtx } = await this.prepareAndStartBuildAsync({
projectDir,
flags,
moreBuilds: platforms.length > 1,
buildProfile,
});
if (maybeBuild) {
startedBuilds.push({ build: maybeBuild, buildProfile });
}
buildCtxByPlatform[toAppPlatform(buildProfile.platform)] = buildCtx;
}
if (flags.local) {
return;
}
Log.newLine();
printLogsUrls(startedBuilds.map(startedBuild => startedBuild.build));
Log.newLine();
const submissions: SubmissionFragment[] = [];
if (flags.autoSubmit) {
const submitProfiles = await getProfilesAsync({
projectDir,
platforms,
profileName: flags.submitProfile,
type: 'submit',
});
for (const startedBuild of startedBuilds) {
const submitProfile = nullthrows(
submitProfiles.find(
({ platform }) => toAppPlatform(platform) === startedBuild.build.platform
)
).profile;
const submission = await this.prepareAndStartSubmissionAsync({
build: startedBuild.build,
buildCtx: nullthrows(buildCtxByPlatform[startedBuild.build.platform]),
moreBuilds: startedBuilds.length > 1,
projectDir,
buildProfile: startedBuild.buildProfile.profile,
submitProfile,
nonInteractive: flags.nonInteractive,
});
submissions.push(submission);
}
Log.newLine();
printSubmissionDetailsUrls(submissions);
Log.newLine();
}
if (!flags.wait) {
return;
}
const builds = await waitForBuildEndAsync(startedBuilds.map(({ build }) => build.id));
printBuildResults(builds, flags.json);
const haveAllBuildsFailedOrCanceled = builds.every(
build => build?.status && [BuildStatus.Errored, BuildStatus.Canceled].includes(build?.status)
);
if (haveAllBuildsFailedOrCanceled || !flags.autoSubmit) {
this.exitWithNonZeroCodeIfSomeBuildsFailed(builds);
} else {
// the following function also exits with non zero code if any of the submissions failed
await waitForSubmissionsToCompleteAsync(submissions);
}
await runBuildAndSubmitAsync(projectDir, flags);
}
private async sanitizeFlagsAsync(flags: RawBuildFlags): Promise<BuildFlags> {
const nonInteractive = flags['non-interactive'];
if (!flags.platform && nonInteractive) {
error('--platform is required when building in non-interactive mode', { exit: 1 });
Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
}
if (flags.json && !nonInteractive) {
error('--json is allowed only when building in non-interactive mode', { exit: 1 });
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
error('Auto-submits are not yet supported when building locally', { exit: 1 });
Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
}
if (requestedPlatform === RequestedPlatform.All) {
error('Builds for multiple platforms are not supported with flag --local', { exit: 1 });
Errors.error('Builds for multiple platforms are not supported with flag --local', {
exit: 1,
});
} else if (process.platform !== 'darwin' && requestedPlatform === RequestedPlatform.Ios) {
error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
}
}
@@ -274,7 +137,11 @@ export default class Build extends EasCommand {
skipProjectConfiguration: flags['skip-project-configuration'],
profile,
nonInteractive,
local: flags['local'],
localBuildOptions: flags['local']
? { enable: true, verbose: true }
: {
enable: false,
},
wait: flags['wait'],
clearCache: flags['clear-cache'],
json: flags['json'],
@@ -282,111 +149,6 @@ export default class Build extends EasCommand {
submitProfile: flags['auto-submit-with-profile'] ?? profile,
};
}
private async prepareAndStartBuildAsync({
projectDir,
flags,
moreBuilds,
buildProfile,
}: {
projectDir: string;
flags: BuildFlags;
moreBuilds: boolean;
buildProfile: ProfileData<'build'>;
}): Promise<{ build: BuildFragment | undefined; buildCtx: BuildContext<Platform> }> {
const buildCtx = await createBuildContextAsync({
buildProfileName: buildProfile.profileName,
clearCache: flags.clearCache,
buildProfile: buildProfile.profile,
local: flags.local,
nonInteractive: flags.nonInteractive,
platform: buildProfile.platform,
projectDir,
skipProjectConfiguration: flags.skipProjectConfiguration,
});
if (moreBuilds) {
Log.newLine();
const appPlatform = toAppPlatform(buildProfile.platform);
Log.log(
`${appPlatformEmojis[appPlatform]} ${chalk.bold(
`${appPlatformDisplayNames[appPlatform]} build`
)}`
);
}
if (buildCtx.workflow === Workflow.MANAGED && !this.metroConfigValidated) {
await validateMetroConfigForManagedWorkflowAsync(buildCtx);
this.metroConfigValidated = true;
}
const build = await this.startBuildAsync(buildCtx);
return {
build,
buildCtx,
};
}
private async startBuildAsync(ctx: BuildContext<Platform>): Promise<BuildFragment | undefined> {
let sendBuildRequestAsync: BuildRequestSender;
if (ctx.platform === Platform.ANDROID) {
sendBuildRequestAsync = await prepareAndroidBuildAsync(ctx as BuildContext<Platform.ANDROID>);
} else {
sendBuildRequestAsync = await prepareIosBuildAsync(ctx as BuildContext<Platform.IOS>);
}
return await sendBuildRequestAsync();
}
private async prepareAndStartSubmissionAsync({
build,
buildCtx,
moreBuilds,
projectDir,
buildProfile,
submitProfile,
nonInteractive,
}: {
build: BuildFragment;
buildCtx: BuildContext<Platform>;
moreBuilds: boolean;
projectDir: string;
buildProfile: BuildProfile;
submitProfile: SubmitProfile;
nonInteractive: boolean;
}): Promise<SubmissionFragment> {
const platform = toPlatform(build.platform);
const submissionCtx = await createSubmissionContextAsync({
platform,
projectDir,
projectId: build.project.id,
profile: submitProfile,
archiveFlags: { id: build.id },
nonInteractive,
env: buildProfile.env,
credentialsCtx: buildCtx.credentialsCtx,
applicationIdentifier: buildCtx.android?.applicationId ?? buildCtx.ios?.bundleIdentifier,
});
if (moreBuilds) {
Log.newLine();
Log.log(
`${appPlatformEmojis[build.platform]} ${chalk.bold(
`${appPlatformDisplayNames[build.platform]} submission`
)}`
);
}
return await submitAsync(submissionCtx);
}
private exitWithNonZeroCodeIfSomeBuildsFailed(maybeBuilds: (BuildFragment | null)[]): void {
const failedBuilds = (maybeBuilds.filter(i => i) as BuildFragment[]).filter(
i => i.status === BuildStatus.Errored
);
if (failedBuilds.length > 0) {
process.exit(1);
}
}
}
export async function handleDeprecatedEasJsonAsync(
@@ -0,0 +1,128 @@
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import fs from 'fs-extra';
import path from 'path';
import { v4 as uuidv4 } from 'uuid';
import { runBuildAndSubmitAsync } from '../../build/runBuildAndSubmit';
import EasCommand from '../../commandUtils/EasCommand';
import Log from '../../log';
import { ora } from '../../ora';
import { RequestedPlatform } from '../../platform';
import { findProjectRootAsync } from '../../project/projectUtils';
import { getTmpDirectory } from '../../utils/paths';
import { getVcsClient } from '../../vcs';
enum InspectStage {
ARCHIVE = 'archive',
PRE_BUILD = 'pre-build',
POST_BUILD = 'post-build',
}
const STAGE_DESCRIPTION = `Stage of the build you want to inspect.
archive - builds the project archive that would be uploaded to EAS when building
pre-build - prepares the project to be built with Gradle/Xcode. Does not run the native build.
post-build - builds the native project and leaves the output directory for inspection`;
export default class BuildInspect extends EasCommand {
static description =
'Inspect the state of the project at specific build stages. Useful for troubleshooting.';
static flags = {
platform: Flags.enum({
char: 'p',
options: [RequestedPlatform.Android, RequestedPlatform.Ios],
required: true,
}),
profile: Flags.string({
description:
'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
helpValue: 'PROFILE_NAME',
}),
stage: Flags.enum({
char: 's',
description: STAGE_DESCRIPTION,
options: [InspectStage.ARCHIVE, InspectStage.PRE_BUILD, InspectStage.POST_BUILD],
required: true,
}),
output: Flags.string({
description: 'Output directory.',
required: true,
helpValue: 'OUTPUT_DIRECTORY',
}),
force: Flags.boolean({
description: 'Delete OUTPUT_DIRECTORY if it already exists.',
default: false,
}),
verbose: Flags.boolean({
default: false,
}),
};
async runAsync(): Promise<void> {
const { flags } = await this.parse(BuildInspect);
const outputDirectory = path.resolve(process.cwd(), flags.output);
await this.prepareOutputDirAsync(outputDirectory, flags.force);
if (flags.stage === InspectStage.ARCHIVE) {
const vcs = getVcsClient();
await vcs.ensureRepoExistsAsync();
await vcs.makeShallowCopyAsync(outputDirectory);
Log.withTick(`Project saved to ${outputDirectory}`);
} else {
const projectDir = await findProjectRootAsync();
const tmpWorkingdir = path.join(getTmpDirectory(), uuidv4());
try {
await runBuildAndSubmitAsync(projectDir, {
skipProjectConfiguration: false,
nonInteractive: false,
wait: true,
clearCache: false,
json: false,
autoSubmit: false,
requestedPlatform: flags.platform,
profile: flags.profile,
localBuildOptions: {
enable: true,
...(flags.stage === InspectStage.PRE_BUILD ? { skipNativeBuild: true } : {}),
...(flags.stage === InspectStage.POST_BUILD ? { skipCleanup: true } : {}),
verbose: flags.verbose,
workingdir: tmpWorkingdir,
artifactsDir: path.join(tmpWorkingdir, 'artifacts'),
},
});
if (!flags.verbose) {
Log.log(chalk.green('Build successful'));
}
} catch (err) {
if (!flags.verbose) {
Log.error('Build failed');
Log.error(`Re-run this command with ${chalk.bold('--verbose')} flag to see the logs`);
}
} finally {
const spinner = ora().start(`Copying project build directory to ${outputDirectory}`);
try {
const tmpBuildDirectory = path.join(tmpWorkingdir, 'build');
if (await fs.pathExists(tmpBuildDirectory)) {
await fs.copy(tmpBuildDirectory, outputDirectory);
}
await fs.remove(tmpWorkingdir);
spinner.succeed(`Project build directory saved to ${outputDirectory}`);
} catch (err) {
spinner.fail();
throw err;
}
}
}
}
private async prepareOutputDirAsync(outputDir: string, force: boolean): Promise<void> {
if (await fs.pathExists(outputDir)) {
if (force) {
await fs.remove(outputDir);
} else {
throw new Error(`Directory ${outputDir} already exists`);
}
}
await fs.mkdirp(outputDir);
}
}
+15 -15
View File
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import { BuildDistributionType, BuildStatus } from '../../build/types';
@@ -25,13 +25,13 @@ export default class BuildList extends EasCommand {
static description = 'list all builds for your project';
static flags = {
platform: flags.enum({
platform: Flags.enum({
options: [RequestedPlatform.All, RequestedPlatform.Android, RequestedPlatform.Ios],
}),
json: flags.boolean({
json: Flags.boolean({
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
}),
status: flags.enum({
status: Flags.enum({
options: [
BuildStatus.NEW,
BuildStatus.IN_QUEUE,
@@ -41,26 +41,26 @@ export default class BuildList extends EasCommand {
BuildStatus.CANCELED,
],
}),
distribution: flags.enum({
distribution: Flags.enum({
options: [
BuildDistributionType.STORE,
BuildDistributionType.INTERNAL,
BuildDistributionType.SIMULATOR,
],
}),
channel: flags.string(),
appVersion: flags.string(),
appBuildVersion: flags.string(),
sdkVersion: flags.string(),
runtimeVersion: flags.string(),
appIdentifier: flags.string(),
buildProfile: flags.string(),
gitCommitHash: flags.string(),
limit: flags.integer(),
channel: Flags.string(),
appVersion: Flags.string(),
appBuildVersion: Flags.string(),
sdkVersion: Flags.string(),
runtimeVersion: Flags.string(),
appIdentifier: Flags.string(),
buildProfile: Flags.string(),
gitCommitHash: Flags.string(),
limit: Flags.integer(),
};
async runAsync(): Promise<void> {
const { flags } = this.parse(BuildList);
const { flags } = await this.parse(BuildList);
const {
json,
platform: requestedPlatform,
+3 -3
View File
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import { formatGraphQLBuild } from '../../build/utils/formatBuild';
import EasCommand from '../../commandUtils/EasCommand';
@@ -20,7 +20,7 @@ export default class BuildView extends EasCommand {
static args = [{ name: 'BUILD_ID' }];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
}),
};
@@ -29,7 +29,7 @@ export default class BuildView extends EasCommand {
const {
args: { BUILD_ID: buildId },
flags,
} = this.parse(BuildView);
} = await this.parse(BuildView);
if (flags.json) {
enableJsonOutput();
}
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';
@@ -59,7 +59,6 @@ export async function createUpdateChannelOnAppAsync({
}
export default class ChannelCreate extends EasCommand {
static hidden = true;
static description = 'Create a channel on the current project.';
static args = [
@@ -71,7 +70,7 @@ export default class ChannelCreate extends EasCommand {
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description:
'print output as a JSON object with the new channel ID, name and branch mapping.',
default: false,
@@ -82,7 +81,7 @@ export default class ChannelCreate extends EasCommand {
let {
args: { name: channelName },
flags: { json: jsonFlag },
} = this.parse(ChannelCreate);
} = await this.parse(ChannelCreate);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';
@@ -95,7 +95,6 @@ export async function updateChannelBranchMappingAsync({
}
export default class ChannelEdit extends EasCommand {
static hidden = true;
static description = 'Point a channel at a new branch.';
static args = [
@@ -107,10 +106,10 @@ export default class ChannelEdit extends EasCommand {
];
static flags = {
branch: flags.string({
branch: Flags.string({
description: 'Name of the branch to point to',
}),
json: flags.boolean({
json: Flags.boolean({
description: 'print output as a JSON object with the channel ID, name and branch mapping.',
default: false,
}),
@@ -120,7 +119,7 @@ export default class ChannelEdit extends EasCommand {
let {
args: { name: channelName },
flags: { branch: branchName, json: jsonFlag },
} = this.parse(ChannelEdit);
} = await this.parse(ChannelEdit);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import gql from 'graphql-tag';
import EasCommand from '../../commandUtils/EasCommand';
@@ -66,11 +66,10 @@ async function getAllUpdateChannelForAppAsync({
}
export default class ChannelList extends EasCommand {
static hidden = true;
static description = 'List all channels on the current project.';
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: 'print output as a JSON object with the channel ID, name and branch mapping.',
default: false,
}),
@@ -79,7 +78,7 @@ export default class ChannelList extends EasCommand {
async runAsync(): Promise<void> {
const {
flags: { json: jsonFlag },
} = this.parse(ChannelList);
} = await this.parse(ChannelList);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import EasCommand from '../../commandUtils/EasCommand';
@@ -319,19 +319,19 @@ export default class ChannelRollout extends EasCommand {
];
static flags = {
branch: flags.string({
branch: Flags.string({
description: 'branch to rollout',
required: false,
}),
percent: flags.integer({
percent: Flags.integer({
description: 'percent of traffic to redirect to the new branch',
required: false,
}),
end: flags.boolean({
end: Flags.boolean({
description: 'end the rollout',
default: false,
}),
json: flags.boolean({
json: Flags.boolean({
description: 'print output as a JSON object with the new channel ID, name and branch mapping',
default: false,
}),
@@ -340,11 +340,8 @@ export default class ChannelRollout extends EasCommand {
async runAsync(): Promise<void> {
const {
args: { channel: channelName },
flags: { json: jsonFlag, end: endFlag },
} = this.parse(ChannelRollout);
const {
flags: { branch: branchName, percent },
} = this.parse(ChannelRollout);
flags: { json: jsonFlag, end: endFlag, branch: branchName, percent },
} = await this.parse(ChannelRollout);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import assert from 'assert';
import chalk from 'chalk';
import Table from 'cli-table3';
@@ -192,7 +192,6 @@ export function logChannelDetails(channel: {
}
export default class ChannelView extends EasCommand {
static hidden = true;
static description = 'View a channel on the current project.';
static args = [
@@ -204,7 +203,7 @@ export default class ChannelView extends EasCommand {
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: 'print output as a JSON object with the channel ID, name and branch mapping.',
default: false,
}),
@@ -214,7 +213,7 @@ export default class ChannelView extends EasCommand {
let {
args: { name: channelName },
flags: { json: jsonFlag },
} = this.parse(ChannelView);
} = await this.parse(ChannelView);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
+4 -4
View File
@@ -1,7 +1,7 @@
import { getProjectConfigDescription } from '@expo/config';
import { Platform } from '@expo/eas-build-job';
import { EasJsonReader } from '@expo/eas-json';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import EasCommand from '../commandUtils/EasCommand';
import Log from '../log';
@@ -14,14 +14,14 @@ export default class Config extends EasCommand {
static description = 'show the eas.json config';
static flags = {
platform: flags.enum({ char: 'p', options: ['android', 'ios'] }),
profile: flags.string(),
platform: Flags.enum({ char: 'p', options: ['android', 'ios'] }),
profile: Flags.string(),
};
protected requiresAuthentication = false;
async runAsync(): Promise<void> {
const { flags } = this.parse(Config);
const { flags } = await this.parse(Config);
const { platform: maybePlatform, profile: maybeProfile } = flags as {
platform?: Platform;
profile?: string;
+3 -3
View File
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import assert from 'assert';
import chalk from 'chalk';
@@ -16,11 +16,11 @@ export default class BuildList extends EasCommand {
static description = 'list all registered devices for your account';
static flags = {
'apple-team-id': flags.string(),
'apple-team-id': Flags.string(),
};
async runAsync(): Promise<void> {
let appleTeamIdentifier = this.parse(BuildList).flags['apple-team-id'];
let appleTeamIdentifier = (await this.parse(BuildList)).flags['apple-team-id'];
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
+1 -1
View File
@@ -13,7 +13,7 @@ export default class DeviceView extends EasCommand {
static args = [{ name: 'UDID' }];
async runAsync(): Promise<void> {
const { UDID } = this.parse(DeviceView).args;
const { UDID } = (await this.parse(DeviceView)).args;
if (!UDID) {
Log.log(
@@ -28,6 +28,7 @@ export default class Diagnostics extends EasCommand {
'react-navigation',
'@expo/webpack-config',
'expo-dev-client',
'expo-updates',
],
npmGlobalPackages: ['eas-cli', 'expo-cli'],
},
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import EasCommand from '../../commandUtils/EasCommand';
@@ -23,18 +23,18 @@ export default class EnvironmentSecretCreate extends EasCommand {
static description = 'Create an environment secret on the current project or owner account.';
static flags = {
scope: flags.enum({
scope: Flags.enum({
description: 'Scope for the secret',
options: [EnvironmentSecretScope.ACCOUNT, EnvironmentSecretScope.PROJECT],
default: EnvironmentSecretScope.PROJECT,
}),
name: flags.string({
name: Flags.string({
description: 'Name of the secret',
}),
value: flags.string({
value: Flags.string({
description: 'Value of the secret',
}),
force: flags.boolean({
force: Flags.boolean({
description: 'Delete and recreate existing secrets',
default: false,
}),
@@ -44,7 +44,7 @@ export default class EnvironmentSecretCreate extends EasCommand {
const actor = await ensureLoggedInAsync();
let {
flags: { name, value: secretValue, scope, force },
} = this.parse(EnvironmentSecretCreate);
} = await this.parse(EnvironmentSecretCreate);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import EasCommand from '../../commandUtils/EasCommand';
@@ -22,7 +22,7 @@ export default class EnvironmentSecretDelete extends EasCommand {
Unsure where to find the secret's ID? Run ${chalk.bold('eas secret:list')}`;
static flags = {
id: flags.string({
id: Flags.string({
description: 'ID of the secret to delete',
}),
};
@@ -35,7 +35,7 @@ Unsure where to find the secret's ID? Run ${chalk.bold('eas secret:list')}`;
let {
flags: { id },
} = this.parse(EnvironmentSecretDelete);
} = await this.parse(EnvironmentSecretDelete);
let secret: EnvironmentSecretWithScope | undefined;
if (!id) {
+16 -17
View File
@@ -1,6 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { error } from '@oclif/errors';
import { Errors, Flags } from '@oclif/core';
import chalk from 'chalk';
import EasCommand from '../commandUtils/EasCommand';
@@ -20,7 +19,7 @@ import { submitAsync, waitToCompleteAsync } from '../submit/submit';
import { printSubmissionDetailsUrls } from '../submit/utils/urls';
import { getProfilesAsync } from '../utils/profiles';
interface RawFlags {
interface RawCommandFlags {
platform?: string;
profile?: string;
latest?: boolean;
@@ -32,7 +31,7 @@ interface RawFlags {
'non-interactive': boolean;
}
interface Flags {
interface CommandFlags {
requestedPlatform: RequestedPlatform;
profile?: string;
archiveFlags: SubmitArchiveFlags;
@@ -47,47 +46,47 @@ See how to configure submits with eas.json: ${link('https://docs.expo.dev/submit
static aliases = ['build:submit'];
static flags = {
platform: flags.enum({
platform: Flags.enum({
char: 'p',
options: ['android', 'ios', 'all'],
}),
profile: flags.string({
profile: Flags.string({
description:
'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
}),
latest: flags.boolean({
latest: Flags.boolean({
description: 'Submit the latest build for specified platform',
exclusive: ['id', 'path', 'url'],
}),
id: flags.string({
id: Flags.string({
description: 'ID of the build to submit',
exclusive: ['latest, path, url'],
}),
path: flags.string({
path: Flags.string({
description: 'Path to the .apk/.aab/.ipa file',
exclusive: ['latest', 'id', 'url'],
}),
url: flags.string({
url: Flags.string({
description: 'App archive url',
exclusive: ['latest', 'id', 'path'],
}),
verbose: flags.boolean({
verbose: Flags.boolean({
description: 'Always print logs from Submission Service',
default: false,
}),
wait: flags.boolean({
wait: Flags.boolean({
description: 'Wait for submission to complete',
default: true,
allowNo: true,
}),
'non-interactive': flags.boolean({
'non-interactive': Flags.boolean({
default: false,
description: 'Run command in non-interactive mode',
}),
};
async runAsync(): Promise<void> {
const { flags: rawFlags } = this.parse(Submit);
const { flags: rawFlags } = await this.parse(Submit);
const flags = await this.sanitizeFlagsAsync(rawFlags);
const projectDir = await findProjectRootAsync();
@@ -135,7 +134,7 @@ See how to configure submits with eas.json: ${link('https://docs.expo.dev/submit
}
}
private async sanitizeFlagsAsync(flags: RawFlags): Promise<Flags> {
private async sanitizeFlagsAsync(flags: RawCommandFlags): Promise<CommandFlags> {
const {
platform,
verbose,
@@ -146,13 +145,13 @@ See how to configure submits with eas.json: ${link('https://docs.expo.dev/submit
} = flags;
if (!flags.platform && nonInteractive) {
error('--platform is required when building in non-interactive mode', { exit: 1 });
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) {
error(
Errors.error(
'--id, --path, and --url params are only supported when performing a single-platform submit',
{ exit: 1 }
);
@@ -2,27 +2,28 @@ import { ExpoConfig, getConfig, modifyConfigAsync } from '@expo/config';
import { Platform, Workflow } from '@expo/eas-build-job';
import chalk from 'chalk';
import { getEASUpdateURL } from '../../api';
import EasCommand from '../../commandUtils/EasCommand';
import Log, { learnMore } from '../../log';
import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUtils';
import { resolveWorkflowAsync } from '../../project/workflow';
const EAS_UPDATE_URL = 'https://u.expo.dev';
const DEFAULT_RUNTIME_VERSION = { policy: 'sdkVersion' } as const;
export async function getEASUpdateURLAsync(exp: ExpoConfig): Promise<string> {
const projectId = await getProjectIdAsync(exp);
return new URL(projectId, EAS_UPDATE_URL).href;
}
const DEFAULT_MANAGED_RUNTIME_VERSION = { policy: 'sdkVersion' } as const;
const DEFAULT_BARE_RUNTIME_VERSION = '1.0.0';
async function configureProjectForEASUpdateAsync(
projectDir: string,
exp: ExpoConfig
exp: ExpoConfig,
isBare: boolean
): Promise<void> {
const easUpdateURL = await getEASUpdateURLAsync(exp);
const projectId = await getProjectIdAsync(exp);
const easUpdateURL = getEASUpdateURL(projectId);
const preexistingRuntimeVersion = exp.runtimeVersion;
const defaultRuntimeVersion = isBare
? DEFAULT_BARE_RUNTIME_VERSION
: DEFAULT_MANAGED_RUNTIME_VERSION;
const result = await modifyConfigAsync(projectDir, {
runtimeVersion: preexistingRuntimeVersion ?? DEFAULT_RUNTIME_VERSION,
runtimeVersion: preexistingRuntimeVersion ?? defaultRuntimeVersion,
updates: { ...exp.updates, url: easUpdateURL },
});
@@ -39,7 +40,7 @@ async function configureProjectForEASUpdateAsync(
}
if (!preexistingRuntimeVersion) {
Log.withTick(
`Set runtimeVersion to "${JSON.stringify(DEFAULT_RUNTIME_VERSION)}" in app.json`
`Set runtimeVersion to "${JSON.stringify(defaultRuntimeVersion)}" in app.json`
);
}
@@ -72,7 +73,6 @@ async function configureProjectForEASUpdateAsync(
}
export default class UpdateConfigure extends EasCommand {
static hidden = true;
static description = 'Configure the project to support EAS Update.';
async runAsync(): Promise<void> {
@@ -85,15 +85,16 @@ export default class UpdateConfigure extends EasCommand {
skipSDKVersionRequirement: true,
});
await configureProjectForEASUpdateAsync(projectDir, exp);
const hasAndroidNativeProject =
(await resolveWorkflowAsync(projectDir, Platform.ANDROID)) === Workflow.GENERIC;
const hasIosNativeProject =
(await resolveWorkflowAsync(projectDir, Platform.IOS)) === Workflow.GENERIC;
const isBare = hasAndroidNativeProject || hasIosNativeProject;
await configureProjectForEASUpdateAsync(projectDir, exp, isBare);
Log.addNewLineIfNone();
if (hasAndroidNativeProject || hasIosNativeProject) {
if (isBare) {
Log.log(
`🧐 It seems you are on the bare workflow! Please also update your native files. You can do this by either running ${chalk.bold(
'eas build:configure'
@@ -1,4 +1,4 @@
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import gql from 'graphql-tag';
@@ -35,7 +35,6 @@ async function deleteUpdateGroupAsync({
}
export default class UpdateDelete extends EasCommand {
static hidden = true;
static description = 'Delete all the updates in an update Group.';
static args = [
@@ -47,7 +46,7 @@ export default class UpdateDelete extends EasCommand {
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: `Return a json with the group ID of the deleted updates.`,
default: false,
}),
@@ -57,7 +56,7 @@ export default class UpdateDelete extends EasCommand {
const {
args: { groupId: group },
flags: { json: jsonFlag },
} = this.parse(UpdateDelete);
} = await this.parse(UpdateDelete);
if (!jsonFlag) {
const shouldAbort = await confirmAsync({
+66 -34
View File
@@ -1,12 +1,13 @@
import { ExpoConfig, getConfig } from '@expo/config';
import { Updates } from '@expo/config-plugins';
import { Platform, Workflow } from '@expo/eas-build-job';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import assert from 'assert';
import chalk from 'chalk';
import dateFormat from 'dateformat';
import gql from 'graphql-tag';
import { getEASUpdateURL } from '../../api';
import EasCommand from '../../commandUtils/EasCommand';
import { graphqlClient, withErrorHandlingAsync } from '../../graphql/client';
import {
@@ -39,7 +40,6 @@ import { createUpdateBranchOnAppAsync } from '../branch/create';
import { listBranchesAsync } from '../branch/list';
import { viewUpdateBranchAsync } from '../branch/view';
import { createUpdateChannelOnAppAsync } from '../channel/create';
import { getEASUpdateURLAsync } from './configure';
export const defaultPublishPlatforms: PublishPlatform[] = ['android', 'ios'];
type PlatformFlag = PublishPlatform | 'all';
@@ -131,46 +131,45 @@ async function ensureBranchExistsAsync({
}
export default class UpdatePublish extends EasCommand {
static hidden = true;
static description = 'Publish an update group.';
static flags = {
branch: flags.string({
branch: Flags.string({
description: 'Branch to publish the update group on',
required: false,
}),
message: flags.string({
message: Flags.string({
description: 'A short message describing the update',
required: false,
}),
republish: flags.boolean({
republish: Flags.boolean({
description: 'Republish an update group',
exclusive: ['input-dir', 'skip-bundler'],
}),
group: flags.string({
group: Flags.string({
description: 'Update group to republish',
exclusive: ['input-dir', 'skip-bundler'],
}),
'input-dir': flags.string({
'input-dir': Flags.string({
description: 'Location of the bundle',
default: 'dist',
required: false,
}),
'skip-bundler': flags.boolean({
'skip-bundler': Flags.boolean({
description: `Skip running Expo CLI to bundle the app before publishing`,
default: false,
}),
platform: flags.enum({
platform: Flags.enum({
char: 'p',
options: [...defaultPublishPlatforms, 'all'],
default: 'all',
required: false,
}),
json: flags.boolean({
json: Flags.boolean({
description: 'Enable JSON output, non-JSON messages will be printed to stderr',
default: false,
}),
auto: flags.boolean({
auto: Flags.boolean({
description:
'Use the current git branch and commit message for the EAS branch and update message',
default: false,
@@ -188,9 +187,10 @@ export default class UpdatePublish extends EasCommand {
group,
'input-dir': inputDir,
'skip-bundler': skipBundler,
platform,
},
} = this.parse(UpdatePublish);
const platformFlag = this.parse(UpdatePublish).flags.platform as PlatformFlag;
} = await this.parse(UpdatePublish);
const platformFlag = platform as PlatformFlag;
// If a group was specified, that means we are republishing it.
republish = group ? true : republish;
@@ -211,24 +211,36 @@ export default class UpdatePublish extends EasCommand {
}
if (!branchName) {
const validationMessage = 'branch name may not be empty.';
const validationMessage = 'Branch name may not be empty.';
if (jsonFlag) {
throw new Error(validationMessage);
}
const branches = await listBranchesAsync({ projectId });
branchName = await selectAsync<string>(
'which branch would you like to publish on?',
branches.map(branch => {
return {
title: `${branch.name} ${chalk.grey(
`- current update: ${formatUpdate(branch.updates[0])}`
)}`,
value: branch.name,
};
})
);
assert(branchName, 'branch name must be specified.');
if (branches.length === 0) {
({ name: branchName } = await promptAsync({
type: 'text',
name: 'name',
message: 'No branches found. Creating a new one. Please name the new branch:',
initial:
(await getVcsClient().getBranchNameAsync()) ||
`branch-${Math.random().toString(36).substr(2, 4)}`,
validate: value => (value ? true : validationMessage),
}));
} else {
branchName = await selectAsync<string>(
'Which branch would you like to publish on?',
branches.map(branch => {
return {
title: `${branch.name} ${chalk.grey(
`- current update: ${formatUpdate(branch.updates[0])}`
)}`,
value: branch.name,
};
})
);
}
assert(branchName, 'Branch name must be specified.');
}
const { id: branchId, updates } = await ensureBranchExistsAsync({
@@ -293,7 +305,7 @@ export default class UpdatePublish extends EasCommand {
}
publicationPlatformMessage = `The republished update will appear on the same plaforms it was originally published on: ${updatesToRepublishFilteredByPlatform
.map(update => update.platform)
.join(',')}`;
.join(', ')}`;
} else {
publicationPlatformMessage = `The republished update will appear only on: ${platformFlag}`;
}
@@ -310,6 +322,20 @@ export default class UpdatePublish extends EasCommand {
group = updatesToRepublishFilteredByPlatform[0].group;
oldMessage = updatesToRepublishFilteredByPlatform[0].message ?? '';
oldRuntimeVersion = updatesToRepublishFilteredByPlatform[0].runtimeVersion;
if (!message) {
const validationMessage = 'publish message may not be empty.';
if (jsonFlag) {
throw new Error(validationMessage);
}
({ publishMessage: message } = await promptAsync({
type: 'text',
name: 'publishMessage',
message: `Please enter an update message.`,
initial: `Republish "${oldMessage!}" - group: ${group}`,
validate: (value: any) => (value ? true : validationMessage),
}));
}
} else {
if (!message && autoFlag) {
message = (await getVcsClient().getLastCommitMessageAsync())?.trim();
@@ -324,19 +350,24 @@ export default class UpdatePublish extends EasCommand {
type: 'text',
name: 'publishMessage',
message: `Please enter an update message.`,
initial: republish
? `Republish "${oldMessage!}" - group: ${group}`
: (await getVcsClient().getLastCommitMessageAsync())?.trim(),
initial: (await getVcsClient().getLastCommitMessageAsync())?.trim(),
validate: (value: any) => (value ? true : validationMessage),
}));
}
// build bundle and upload assets for a new publish
if (!skipBundler) {
await buildBundlesAsync({ projectDir, inputDir });
const bundleSpinner = ora().start('Building bundle...');
try {
await buildBundlesAsync({ projectDir, inputDir });
bundleSpinner.succeed('Built bundle!');
} catch (e) {
bundleSpinner.fail('Failed to build bundle!');
throw e;
}
}
const assetSpinner = ora('Uploading assets...').start();
const assetSpinner = ora().start('Uploading assets...');
try {
const platforms = platformFlag === 'all' ? defaultPublishPlatforms : [platformFlag];
const assets = await collectAssetsAsync({ inputDir: inputDir!, platforms });
@@ -473,7 +504,8 @@ function formatUpdateTitle(
async function checkEASUpdateURLIsSetAsync(exp: ExpoConfig): Promise<void> {
const configuredURL = exp.updates?.url;
const expectedURL = await getEASUpdateURLAsync(exp);
const projectId = await getProjectIdAsync(exp);
const expectedURL = getEASUpdateURL(projectId);
if (configuredURL !== expectedURL) {
throw new Error(
+3 -4
View File
@@ -1,4 +1,4 @@
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import Table from 'cli-table3';
import gql from 'graphql-tag';
@@ -50,7 +50,6 @@ export async function viewUpdateAsync({
return data;
}
export default class UpdateView extends EasCommand {
static hidden = true;
static description = 'Update group details.';
static args = [
@@ -62,7 +61,7 @@ export default class UpdateView extends EasCommand {
];
static flags = {
json: flags.boolean({
json: Flags.boolean({
description: `Return a json with the updates belonging to the group.`,
default: false,
}),
@@ -72,7 +71,7 @@ export default class UpdateView extends EasCommand {
const {
args: { groupId },
flags: { json: jsonFlag },
} = this.parse(UpdateView);
} = await this.parse(UpdateView);
const { updatesByGroup } = await viewUpdateAsync({ groupId });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import EasCommand from '../../commandUtils/EasCommand';
import { WebhookType } from '../../graphql/generated';
@@ -12,21 +12,21 @@ export default class WebhookCreate extends EasCommand {
static description = 'Create a webhook on the current project.';
static flags = {
event: flags.enum({
event: Flags.enum({
description: 'Event type that triggers the webhook',
options: [WebhookType.Build, WebhookType.Submit],
}),
url: flags.string({
url: Flags.string({
description: 'Webhook URL',
}),
secret: flags.string({
secret: Flags.string({
description:
"Secret used to create a hash signature of the request payload, provided in the 'Expo-Signature' header.",
}),
};
async runAsync(): Promise<void> {
const { flags } = this.parse(WebhookCreate);
const { flags } = await this.parse(WebhookCreate);
const webhookInputParams = await prepareInputParamsAsync(flags);
const projectDir = await findProjectRootAsync();
@@ -27,7 +27,7 @@ export default class WebhookDelete extends EasCommand {
async runAsync(): Promise<void> {
let {
args: { ID: webhookId },
} = this.parse(WebhookDelete);
} = await this.parse(WebhookDelete);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,5 +1,5 @@
import { getConfig } from '@expo/config';
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import chalk from 'chalk';
import EasCommand from '../../commandUtils/EasCommand';
@@ -18,7 +18,7 @@ export default class WebhookList extends EasCommand {
static description = 'List webhooks on the current project.';
static flags = {
event: flags.enum({
event: Flags.enum({
description: 'Event type that triggers the webhook',
options: [WebhookType.Build, WebhookType.Submit],
}),
@@ -27,7 +27,7 @@ export default class WebhookList extends EasCommand {
async runAsync(): Promise<void> {
const {
flags: { event },
} = this.parse(WebhookList);
} = await this.parse(WebhookList);
const projectDir = await findProjectRootAsync();
const { exp } = getConfig(projectDir, { skipSDKVersionRequirement: true });
@@ -1,4 +1,4 @@
import { flags } from '@oclif/command';
import { Flags } from '@oclif/core';
import EasCommand from '../../commandUtils/EasCommand';
import { WebhookType } from '../../graphql/generated';
@@ -12,25 +12,25 @@ export default class WebhookUpdate extends EasCommand {
static description = 'Create a webhook on the current project.';
static flags = {
id: flags.string({
id: Flags.string({
description: 'Webhook ID',
required: true,
}),
event: flags.enum({
event: Flags.enum({
description: 'Event type that triggers the webhook',
options: [WebhookType.Build, WebhookType.Submit],
}),
url: flags.string({
url: Flags.string({
description: 'Webhook URL',
}),
secret: flags.string({
secret: Flags.string({
description:
"Secret used to create a hash signature of the request payload, provided in the 'Expo-Signature' header.",
}),
};
async runAsync(): Promise<void> {
const { flags } = this.parse(WebhookUpdate);
const { flags } = await this.parse(WebhookUpdate);
const webhookId = flags.id;
@@ -18,7 +18,7 @@ export default class WebhookView extends EasCommand {
async runAsync(): Promise<void> {
const {
args: { ID: webhookId },
} = this.parse(WebhookView);
} = await this.parse(WebhookView);
const spinner = ora(`Fetching the webhook details for ID ${webhookId}`).start();
try {
+36 -14
View File
@@ -720,6 +720,7 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
appBuildVersion?: Maybe<Scalars['String']>;
sdkVersion?: Maybe<Scalars['String']>;
runtimeVersion?: Maybe<Scalars['String']>;
reactNativeVersion?: Maybe<Scalars['String']>;
releaseChannel?: Maybe<Scalars['String']>;
channel?: Maybe<Scalars['String']>;
metrics?: Maybe<BuildMetrics>;
@@ -1772,6 +1773,7 @@ export type InvoiceQuery = {
export type InvoiceQueryPreviewInvoiceForSubscriptionUpdateArgs = {
accountId: Scalars['String'];
newPlanIdentifier: Scalars['String'];
couponCode?: Maybe<Scalars['String']>;
};
export type Invoice = {
@@ -1783,6 +1785,8 @@ export type Invoice = {
amountPaid: Scalars['Int'];
/** The total amount that needs to be paid, considering any discounts or account credit. Value is in cents. */
amountRemaining: Scalars['Int'];
discount?: Maybe<InvoiceDiscount>;
totalDiscountedAmount: Scalars['Int'];
lineItems: Array<InvoiceLineItem>;
period: InvoicePeriod;
startingBalance: Scalars['Int'];
@@ -1790,6 +1794,22 @@ export type Invoice = {
total: Scalars['Int'];
};
export type InvoiceDiscount = {
__typename?: 'InvoiceDiscount';
id: Scalars['ID'];
name: Scalars['String'];
type: InvoiceDiscountType;
duration: Scalars['String'];
durationInMonths?: Maybe<Scalars['Int']>;
/** The coupon's discount value, in percentage or in dollar amount */
amount: Scalars['Int'];
};
export enum InvoiceDiscountType {
Percentage = 'PERCENTAGE',
Amount = 'AMOUNT'
}
export type InvoiceLineItem = {
__typename?: 'InvoiceLineItem';
id: Scalars['ID'];
@@ -2115,6 +2135,7 @@ export type AccountMutationCancelSubscriptionArgs = {
export type AccountMutationChangePlanArgs = {
accountID: Scalars['ID'];
newPlanIdentifier: Scalars['String'];
couponCode?: Maybe<Scalars['String']>;
};
@@ -2744,6 +2765,7 @@ export type BuildMetadataInput = {
credentialsSource?: Maybe<BuildCredentialsSource>;
sdkVersion?: Maybe<Scalars['String']>;
runtimeVersion?: Maybe<Scalars['String']>;
reactNativeVersion?: Maybe<Scalars['String']>;
releaseChannel?: Maybe<Scalars['String']>;
channel?: Maybe<Scalars['String']>;
distribution?: Maybe<DistributionType>;
@@ -3681,19 +3703,6 @@ export type BranchesByAppQuery = (
) }
);
export type GetUpdateGroupAsyncQueryVariables = Exact<{
group: Scalars['ID'];
}>;
export type GetUpdateGroupAsyncQuery = (
{ __typename?: 'RootQuery' }
& { updatesByGroup: Array<(
{ __typename?: 'Update' }
& Pick<Update, 'id' | 'group' | 'runtimeVersion' | 'manifestFragment' | 'platform' | 'message'>
)> }
);
export type EditUpdateBranchMutationVariables = Exact<{
input: EditUpdateBranchInput;
}>;
@@ -3924,6 +3933,19 @@ export type DeleteUpdateGroupMutation = (
) }
);
export type GetUpdateGroupAsyncQueryVariables = Exact<{
group: Scalars['ID'];
}>;
export type GetUpdateGroupAsyncQuery = (
{ __typename?: 'RootQuery' }
& { updatesByGroup: Array<(
{ __typename?: 'Update' }
& Pick<Update, 'id' | 'group' | 'runtimeVersion' | 'manifestFragment' | 'platform' | 'message'>
)> }
);
export type UpdatesByGroupQueryVariables = Exact<{
groupId: Scalars['ID'];
}>;
@@ -5449,7 +5471,7 @@ export type SubmissionFragment = (
& Pick<Submission, 'id' | 'status' | 'platform' | 'logsUrl'>
& { app: (
{ __typename?: 'App' }
& Pick<App, 'id' | 'name'>
& Pick<App, 'id' | 'name' | 'slug'>
& { ownerAccount: (
{ __typename?: 'Account' }
& Pick<Account, 'id' | 'name'>
@@ -8,6 +8,7 @@ export const SubmissionFragmentNode = gql`
app {
id
name
slug
ownerAccount {
id
name
+1 -1
View File
@@ -1 +1 @@
export { run } from '@oclif/command';
export { run } from '@oclif/core';
+35
View File
@@ -0,0 +1,35 @@
import { Platform, Workflow } from '@expo/eas-build-job';
import { Errors } from '@oclif/core';
import assert from 'assert';
import semver from 'semver';
import { BuildContext } from '../build/context';
import Log from '../log';
import { confirmAsync } from '../prompts';
const SUPPORTED_EXPO_SDK_VERSIONS = '>= 41.0.0';
assert(semver.validRange(SUPPORTED_EXPO_SDK_VERSIONS), 'Must be a valid version range');
export async function checkExpoSdkIsSupportedAsync(ctx: BuildContext<Platform>): Promise<void> {
assert(ctx.workflow === Workflow.MANAGED, 'Must be a managed workflow project');
if (ctx.exp.sdkVersion && semver.satisfies(ctx.exp.sdkVersion, SUPPORTED_EXPO_SDK_VERSIONS)) {
return;
}
const unsupportedSdkMessage =
'EAS Build does not officially support building managed project with Expo SDK < 41.';
if (ctx.nonInteractive) {
Log.warn(
`${unsupportedSdkMessage} Proceeding because you are running in non-interactive mode.`
);
return;
}
const proceed = await confirmAsync({
message: `${unsupportedSdkMessage} Do you want to proceed?`,
});
if (!proceed) {
Errors.exit(1);
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
import { Platform } from '@expo/eas-build-job';
import { exit } from '@oclif/errors';
import { Errors } from '@oclif/core';
import chalk from 'chalk';
import type MetroConfig from 'metro-config';
import resolveFrom from 'resolve-from';
@@ -49,7 +49,7 @@ export async function validateMetroConfigForManagedWorkflowAsync(
});
if (shouldAbort) {
Log.error('Aborting...');
exit(1);
Errors.exit(1);
}
}
}
+5 -3
View File
@@ -10,7 +10,6 @@ import { AssetMetadataStatus, PartialManifestAsset } from '../graphql/generated'
import { PublishMutation } from '../graphql/mutations/PublishMutation';
import { PresignedPost } from '../graphql/mutations/UploadSessionMutation';
import { PublishQuery } from '../graphql/queries/PublishQuery';
import Log from '../log';
import { uploadWithPresignedPostAsync } from '../uploads';
import { expoCommandAsync } from '../utils/expoCli';
import uniqBy from '../utils/expodash/uniqBy';
@@ -157,8 +156,11 @@ export async function buildBundlesAsync({
throw new Error('Could not locate package.json');
}
Log.withTick(`Building bundle with expo-cli...`);
await expoCommandAsync(projectDir, ['export', '--output-dir', inputDir, '--experimental-bundle']);
await expoCommandAsync(
projectDir,
['export', '--output-dir', inputDir, '--experimental-bundle'],
{ silent: true }
);
}
export async function resolveInputDirectoryAsync(customInputDirectory: string): Promise<string> {
+4 -5
View File
@@ -3,6 +3,10 @@ import prompts, { Answers, Choice, Options, PromptType, PromptObject as Question
export { PromptType, Question, Choice };
export interface ExpoChoice<T> extends Choice {
value: T;
}
type NamelessQuestion = Omit<Question<'value'>, 'name' | 'type'>;
export async function promptAsync<T extends string = string>(
@@ -35,11 +39,6 @@ export async function confirmAsync(
);
return value;
}
interface ExpoChoice<T> extends Choice {
value: T;
}
export async function selectAsync<T>(
message: string,
choices: ExpoChoice<T>[],
@@ -174,7 +174,14 @@ export default class IosSubmitCommand {
// interpret this to mean the user had some intention of passing in ASC Api key
if (ascApiKeyPath || ascApiKeyIssuerId || ascApiKeyId) {
Log.warn(`ascApiKeyPath, ascApiKeyIssuerId and ascApiKeyId must all be defined in eas.json`);
const message = `ascApiKeyPath, ascApiKeyIssuerId and ascApiKeyId must all be defined in eas.json`;
// in non-interactive mode, we should fail
if (this.ctx.nonInteractive) {
throw new Error(message);
}
Log.warn(message);
return result({
sourceType: AscApiKeySourceType.prompt,
});
+1 -1
View File
@@ -24,7 +24,7 @@ export function printSubmissionDetailsUrls(submissions: SubmissionFragment[]): v
export function getSubmissionDetailsUrl(submission: SubmissionFragment): string {
const { id, app } = submission;
return new URL(
`/accounts/${app.ownerAccount.name}/projects/${app.name}/submissions/${id}`,
`/accounts/${app.ownerAccount.name}/projects/${app.slug}/submissions/${id}`,
getExpoWebsiteBaseUrl()
).toString();
}
+4 -4
View File
@@ -9,10 +9,10 @@ export type FormatUpdateParameter = Pick<Update, 'id' | 'createdAt' | 'message'>
};
export const UPDATE_COLUMNS = [
'update description',
'update runtime version',
'update group ID',
'platforms',
'Update message',
'Update runtime version',
'Update group ID',
'Update platforms',
];
export function getPlatformsForGroup({
+2 -2
View File
@@ -1,4 +1,4 @@
import { error } from '@oclif/errors';
import { Errors } from '@oclif/core';
import chalk from 'chalk';
import nullthrows from 'nullthrows';
@@ -13,7 +13,7 @@ export async function showLoginPromptAsync({
printNewLine = false,
} = {}): Promise<void> {
if (nonInteractive) {
error(
Errors.error(
`Either log in with ${chalk.bold('eas login')} or set the ${chalk.bold(
'EXPO_TOKEN'
)} environment variable if you're using EAS CLI on CI (${learnMore(
@@ -1,15 +1,18 @@
import { Platform } from '@expo/eas-build-job';
import { EasJsonReader, errors } from '@expo/eas-json';
import { BuildProfile, EasJsonReader, errors } from '@expo/eas-json';
import { asMock } from '../../__tests__/utils';
import { selectAsync } from '../../prompts';
import { getProfilesAsync } from '../profiles';
jest.mock('../../prompts');
jest.mock('@expo/eas-json', () => {
const actual = jest.requireActual('@expo/eas-json');
const EasJsonReaderMock = jest.fn();
EasJsonReaderMock.prototype = {
getBuildProfileAsync: jest.fn(),
getSubmitProfileAsync: jest.fn(),
getBuildProfileNamesAsync: jest.fn(),
};
return {
...actual,
@@ -18,10 +21,13 @@ jest.mock('@expo/eas-json', () => {
});
const getBuildProfileAsync = jest.spyOn(EasJsonReader.prototype, 'getBuildProfileAsync');
const getBuildProfileNamesAsync = jest.spyOn(EasJsonReader.prototype, 'getBuildProfileNamesAsync');
describe(getProfilesAsync, () => {
afterEach(() => {
getBuildProfileAsync.mockReset();
getBuildProfileNamesAsync.mockReset();
asMock(selectAsync).mockReset();
});
it('defaults to production profile', async () => {
@@ -62,10 +68,32 @@ describe(getProfilesAsync, () => {
expect(getBuildProfileAsync).toBeCalledWith(Platform.IOS, 'release');
});
it('fails when neither production or release profiles are present', async () => {
getBuildProfileAsync.mockImplementation(() => {
it('asks the user to pick profile if "release" does not exist', async () => {
getBuildProfileAsync.mockImplementation(async (_, profileName) => {
if (profileName === 'foo') {
return {} as unknown as BuildProfile<Platform>;
}
throw new errors.MissingProfileError();
});
getBuildProfileNamesAsync.mockImplementation(() => Promise.resolve(['foo', 'bar']));
asMock(selectAsync).mockImplementation(() => 'foo');
const result = await getProfilesAsync({
projectDir: '/fake',
platforms: [Platform.ANDROID],
profileName: undefined,
type: 'build',
});
expect(selectAsync).toHaveBeenCalled();
expect(getBuildProfileAsync).toBeCalledWith(Platform.ANDROID, 'foo');
expect(result[0].profileName).toBe('foo');
});
it('throws an error if there are no profiles in eas.json', async () => {
getBuildProfileAsync.mockImplementation(async () => {
throw new errors.MissingProfileError();
});
getBuildProfileNamesAsync.mockImplementation(() => Promise.resolve([]));
await expect(
getProfilesAsync({
+17 -11
View File
@@ -4,7 +4,11 @@ import resolveFrom from 'resolve-from';
import Log from '../log';
export async function expoCommandAsync(projectDir: string, args: string[]): Promise<void> {
export async function expoCommandAsync(
projectDir: string,
args: string[],
{ silent = false }: { silent?: boolean } = {}
): Promise<void> {
const expoCliPath = resolveFrom(projectDir, 'expo/bin/cli.js');
const spawnPromise = spawnAsync(expoCliPath, args, {
stdio: ['inherit', 'pipe', 'pipe'], // inherit stdin so user can install a missing expo-cli from inside this command
@@ -15,15 +19,17 @@ export async function expoCommandAsync(projectDir: string, args: string[]): Prom
if (!(stdout && stderr)) {
throw new Error('Failed to spawn expo-cli');
}
stdout.on('data', data => {
for (const line of data.toString().trim().split('\n')) {
Log.log(`${chalk.gray('[expo-cli]')} ${line}`);
}
});
stderr.on('data', data => {
for (const line of data.toString().trim().split('\n')) {
Log.warn(`${chalk.gray('[expo-cli]')} ${line}`);
}
});
if (!silent) {
stdout.on('data', data => {
for (const line of data.toString().trim().split('\n')) {
Log.log(`${chalk.gray('[expo-cli]')} ${line}`);
}
});
stderr.on('data', data => {
for (const line of data.toString().trim().split('\n')) {
Log.warn(`${chalk.gray('[expo-cli]')} ${line}`);
}
});
}
await spawnPromise;
}
+106 -33
View File
@@ -7,8 +7,10 @@ import {
errors,
getDefaultSubmitProfile,
} from '@expo/eas-json';
import chalk from 'chalk';
import Log from '../log';
import { ExpoChoice, selectAsync } from '../prompts';
type EasProfile<T extends ProfileType> = T extends 'build'
? BuildProfile<Platform>
@@ -23,7 +25,7 @@ export type ProfileData<T extends ProfileType> = {
export async function getProfilesAsync<T extends ProfileType>({
projectDir,
platforms,
profileName: profileNameArg,
profileName,
type,
}: {
projectDir: string;
@@ -32,42 +34,98 @@ export async function getProfilesAsync<T extends ProfileType>({
type: T;
}): Promise<ProfileData<T>[]> {
const results = platforms.map(async function (platform) {
let profile: EasProfile<T>;
let profileName = profileNameArg;
if (!profileName) {
try {
profileName = 'production';
profile = await readProfileAsync({ projectDir, platform, type, profileName });
} catch (errorOuter) {
if (!(errorOuter instanceof errors.MissingProfileError)) {
throw errorOuter;
}
try {
profileName = 'release';
profile = await readProfileAsync({ projectDir, platform, type, profileName });
Log.warn(
'The default profile changed from "release" to "production". We detected that you still have a "release" build profile, so we are using it. Update eas.json to have a profile named "production" under the `build` key, or specify which profile you\'d like to use with the --profile flag. This fallback behavior will be removed in the next major version of EAS CLI.'
);
} catch (errorInner) {
if (!(errorInner instanceof errors.MissingProfileError)) {
throw errorInner;
}
const defaultProfile = getDefaultProfile({ platform, type });
if (!defaultProfile) {
throw errorInner;
}
profileName = '__default__';
profile = defaultProfile;
}
}
} else {
profile = await readProfileAsync({ projectDir, platform, type, profileName });
if (profileName) {
const profile = await readProfileAsync({ projectDir, platform, type, profileName });
return {
profile,
profileName,
platform,
};
}
try {
const profile = await readProfileAsync({
projectDir,
platform,
type,
profileName: 'production',
});
return {
profile,
profileName: 'production',
platform,
};
} catch (error) {
if (!(error instanceof errors.MissingProfileError)) {
throw error;
}
}
try {
const profile = await readProfileAsync({
projectDir,
platform,
type,
profileName: 'release',
});
Log.warn(
`The default profile changed from ${chalk.bold('release')} to ${chalk.bold(
'production'
)}. We detected that you still have a ${chalk.bold(
'release'
)} build profile, so we are using it. Update eas.json to have a profile named ${chalk.bold(
'production'
)} under the ${chalk.bold(
'build'
)} key, or specify which profile you'd like to use with the ${chalk.bold(
'--profile'
)} flag. This fallback behavior will be removed in the next major version of EAS CLI.`
);
return {
profile,
profileName: 'release',
platform,
};
} catch (error) {
if (!(error instanceof errors.MissingProfileError)) {
throw error;
}
}
const defaultProfile = getDefaultProfile({ platform, type });
if (defaultProfile) {
return {
profile: defaultProfile,
profileName: '__default__',
platform,
};
}
const profileNames = await readProfileNamesAsync({
projectDir,
type,
});
if (profileNames.length === 0) {
throw new errors.MissingProfileError(
`Missing profile in eas.json: ${profileName ?? 'production'}`
);
}
const choices: ExpoChoice<string>[] = profileNames.map(profileName => ({
title: profileName,
value: profileName,
}));
const chosenProfileName = await selectAsync(
'The "production" profile is missing in eas.json. Pick another profile:',
choices
);
const profile = await readProfileAsync({
projectDir,
platform,
type,
profileName: chosenProfileName,
});
return {
profile,
profileName,
profileName: chosenProfileName,
platform,
};
});
@@ -107,3 +165,18 @@ function getDefaultProfile<T extends ProfileType>({
return getDefaultSubmitProfile(platform) as EasProfile<T>;
}
}
async function readProfileNamesAsync({
projectDir,
type,
}: {
projectDir: string;
type: ProfileType;
}): Promise<string[]> {
const easJsonReader = new EasJsonReader(projectDir);
if (type === 'build') {
return await easJsonReader.getBuildProfileNamesAsync();
} else {
return await easJsonReader.getSubmitProfileNamesAsync();
}
}
+2 -2
View File
@@ -1,5 +1,5 @@
import spawnAsync from '@expo/spawn-async';
import { exit } from '@oclif/errors';
import { Errors } from '@oclif/core';
import chalk from 'chalk';
import Log, { learnMore } from '../../log';
@@ -23,7 +23,7 @@ export default class GitClient extends Client {
)} to use EAS CLI without Git (or any other version control system).`
);
Log.error(learnMore('https://expo.fyi/eas-vcs-workflow'));
exit(1);
Errors.exit(1);
}
if (await doesGitRepoExistAsync()) {
+2 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@expo/eas-json",
"description": "A library for interacting with eas.json",
"version": "0.40.0",
"version": "0.42.3",
"author": "Expo <[email protected]>",
"bugs": "https://github.com/expo/eas-cli/issues",
"dependencies": {
@@ -12,6 +12,7 @@
"fs-extra": "10.0.0",
"joi": "17.4.2",
"log-symbols": "4.1.0",
"semver": "7.3.5",
"tslib": "2.3.1"
},
"devDependencies": {
@@ -253,14 +253,14 @@ test('empty json', async () => {
test('invalid semver value', async () => {
await fs.writeJson('/project/eas.json', {
build: {
production: { node: '12.0.0-alpha' },
production: { node: 'alpha' },
},
});
const reader = new EasJsonReader('/project');
const promise = reader.getBuildProfileAsync(Platform.ANDROID, 'production');
await expect(promise).rejects.toThrowError(
'eas.json is not valid [ValidationError: "build.production.node" failed custom validation because 12.0.0-alpha is not a valid version]'
'eas.json is not valid [ValidationError: "build.production.node" failed custom validation because alpha is not a valid version]'
);
});
@@ -279,7 +279,7 @@ test('invalid release channel', async () => {
test('get profile names', async () => {
await fs.writeJson('/project/eas.json', {
build: {
production: { node: '12.0.0' },
production: { node: '12.0.0-alpha' },
blah: { node: '12.0.0' },
},
});
@@ -195,3 +195,28 @@ test('valid profile extending other profile', async () => {
ascApiKeyId: 'ABCD',
});
});
test('get profile names', async () => {
await fs.writeJson('/project/eas.json', {
submit: {
production: {
android: {
serviceAccountKeyPath: './path.json',
track: 'beta',
releaseStatus: 'completed',
},
},
blah: {
android: {
serviceAccountKeyPath: './path.json',
track: 'internal',
releaseStatus: 'completed',
},
},
},
});
const reader = new EasJsonReader('/project');
const allProfileNames = await reader.getSubmitProfileNamesAsync();
expect(allProfileNames.sort()).toEqual(['production', 'blah'].sort());
});
+10 -9
View File
@@ -1,5 +1,6 @@
import { Android, Ios } from '@expo/eas-build-job';
import Joi from 'joi';
import semver from 'semver';
const CacheSchema = Joi.object({
disabled: Joi.boolean(),
@@ -16,9 +17,9 @@ const CommonBuildProfileSchema = Joi.object({
channel: Joi.string().regex(/^[a-z\d][a-z\d._-]*$/),
developmentClient: Joi.boolean(),
node: Joi.string().empty(null).custom(semverSchemaCheck),
yarn: Joi.string().empty(null).custom(semverSchemaCheck),
expoCli: Joi.string().empty(null).custom(semverSchemaCheck),
node: Joi.string().empty(null).custom(semverCheck),
yarn: Joi.string().empty(null).custom(semverCheck),
expoCli: Joi.string().empty(null).custom(semverCheck),
env: Joi.object().pattern(Joi.string(), Joi.string().empty(null)),
});
@@ -29,7 +30,7 @@ const AndroidBuildProfileSchema = CommonBuildProfileSchema.concat(
withoutCredentials: Joi.boolean(),
image: Joi.string().valid(...Android.builderBaseImages),
ndk: Joi.string().empty(null).custom(semverSchemaCheck),
ndk: Joi.string().empty(null).custom(semverCheck),
autoIncrement: Joi.alternatives().try(
Joi.boolean(),
Joi.string().valid('version', 'versionCode')
@@ -54,9 +55,9 @@ const IosBuildProfileSchema = CommonBuildProfileSchema.concat(
simulator: Joi.boolean(),
image: Joi.string().valid(...Ios.builderBaseImages),
bundler: Joi.string().empty(null).custom(semverSchemaCheck),
fastlane: Joi.string().empty(null).custom(semverSchemaCheck),
cocoapods: Joi.string().empty(null).custom(semverSchemaCheck),
bundler: Joi.string().empty(null).custom(semverCheck),
fastlane: Joi.string().empty(null).custom(semverCheck),
cocoapods: Joi.string().empty(null).custom(semverCheck),
artifactPath: Joi.string(),
scheme: Joi.string(),
@@ -72,8 +73,8 @@ export const BuildProfileSchema = CommonBuildProfileSchema.concat(
})
);
function semverSchemaCheck(value: any): any {
if (/^[0-9]+\.[0-9]+\.[0-9]+$/.test(value)) {
function semverCheck(value: any): any {
if (semver.valid(value)) {
return value;
} else {
throw new Error(`${value} is not a valid version`);
+5
View File
@@ -77,6 +77,11 @@ export class EasJsonReader {
}
}
public async getSubmitProfileNamesAsync(): Promise<string[]> {
const easJson = await this.readAsync();
return Object.keys(easJson?.submit ?? {});
}
public async getSubmitProfileAsync<T extends Platform>(
platform: T,
profileName: string
+1 -1
View File
@@ -48,7 +48,7 @@ function resolveProfile<T extends Platform>({
const profile = easJson.submit?.[profileName];
if (!profile) {
if (depth === 0) {
throw new MissingProfileError(`There is no submit profile named ${profileName} in eas.json`);
throw new MissingProfileError(`Missing submit profile in eas.json: ${profileName}`);
} else {
throw new MissingParentProfileError(
`Extending non-existent submit profile in eas.json: ${profileName}`
Generated
+2180 -352
View File
File diff suppressed because it is too large. Load diff