Compare commits

..
Author SHA1 Message Date
Radoslaw Krzemien 02af3f587f v3.10.1 2023-04-25 14:59:42 +02:00
0d0da1a47a [eas-cli] [eas-json] [ENG-8120] Use cache.paths and deprecate cache.customPaths (#1794)
* Update dependencies

Bump version of `@expo/eas-build-job` to use `cache.paths` and deprecate `cache.customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Update default cache values

Updated the default cache values in `eas-cli` `prepareJobAsync` functions to use `paths` instead of `customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add tests

Added tests for `prepareJobAsync` functions both for Android and iOS to check if they handle both deprecated `customPaths` and new `paths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add `paths` and deprecate `customPaths`

Updated the schema in `eas-json` to add the new field `cache.paths` and deprecate the old `cache.customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add deprecation warning

Added a warning message to be returned when the eas.json contains deprecated field `cache.customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add tests

Added tests for `EasJsonUtils.getBuildProfileDeprecationWarnings()` checking if it correctly returns deprecation warnings for `cache.customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add tests

Added tests for printing the deprecation messages

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Uncomment and fix test

Had previously one test that was broken and commented out

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Update dependencies

Updated `@expo/eas-build-job` version after removing default value from `cache.customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Stop passing `customPaths` to `www`

Remove `cache.customPaths` from the job and add its values to `paths` if present

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Refactor getting cache settings

Moved getting the cache settings to `eas-json`, changed appending elements from `customPaths` to `paths` to overwriting them, added an error thrown when both `paths` and `customPaths` are present

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Fix deprecation message

Replaced hardcoded profile name with dynamic one

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Revert "Refactor getting cache settings"

This reverts commit 4727eba210.

* Revert changes and update Joi schema

Replaced the procedural code moving values of customPaths to paths into Joi schema validation

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Check for deprecation in raw EAS json

Changed the method checking for deprecated fields in eas.json to look into the raw EAS json instead of the validated build profile, because the validated build profile will always lack the deprecated field

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Update error message

Updated the message after user provides both `paths` and `customPaths` to be more understandable

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Fix broken test

One of the tests broke after the last adjustment of the error message

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* update CHANGELOG.md

* Fix import

Fixed incorrect import

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Pass accessor as argument

Passing eas json accessor as an argument instead of the results of its method. Also, removed a redundant check and made the accessor a mandatory parameter

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Check extended profile

Checking extended profile as well for deprecated `customPaths`

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Update packages/eas-json/src/utils.ts

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

* Add comment

Added a comment to a function made for testing only

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Update packages/eas-json/src/build/schema.ts

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

* Fix errors

Fixed failing test and a syntax error after committing a review suggestion

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Make the `profileName` mandatory

Made the `profileName` param in `getBuildProfileDeprecationWarningsAsync` mandatory and let the cli decide what the default profile name is

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Create build profile in eas-json

Instead of passing the build profile into `getBuildProfileDeprecationWarningsAsync` it is created using the already passed accessor

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add type

Added variable type

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Move doc comment

Moved the comment outside of function

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Replace try/catch

Replaced try/catch blocks in test with expect().rejects.toThrow()

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Use toMatchSnapshot

Replaced checking the calls to warn() with expect().toMatchSnapshot()

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Update snapshots

Updated the test snapshots to be up to date

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Print base profile name

When checking for deprecation messages the profile name printed is the name of the base profile not the extending one

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Force chalk color in CI

Chalk behaves differently when env var CI is set to true. It can be forced to behave normally with `FORCE_COLOR` env and this should solve the problem with CI tests failing

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Force chalk color in CI

Chalk behaves differently when env var CI is set to true. It can be forced to behave normally with `FORCE_COLOR` env and this should solve the problem with CI tests failing

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Add comment

Added a comment to explain why the `FORCE_COLOR` env is necessary in CI

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

* Move env var

Moved the `FORCE_COLOR` env var from github actions workflow to jest config

See: https://linear.app/expo/issue/ENG-8120/rename-cachecustompaths-to-cachepaths-in-easjson-and-job-schema

---------

Co-authored-by: Wojciech Kozyra <[email protected]>
Co-authored-by: Dominik Sokal <[email protected]>
2023-04-25 14:21:19 +02:00
Expo CI eec0b88258 update CHANGELOG.md 2023-04-21 07:56:25 +00:00
Dominik Sokal 98be401942 v3.10.0 2023-04-21 09:49:21 +02:00
Keith Kurak 8c2689a27b [eas-cli] Device delete not disabling on Apple side (#1803)
* [device:delete] fix matching Expo device to Apple device

* Clarify when a registered device will show up on Apple side

* update CHANGELOG.md
2023-04-20 14:31:30 -04:00
Keith KurakandDominik Sokal 1b34118d85 Add eas device:rename command (#1787)
* [device] rename stubbed out with existing graphql fns

* added update device mutation

* Device rename working on Expo side

* restore codegen endpoint

* tweaked some text output

* Update graphql

* Remove debugging log

* get inputMethod.ts off the change graph

* update CHANGELOG.md

* Update packages/eas-cli/src/commands/device/rename.ts

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

* Update packages/eas-cli/src/commands/device/rename.ts

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

* Warn when device not renamed (and fix device lookup)

* make warning slightly less wordy

---------

Co-authored-by: Dominik Sokal <[email protected]>
2023-04-20 14:24:02 -04:00
Keith Kurak 0f75fe407e [eas-cli] make ora recognize CI env variable (#1775) 2023-04-20 14:15:20 -04:00
Will Schurman efb7e534f4 [eas-cli] Fix message truncation for update message (#1801) 2023-04-20 09:25:01 -07:00
Szymon Dziedzic 53f89c0df1 [eas-cli] throw error if somebody tries to run iOS with large resource class selected using deprecated --resource-class flag (#1795)
* [eas-cli] throw error if somebody tries to run iOS with `large` resource class selected through deprecated `--resource-class` flag

* apply suggested changes

* improve error message

* update CHANGELOG.md
2023-04-20 13:52:05 +02:00
Dominik Sokal 1bbe7dfb72 [gha] add PR changelog check (#1798)
* [gha] add PR changelog check

* update PR template
2023-04-20 10:46:14 +02:00
34 changed files with 1118 additions and 390 deletions

No files matched your search

+2 -5
View File
@@ -1,8 +1,5 @@
<!-- Thanks for contributing to _EAS CLI_! Before you submit your pull request, please make sure to check the following boxes by putting an x in the [ ] (don't: [x ], [ x], do: [x]) -->
# Checklist
- [ ] I've added an entry to [CHANGELOG.md](https://github.com/expo/eas-cli/blob/main/CHANGELOG.md#main) if necessary. You can comment this pull request with `/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]` and CHANGELOG.md will be updated automatically.
<!-- If this PR requires a changelog entry, add it by commenting the PR with the command `/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]`. -->
<!-- You can skip the changelog check by labeling the PR with "no changelog". -->
# Why
+48
View File
@@ -0,0 +1,48 @@
name: Changelog bot
on:
issue_comment:
types: [created]
jobs:
pr-commented:
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request && github.event.issue.user.login == github.event.comment.user.login && startsWith(github.event.comment.body, '/changelog-entry ') }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.EXPO_BOT_PAT }}
- uses: actions/setup-node@v2
with:
node-version: 18
- name: Checkout Pull Request
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
working-directory: ./scripts
run: yarn install --frozen-lockfile --check-files
- name: Add changelog entry
working-directory: ./scripts
run: |
PARAMS=${PR_COMMENT_BODY#/changelog-entry }
if [[ ! "$PARAMS" =~ " " ]]; then
echo "Invalid /changelog-entry command"
exit 1
fi
CATEGORY=$( cut -d ' ' -f 1 <<< "$PARAMS" | sed -e 's/^[[:space:]]*//' )
MESSAGE=$( cut -d ' ' -f 2- <<< "$PARAMS" | sed -e 's/^[[:space:]]*//' )
yarn changelog-entry "$CATEGORY" "$MESSAGE"
env:
GITHUB_PR_AUTHOR: ${{ github.event.issue.user.login }}
GITHUB_PR_NUMBER: ${{ github.event.issue.number }}
PR_COMMENT_BODY: ${{ github.event.comment.body }}
- name: Commit and push
run: |
# use the last commit author name and email
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
git add CHANGELOG.md
git commit -m "update CHANGELOG.md"
git push
+29 -40
View File
@@ -1,48 +1,37 @@
on:
issue_comment:
types: [created]
name: CHANGELOG.md PR check
name: Changelog
on:
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
jobs:
pr-commented:
pr-changelog-entry:
name: Check CHANGELOG.md updated
runs-on: ubuntu-latest
if: ${{ github.event.issue.pull_request && github.event.issue.user.login == github.event.comment.user.login && startsWith(github.event.comment.body, '/changelog-entry ') }}
steps:
- uses: actions/checkout@v2
- name: Check if CHANGELOG.md was updated
id: changelog-updated
uses: tj-actions/changed-files@v35
with:
token: ${{ secrets.EXPO_BOT_PAT }}
- uses: actions/setup-node@v2
files: CHANGELOG.md
- name: Fail if CHANGELOG.md was not updated and the "no changelog" label is absent
if: steps.changelog-updated.outputs.any_changed == 'false' && !contains(github.event.pull_request.labels.*.name, 'no changelog')
uses: actions/github-script@v6
with:
node-version: 18
- name: Checkout Pull Request
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
working-directory: ./scripts
run: yarn install --frozen-lockfile --check-files
- name: Add changelog entry
working-directory: ./scripts
run: |
PARAMS=${PR_COMMENT_BODY#/changelog-entry }
if [[ ! "$PARAMS" =~ " " ]]; then
echo "Invalid /changelog-entry command"
exit 1
fi
CATEGORY=$( cut -d ' ' -f 1 <<< "$PARAMS" | sed -e 's/^[[:space:]]*//' )
MESSAGE=$( cut -d ' ' -f 2- <<< "$PARAMS" | sed -e 's/^[[:space:]]*//' )
yarn changelog-entry "$CATEGORY" "$MESSAGE"
env:
GITHUB_PR_AUTHOR: ${{ github.event.issue.user.login }}
GITHUB_PR_NUMBER: ${{ github.event.issue.number }}
PR_COMMENT_BODY: ${{ github.event.comment.body }}
- name: Commit and push
run: |
# use the last commit author name and email
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
git add CHANGELOG.md
git commit -m "update CHANGELOG.md"
git push
script: |
core.setFailed('Please add a changelog entry!')
- uses: mshick/[email protected]
if: always()
with:
message-id: changelog-entry-check
refresh-message-position: true
message: ${{ contains(github.event.pull_request.labels.*.name, 'no changelog') && '⏩ The changelog entry check has been skipped since the "no changelog" label is present.' || '✅ Thank you for adding the changelog entry!' }}
message-failure: |
❌ It looks like a changelog entry is missing for this PR. You have two options: you can add it manually, or you can use the changelog bot to do it for you.
🤖 To use the bot, simply comment on this PR with the command `/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]`.
⏩ If this PR doesn't require a changelog entry, such as if it's an internal change that doesn't affect the user experience, you can add the "no changelog" label to the PR.
+3 -1
View File
@@ -1,4 +1,5 @@
name: Run tests
on:
push:
branches: [main]
@@ -34,11 +35,12 @@ jobs:
- run: yarn lint --max-warnings=0
- run: yarn install --frozen-lockfile --check-files
working-directory: ./scripts
- run: yarn lint-changelog
- uses: codecov/codecov-action@v1
if: ${{ matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- run: yarn lint-changelog
notify-slack:
runs-on: ubuntu-latest
needs: test
+17
View File
@@ -12,6 +12,23 @@ This is the log of notable changes to EAS CLI and related packages.
### 🧹 Chores
- Add `cache.paths` field and deprecate `cache.customPaths`. ([#1794](https://github.com/expo/eas-cli/pull/1794) by [@radoslawkrzemien](https://github.com/radoslawkrzemien))
## [3.10.0](https://github.com/expo/eas-cli/releases/tag/v3.10.0) - 2023-04-21
### 🎉 New features
- Added eas device:rename command. ([#1787](https://github.com/expo/eas-cli/pull/1787) by [@keith-kurak](https://github.com/keith-kurak))
### 🐛 Bug fixes
- Fix `device:delete` not disabling on Apple. ([#1803](https://github.com/expo/eas-cli/pull/1803) by [@keith-kurak](https://github.com/keith-kurak))
- Fix message truncation for updates. ([#1801](https://github.com/expo/eas-cli/pull/1801) by [@wschurman](https://github.com/wschurman))
### 🧹 Chores
- Throw an error if somebody tries to start iOS build with the `large` resource class selected using the deprecated `--resource-class` flag. ([#1795](https://github.com/expo/eas-cli/pull/1795) by [@szdziedzic](https://github.com/szdziedzic))
## [3.9.3](https://github.com/expo/eas-cli/releases/tag/v3.9.3) - 2023-04-18
### 🐛 Bug fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "3.9.3",
"version": "3.10.1",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
+75 -53
View File
@@ -86,6 +86,7 @@ eas --help COMMAND
* [`eas device:create`](#eas-devicecreate)
* [`eas device:delete`](#eas-devicedelete)
* [`eas device:list`](#eas-devicelist)
* [`eas device:rename`](#eas-devicerename)
* [`eas device:view [UDID]`](#eas-deviceview-udid)
* [`eas diagnostics`](#eas-diagnostics)
* [`eas help [COMMAND]`](#eas-help-command)
@@ -131,7 +132,7 @@ ALIASES
$ eas login
```
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/account/login.ts)_
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/account/login.ts)_
## `eas account:logout`
@@ -148,7 +149,7 @@ ALIASES
$ eas logout
```
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/account/logout.ts)_
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/account/logout.ts)_
## `eas account:view`
@@ -165,7 +166,7 @@ ALIASES
$ eas whoami
```
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/account/view.ts)_
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/account/view.ts)_
## `eas analytics [STATUS]`
@@ -179,7 +180,7 @@ DESCRIPTION
display or change analytics settings
```
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/analytics.ts)_
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/analytics.ts)_
## `eas autocomplete [SHELL]`
@@ -229,7 +230,7 @@ DESCRIPTION
create a branch
```
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/create.ts)_
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/create.ts)_
## `eas branch:delete [NAME]`
@@ -250,7 +251,7 @@ DESCRIPTION
delete a branch
```
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/delete.ts)_
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/delete.ts)_
## `eas branch:list`
@@ -270,7 +271,7 @@ DESCRIPTION
list all branches
```
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/list.ts)_
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/list.ts)_
## `eas branch:rename`
@@ -290,7 +291,7 @@ DESCRIPTION
rename a branch
```
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/rename.ts)_
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/rename.ts)_
## `eas branch:view [NAME]`
@@ -313,7 +314,7 @@ DESCRIPTION
view a branch
```
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/view.ts)_
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/view.ts)_
## `eas build`
@@ -343,7 +344,7 @@ DESCRIPTION
start a build
```
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/index.ts)_
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/index.ts)_
## `eas build:cancel [BUILD_ID]`
@@ -360,7 +361,7 @@ DESCRIPTION
cancel a build
```
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/cancel.ts)_
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/cancel.ts)_
## `eas build:configure`
@@ -377,7 +378,7 @@ DESCRIPTION
configure the project to support EAS Build
```
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/configure.ts)_
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/configure.ts)_
## `eas build:inspect`
@@ -412,7 +413,7 @@ DESCRIPTION
inspect the state of the project at specific build stages, useful for troubleshooting
```
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/inspect.ts)_
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/inspect.ts)_
## `eas build:list`
@@ -449,7 +450,7 @@ DESCRIPTION
list all builds for your project
```
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/list.ts)_
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/list.ts)_
## `eas build:resign`
@@ -475,7 +476,7 @@ DESCRIPTION
re-sign a build archive
```
_See code: [src/commands/build/resign.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/resign.ts)_
_See code: [src/commands/build/resign.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/resign.ts)_
## `eas build:run`
@@ -499,7 +500,7 @@ DESCRIPTION
run simulator/emulator builds from eas-cli
```
_See code: [src/commands/build/run.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/run.ts)_
_See code: [src/commands/build/run.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/run.ts)_
## `eas build:submit`
@@ -546,7 +547,7 @@ DESCRIPTION
Update version of an app.
```
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/version/set.ts)_
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/version/set.ts)_
## `eas build:version:sync`
@@ -565,7 +566,7 @@ DESCRIPTION
Update a version in native code with a value stored on EAS servers
```
_See code: [src/commands/build/version/sync.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/version/sync.ts)_
_See code: [src/commands/build/version/sync.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/version/sync.ts)_
## `eas build:view [BUILD_ID]`
@@ -582,7 +583,7 @@ DESCRIPTION
view a build for your project
```
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/view.ts)_
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/view.ts)_
## `eas channel:create [NAME]`
@@ -603,7 +604,7 @@ DESCRIPTION
create a channel
```
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/create.ts)_
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/create.ts)_
## `eas channel:edit [NAME]`
@@ -625,7 +626,7 @@ DESCRIPTION
point a channel at a new branch
```
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/edit.ts)_
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/edit.ts)_
## `eas channel:list`
@@ -645,7 +646,7 @@ DESCRIPTION
list all channels
```
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/list.ts)_
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/list.ts)_
## `eas channel:rollout [CHANNEL]`
@@ -669,7 +670,7 @@ DESCRIPTION
Roll a new branch out on a channel incrementally.
```
_See code: [src/commands/channel/rollout.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/rollout.ts)_
_See code: [src/commands/channel/rollout.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/rollout.ts)_
## `eas channel:view [NAME]`
@@ -692,7 +693,7 @@ DESCRIPTION
view a channel
```
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/view.ts)_
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/view.ts)_
## `eas config`
@@ -713,7 +714,7 @@ DESCRIPTION
display project configuration (app.json + eas.json)
```
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/config.ts)_
## `eas credentials`
@@ -730,7 +731,7 @@ DESCRIPTION
manage credentials
```
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/credentials.ts)_
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/credentials.ts)_
## `eas device:create`
@@ -744,7 +745,7 @@ DESCRIPTION
register new Apple Devices to use for internal distribution
```
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/create.ts)_
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/create.ts)_
## `eas device:delete`
@@ -764,7 +765,7 @@ DESCRIPTION
remove a registered device from your account
```
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/delete.ts)_
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/delete.ts)_
## `eas device:list`
@@ -785,7 +786,28 @@ DESCRIPTION
list all registered devices for your account
```
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/list.ts)_
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/list.ts)_
## `eas device:rename`
rename a registered device
```
USAGE
$ eas device:rename [--apple-team-id <value>] [--udid <value>] [--name <value>] [--json --non-interactive]
FLAGS
--apple-team-id=<value> The Apple team ID on which to find the device
--json Enable JSON output, non-JSON messages will be printed to stderr.
--name=<value> The new name for the device
--non-interactive Run the command in non-interactive mode.
--udid=<value> The Apple device ID to rename
DESCRIPTION
rename a registered device
```
_See code: [src/commands/device/rename.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/rename.ts)_
## `eas device:view [UDID]`
@@ -799,7 +821,7 @@ DESCRIPTION
view a device for your project
```
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/view.ts)_
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/view.ts)_
## `eas diagnostics`
@@ -813,7 +835,7 @@ DESCRIPTION
display environment info
```
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/diagnostics.ts)_
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/diagnostics.ts)_
## `eas help [COMMAND]`
@@ -901,7 +923,7 @@ DESCRIPTION
validate the local store configuration
```
_See code: [src/commands/metadata/lint.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/metadata/lint.ts)_
_See code: [src/commands/metadata/lint.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/metadata/lint.ts)_
## `eas metadata:pull`
@@ -918,7 +940,7 @@ DESCRIPTION
generate the local store configuration from the app stores
```
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/metadata/pull.ts)_
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/metadata/pull.ts)_
## `eas metadata:push`
@@ -935,7 +957,7 @@ DESCRIPTION
sync the local store configuration to the app stores
```
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/metadata/push.ts)_
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/metadata/push.ts)_
## `eas open`
@@ -949,7 +971,7 @@ DESCRIPTION
open the project page in a web browser
```
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/open.ts)_
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/open.ts)_
## `eas project:info`
@@ -963,7 +985,7 @@ DESCRIPTION
information about the current project
```
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/project/info.ts)_
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/project/info.ts)_
## `eas project:init`
@@ -985,7 +1007,7 @@ ALIASES
$ eas init
```
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/project/init.ts)_
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/project/init.ts)_
## `eas secret:create`
@@ -1008,7 +1030,7 @@ DESCRIPTION
create an environment secret on the current project or owner account
```
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/create.ts)_
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/secret/create.ts)_
## `eas secret:delete`
@@ -1026,7 +1048,7 @@ DESCRIPTION
delete an environment secret by ID
```
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/delete.ts)_
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/secret/delete.ts)_
## `eas secret:list`
@@ -1040,7 +1062,7 @@ DESCRIPTION
list environment secrets available for your current app
```
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/list.ts)_
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/secret/list.ts)_
## `eas secret:push`
@@ -1060,7 +1082,7 @@ DESCRIPTION
read environment secrets from env file and store on the server
```
_See code: [src/commands/secret/push.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/push.ts)_
_See code: [src/commands/secret/push.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/secret/push.ts)_
## `eas submit`
@@ -1090,7 +1112,7 @@ ALIASES
$ eas build:submit
```
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/submit.ts)_
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/submit.ts)_
## `eas update`
@@ -1122,7 +1144,7 @@ DESCRIPTION
publish an update group
```
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/index.ts)_
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/index.ts)_
## `eas update:configure`
@@ -1140,7 +1162,7 @@ DESCRIPTION
configure the project to support EAS Update
```
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/configure.ts)_
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/configure.ts)_
## `eas update:delete GROUPID`
@@ -1161,7 +1183,7 @@ DESCRIPTION
delete all the updates in an update group
```
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/delete.ts)_
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/delete.ts)_
## `eas update:list`
@@ -1183,7 +1205,7 @@ DESCRIPTION
view the recent updates
```
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/list.ts)_
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/list.ts)_
## `eas update:republish`
@@ -1207,7 +1229,7 @@ DESCRIPTION
roll back to an existing update
```
_See code: [src/commands/update/republish.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/republish.ts)_
_See code: [src/commands/update/republish.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/republish.ts)_
## `eas update:view GROUPID`
@@ -1227,7 +1249,7 @@ DESCRIPTION
update group details
```
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/view.ts)_
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/view.ts)_
## `eas webhook:create`
@@ -1248,7 +1270,7 @@ DESCRIPTION
create a webhook
```
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/create.ts)_
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/create.ts)_
## `eas webhook:delete [ID]`
@@ -1268,7 +1290,7 @@ DESCRIPTION
delete a webhook
```
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/delete.ts)_
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/delete.ts)_
## `eas webhook:list`
@@ -1286,7 +1308,7 @@ DESCRIPTION
list webhooks
```
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/list.ts)_
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/list.ts)_
## `eas webhook:update`
@@ -1308,7 +1330,7 @@ DESCRIPTION
update a webhook
```
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/update.ts)_
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/update.ts)_
## `eas webhook:view ID`
@@ -1325,7 +1347,7 @@ DESCRIPTION
view a webhook
```
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/view.ts)_
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/view.ts)_
## `eas whoami`
+17 -83
View File
@@ -737,7 +737,7 @@
},
{
"name": "appsPaginated",
"description": "Paginated list of apps associated with this account. By default sorted by name. Use filter to adjust the sorting order.",
"description": null,
"args": [
{
"name": "after",
@@ -763,18 +763,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "filter",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "AccountAppsFilterInput",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "first",
"description": null,
@@ -1695,56 +1683,6 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "AccountAppsFilterInput",
"description": null,
"fields": null,
"inputFields": [
{
"name": "sortByField",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "AccountAppsSortByField",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "AccountAppsSortByField",
"description": null,
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "LATEST_ACTIVITY_TIME",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "NAME",
"description": "Name prefers the display name but falls back to full_name with @account/\npart stripped.",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "AccountDataInput",
@@ -14269,6 +14207,22 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "customPaths",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "disabled",
"description": null,
@@ -14292,26 +14246,6 @@
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "paths",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
+1
View File
@@ -2,4 +2,5 @@ module.exports = async () => {
process.env.TZ = 'UTC';
process.env.EAS_NO_VCS = '1';
process.env.EAS_PROJECT_ROOT = '/app';
process.env.FORCE_COLOR = '1';
};
+3 -3
View File
@@ -1,7 +1,7 @@
{
"name": "eas-cli",
"description": "EAS command line tool",
"version": "3.9.3",
"version": "3.10.1",
"author": "Expo <[email protected]>",
"bin": {
"eas": "./bin/run"
@@ -13,8 +13,8 @@
"@expo/config": "7.0.3",
"@expo/config-plugins": "5.0.4",
"@expo/config-types": "47.0.0",
"@expo/eas-build-job": "1.0.7",
"@expo/eas-json": "3.9.2",
"@expo/eas-build-job": "1.0.10",
"@expo/eas-json": "3.10.1",
"@expo/json-file": "8.2.37",
"@expo/multipart-body-parser": "1.1.0",
"@expo/osascript": "2.0.33",
@@ -24,7 +24,7 @@ interface JobData {
const cacheDefaults = {
disabled: false,
customPaths: [],
paths: [],
};
export async function prepareJobAsync(
+1 -1
View File
@@ -27,7 +27,7 @@ interface JobData {
const cacheDefaults = {
disabled: false,
customPaths: [],
paths: [],
};
export async function prepareJobAsync(
@@ -5,7 +5,7 @@ import chalk from 'chalk';
import semver from 'semver';
import { BuildResourceClass } from '../../graphql/generated';
import Log from '../../log';
import Log, { link } from '../../log';
import { getReactNativeVersionAsync } from '../metadata';
type AndroidResourceClass = Exclude<
@@ -50,14 +50,14 @@ export async function resolveBuildResourceClassAsync<T extends Platform>(
if (profileResourceClass && resourceClassFlag && resourceClassFlag !== profileResourceClass) {
Log.warn(
`Build profile specifies the "${profileResourceClass}" resource class but you passed "${resourceClassFlag}" to --resource-class.\nUsing the "${resourceClassFlag}" as the override.`
`Build profile specifies the "${profileResourceClass}" resource class but you passed "${resourceClassFlag}" to --resource-class.\nUsing "${resourceClassFlag}" as the override.`
);
}
const selectedResourceClass = resourceClassFlag ?? profileResourceClass;
return platform === Platform.IOS
? await resolveIosResourceClassAsync(exp, projectDir, resourceClassFlag ?? profileResourceClass)
? await resolveIosResourceClassAsync(exp, projectDir, resourceClassFlag, profileResourceClass)
: resolveAndroidResourceClass(selectedResourceClass);
}
@@ -82,10 +82,21 @@ function resolveAndroidResourceClass(selectedResourceClass?: ResourceClass): Bui
async function resolveIosResourceClassAsync(
exp: ExpoConfig,
projectDir: string,
selectedResourceClass?: ResourceClass
resourceClassFlag?: ResourceClass,
profileResourceClass?: ResourceClass
): Promise<BuildResourceClass> {
const resourceClass =
selectedResourceClass ?? (await resolveIosDefaultRequestedResourceClassAsync(exp, projectDir));
resourceClassFlag ??
profileResourceClass ??
(await resolveIosDefaultRequestedResourceClassAsync(exp, projectDir));
if (resourceClassFlag === ResourceClass.LARGE) {
throw new Error(
`Experimental "large" resource class for Intel iOS workers is no longer available. Remove the specified resource class to use the default, or learn more about all available resource classes: ${link(
'https://docs.expo.dev/build-reference/eas-json/'
)}`
);
}
if ([ResourceClass.M1_EXPERIMENTAL, ResourceClass.M1_MEDIUM].includes(resourceClass)) {
Log.warn(
@@ -112,11 +112,17 @@ export default class DeviceDelete extends EasCommand {
const removeAppleSpinner = ora('Disabling device on Apple').start();
try {
const appleValidatedDevices = await Device.getAsync(context);
const appleValidatedDevice = appleValidatedDevices.find(d => d.id === device.id);
const appleValidatedDevice = appleValidatedDevices.find(
d => d.attributes.udid === device.identifier
);
if (appleValidatedDevice) {
await appleValidatedDevice.updateAsync({ status: DeviceStatus.DISABLED });
removeAppleSpinner.succeed('Disabled device on Apple');
} else {
removeAppleSpinner.warn(
'Device not found on Apple Developer Portal. Expo-registered devices will not appear there until they are chosen for an internal distribution build.'
);
}
removeAppleSpinner.succeed('Disabled device on Apple');
} catch (err) {
removeAppleSpinner.fail();
throw err;
@@ -0,0 +1,168 @@
import { Device } from '@expo/apple-utils';
import { Flags } from '@oclif/core';
import assert from 'assert';
import EasCommand from '../../commandUtils/EasCommand';
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
import { EasNonInteractiveAndJsonFlags } from '../../commandUtils/flags';
import { PaginatedQueryOptions, getPaginatedQueryOptions } from '../../commandUtils/pagination';
import { AppleDeviceMutation } from '../../credentials/ios/api/graphql/mutations/AppleDeviceMutation';
import {
AppleDeviceQuery,
AppleDeviceQueryResult,
} from '../../credentials/ios/api/graphql/queries/AppleDeviceQuery';
import { authenticateAsync, getRequestContext } from '../../credentials/ios/appstore/authenticate';
import {
selectAppleDeviceOnAppleTeamAsync,
selectAppleTeamOnAccountAsync,
} from '../../devices/queries';
import formatDevice from '../../devices/utils/formatDevice';
import { AppleDevice, AppleTeamFragment, Maybe } from '../../graphql/generated';
import Log from '../../log';
import { ora } from '../../ora';
import { getOwnerAccountForProjectIdAsync } from '../../project/projectUtils';
import { promptAsync } from '../../prompts';
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
export default class DeviceRename extends EasCommand {
static override description = 'rename a registered device';
static override flags = {
'apple-team-id': Flags.string({ description: 'The Apple team ID on which to find the device' }),
udid: Flags.string({ description: 'The Apple device ID to rename' }),
name: Flags.string({ description: 'The new name for the device' }),
...EasNonInteractiveAndJsonFlags,
};
static override contextDefinition = {
...this.ContextOptions.ProjectConfig,
...this.ContextOptions.LoggedIn,
};
async runAsync(): Promise<void> {
const { flags } = await this.parse(DeviceRename);
const paginatedQueryOptions = getPaginatedQueryOptions(flags);
let { 'apple-team-id': appleTeamIdentifier, udid, name } = flags;
const {
projectConfig: { projectId },
loggedIn: { graphqlClient },
} = await this.getContextAsync(DeviceRename, {
nonInteractive: paginatedQueryOptions.nonInteractive,
});
const account = await getOwnerAccountForProjectIdAsync(graphqlClient, projectId);
let appleTeamName;
if (paginatedQueryOptions.json) {
enableJsonOutput();
}
let appleTeam: AppleTeamFragment;
if (!appleTeamIdentifier) {
appleTeam = await selectAppleTeamOnAccountAsync(graphqlClient, {
accountName: account.name,
selectionPromptTitle: `What Apple team would you like to list devices for?`,
paginatedQueryOptions,
});
appleTeamIdentifier = appleTeam.appleTeamIdentifier;
appleTeamName = appleTeam.appleTeamName;
}
assert(appleTeamIdentifier, 'No team identifier is specified');
const chosenDevice = udid
? await AppleDeviceQuery.getByDeviceIdentifierAsync(graphqlClient, account.name, udid)
: await selectAppleDeviceOnAppleTeamAsync(graphqlClient, {
accountName: account.name,
appleTeamIdentifier,
selectionPromptTitle: `Which device would you like to rename?`,
paginatedQueryOptions,
});
const newDeviceName = name ? name : await this.promptForNewDeviceNameAsync(chosenDevice.name);
this.logChosenDevice(chosenDevice, appleTeamName, appleTeamIdentifier, paginatedQueryOptions);
await this.renameDeviceOnExpoAsync(graphqlClient, chosenDevice, newDeviceName!);
await this.renameDeviceOnAppleAsync(chosenDevice, appleTeamIdentifier, newDeviceName!);
}
async promptForNewDeviceNameAsync(
initial: Maybe<string> | undefined
): Promise<string | undefined> {
const { name } = await promptAsync({
type: 'text',
name: 'name',
message: 'New device name:',
initial: initial ?? undefined,
});
return name;
}
async renameDeviceOnExpoAsync(
graphqlClient: ExpoGraphqlClient,
chosenDevice: AppleDevice | AppleDeviceQueryResult,
newDeviceName: string
): Promise<void> {
const removalSpinner = ora(`Renaming Apple device on Expo`).start();
try {
await AppleDeviceMutation.updateAppleDeviceAsync(graphqlClient, chosenDevice.id, {
name: newDeviceName,
});
removalSpinner.succeed('Renamed Apple device on Expo');
} catch (err) {
removalSpinner.fail();
throw err;
}
}
async renameDeviceOnAppleAsync(
device: AppleDevice | AppleDeviceQueryResult,
appleTeamIdentifier: string,
newDeviceName: string
): Promise<void> {
const ctx = await authenticateAsync({ teamId: appleTeamIdentifier });
const context = getRequestContext(ctx);
Log.addNewLineIfNone();
const removeAppleSpinner = ora('Renaming device on Apple').start();
try {
const appleValidatedDevices = await Device.getAsync(context);
const appleValidatedDevice = appleValidatedDevices.find(
d => d.attributes.udid === device.identifier
);
if (appleValidatedDevice) {
await appleValidatedDevice.updateAsync({ name: newDeviceName });
removeAppleSpinner.succeed('Renamed device on Apple');
} else {
removeAppleSpinner.warn(
'Device not found on Apple Developer Portal. Expo-registered devices will not appear there until they are chosen for an internal distribution build.'
);
}
} catch (err) {
removeAppleSpinner.fail();
throw err;
}
}
logChosenDevice(
device: AppleDevice | AppleDeviceQueryResult,
appleTeamName: Maybe<string> | undefined,
appleTeamIdentifier: string,
{ json }: PaginatedQueryOptions
): void {
if (json) {
printJsonOnlyOutput(device);
} else {
Log.addNewLineIfNone();
Log.log(
formatDevice(device, {
appleTeamName,
appleTeamIdentifier: appleTeamIdentifier!,
})
);
Log.newLine();
}
}
}
@@ -39,7 +39,6 @@ import {
} from '../../project/publish';
import { ensureEASUpdateIsConfiguredAsync } from '../../update/configure';
import { getUpdateGroupJsonInfo } from '../../update/utils';
import { maybeWarnAboutEasPlanOverageAsync } from '../../utils/billing';
import {
checkManifestBodyAgainstUpdateInfoGroup,
getCodeSigningInfoAsync,
@@ -177,7 +176,6 @@ export default class UpdatePublish extends EasCommand {
isPublicConfig: true,
});
await maybeWarnAboutEasPlanOverageAsync(graphqlClient, projectId);
await maybeWarnAboutEasOutagesAsync(graphqlClient, [StatuspageServiceName.EasUpdate]);
await ensureEASUpdateIsConfiguredAsync(graphqlClient, {
@@ -6,8 +6,10 @@ import { withErrorHandlingAsync } from '../../../../../graphql/client';
import {
AppleDeviceFragment,
AppleDeviceInput,
AppleDeviceUpdateInput,
CreateAppleDeviceMutation,
DeleteAppleDeviceResult,
UpdateAppleDeviceMutation,
} from '../../../../../graphql/generated';
import { AppleDeviceFragmentNode } from '../../../../../graphql/types/credentials/AppleDevice';
@@ -67,4 +69,35 @@ export const AppleDeviceMutation = {
);
return data.id;
},
async updateAppleDeviceAsync(
graphqlClient: ExpoGraphqlClient,
id: string,
appleDeviceUpdateInput: AppleDeviceUpdateInput
): Promise<AppleDeviceFragment> {
const data = await withErrorHandlingAsync(
graphqlClient
.mutation<UpdateAppleDeviceMutation>(
gql`
mutation UpdateAppleDeviceMutation(
$id: ID!
$appleDeviceUpdateInput: AppleDeviceUpdateInput!
) {
appleDevice {
updateAppleDevice(id: $id, appleDeviceUpdateInput: $appleDeviceUpdateInput) {
id
...AppleDeviceFragment
}
}
}
${print(AppleDeviceFragmentNode)}
`,
{
id,
appleDeviceUpdateInput,
}
)
.toPromise()
);
return data.appleDevice.updateAppleDevice;
},
};
@@ -81,7 +81,9 @@ async function collectDeviceDataAsync(
Log.newLine();
Log.log(
`We are going to register the following device in our database.
This will ${chalk.bold('not')} register the device on the Apple Developer Portal yet.`
This device will ${chalk.bold(
'not'
)} be registered on the Apple Developer Portal until it is chosen for an internal distribution build.`
);
Log.newLine();
Log.log(formatNewDevice({ ...deviceData, identifier: deviceData.udid }, appleTeam));
+9 -26
View File
@@ -87,7 +87,6 @@ export type Account = {
appleTeams: Array<AppleTeam>;
/** Apps associated with this account */
apps: Array<App>;
/** Paginated list of apps associated with this account. By default sorted by name. Use filter to adjust the sorting order. */
appsPaginated: AccountAppsConnection;
/** @deprecated Build packs are no longer supported */
availableBuilds?: Maybe<Scalars['Int']>;
@@ -220,7 +219,6 @@ export type AccountAppsArgs = {
export type AccountAppsPaginatedArgs = {
after?: InputMaybe<Scalars['String']>;
before?: InputMaybe<Scalars['String']>;
filter?: InputMaybe<AccountAppsFilterInput>;
first?: InputMaybe<Scalars['Int']>;
last?: InputMaybe<Scalars['Int']>;
};
@@ -311,19 +309,6 @@ export type AccountAppsEdge = {
node: App;
};
export type AccountAppsFilterInput = {
sortByField: AccountAppsSortByField;
};
export enum AccountAppsSortByField {
LatestActivityTime = 'LATEST_ACTIVITY_TIME',
/**
* Name prefers the display name but falls back to full_name with @account/
* part stripped.
*/
Name = 'NAME'
}
export type AccountDataInput = {
name: Scalars['String'];
};
@@ -2051,9 +2036,9 @@ export type BuildArtifacts = {
export type BuildCacheInput = {
clear?: InputMaybe<Scalars['Boolean']>;
customPaths?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
disabled?: InputMaybe<Scalars['Boolean']>;
key?: InputMaybe<Scalars['String']>;
paths?: InputMaybe<Array<Scalars['String']>>;
};
export enum BuildCredentialsSource {
@@ -5521,6 +5506,14 @@ export type DeleteAppleDeviceMutationVariables = Exact<{
export type DeleteAppleDeviceMutation = { __typename?: 'RootMutation', appleDevice: { __typename?: 'AppleDeviceMutation', deleteAppleDevice: { __typename?: 'DeleteAppleDeviceResult', id: string } } };
export type UpdateAppleDeviceMutationVariables = Exact<{
id: Scalars['ID'];
appleDeviceUpdateInput: AppleDeviceUpdateInput;
}>;
export type UpdateAppleDeviceMutation = { __typename?: 'RootMutation', appleDevice: { __typename?: 'AppleDeviceMutation', updateAppleDevice: { __typename?: 'AppleDevice', id: string, identifier: string, name?: string | null, model?: string | null, deviceClass?: AppleDeviceClass | null } } };
export type CreateAppleDeviceRegistrationRequestMutationVariables = Exact<{
appleTeamId: Scalars['ID'];
accountId: Scalars['ID'];
@@ -5929,14 +5922,6 @@ export type LatestAppVersionQueryVariables = Exact<{
export type LatestAppVersionQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, latestAppVersionByPlatformAndApplicationIdentifier?: { __typename?: 'AppVersion', id: string, storeVersion: string, buildVersion: string } | null } } };
export type BillingUpdateByAccountQueryVariables = Exact<{
accountId: Scalars['String'];
date: Scalars['DateTime'];
}>;
export type BillingUpdateByAccountQuery = { __typename?: 'RootQuery', account: { __typename?: 'AccountQuery', byId: { __typename?: 'Account', id: string, billing?: { __typename?: 'Billing', id: string, subscription?: { __typename?: 'SubscriptionDetails', id: string, name?: string | null, meteredBillingStatus: { __typename?: 'MeteredBillingStatus', EAS_UPDATE: boolean } } | null } | null, usageMetrics: { __typename?: 'AccountUsageMetrics', byBillingPeriod: { __typename?: 'UsageMetricTotal', id: string, planMetrics: Array<{ __typename?: 'EstimatedUsage', id: string, serviceMetric: EasServiceMetric, metricType: UsageMetricType, value: number, limit: number }> } } } } };
export type ViewBranchQueryVariables = Exact<{
appId: Scalars['String'];
name: Scalars['String'];
@@ -6101,8 +6086,6 @@ export type WebhookByIdQuery = { __typename?: 'RootQuery', webhook: { __typename
export type AccountFragment = { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'SSOUser', id: string } | { __typename?: 'User', id: string } }> };
export type AccountUpdatesUsageFragment = { __typename?: 'Account', id: string, billing?: { __typename?: 'Billing', id: string, subscription?: { __typename?: 'SubscriptionDetails', id: string, name?: string | null, meteredBillingStatus: { __typename?: 'MeteredBillingStatus', EAS_UPDATE: boolean } } | null } | null, usageMetrics: { __typename?: 'AccountUsageMetrics', byBillingPeriod: { __typename?: 'UsageMetricTotal', id: string, planMetrics: Array<{ __typename?: 'EstimatedUsage', id: string, serviceMetric: EasServiceMetric, metricType: UsageMetricType, value: number, limit: number }> } } };
export type AppFragment = { __typename?: 'App', id: string, fullName: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'SSOUser', id: string } | { __typename?: 'User', id: string } }> } };
export type BuildFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, resourceClass: BuildResourceClass, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'SSOUser', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } };
@@ -1,66 +0,0 @@
import assert from 'assert';
import gql from 'graphql-tag';
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
import { withErrorHandlingAsync } from '../client';
import { BillingUpdateByAccountQuery } from '../generated';
export const BillingUpdateQuery = {
async byAccountIdAsync(
graphqlClient: ExpoGraphqlClient,
accountId: string,
date: Date
): Promise<BillingUpdateByAccountQuery['account']['byId']> {
const data = await withErrorHandlingAsync(
graphqlClient
.query<BillingUpdateByAccountQuery>(
gql`
query BillingUpdateByAccountQuery($accountId: String!, $date: DateTime!) {
account {
byId(accountId: $accountId) {
id
billing {
id
subscription {
id
name
meteredBillingStatus {
EAS_UPDATE
}
}
}
usageMetrics {
byBillingPeriod(date: $date, service: UPDATES) {
id
planMetrics {
id
serviceMetric
metricType
value
limit
}
}
}
}
}
}
`,
{ accountId, date },
{
additionalTypenames: [
'Account',
'Billing',
'SubscriptionDetails',
'AccountUsageMetrics',
'UsageMetricTotal',
'EstimatedUsage',
],
}
)
.toPromise()
);
assert(data.account, 'GraphQL: `account` not defined in server response');
return data.account.byId;
},
};
@@ -1,29 +0,0 @@
import gql from 'graphql-tag';
export const AccountUpdatesUsageFragmentNode = gql`
fragment AccountUpdatesUsageFragment on Account {
id
billing {
id
subscription {
id
name
meteredBillingStatus {
EAS_UPDATE
}
}
}
usageMetrics {
byBillingPeriod(date: $date, service: UPDATES) {
id
planMetrics {
id
serviceMetric
metricType
value
limit
}
}
}
}
`;
+4 -1
View File
@@ -1,3 +1,4 @@
import { boolish } from 'getenv';
// eslint-disable-next-line
import oraReal, { Options, Ora } from 'ora';
@@ -14,6 +15,8 @@ const warnReal = console.warn;
// eslint-disable-next-line no-console
const errorReal = console.error;
const isCi = boolish('CI', false);
/**
* A custom ora spinner that sends the stream to stdout in CI, or non-TTY, instead of stderr (the default).
*
@@ -22,7 +25,7 @@ const errorReal = console.error;
*/
export function ora(options?: Options | string): Ora {
const inputOptions = typeof options === 'string' ? { text: options } : options ?? {};
const disabled = Log.isDebug || !process.stdin.isTTY;
const disabled = Log.isDebug || !process.stdin.isTTY || isCi;
const spinner = oraReal({
// Ensure our non-interactive mode emulates CI mode.
isEnabled: !disabled,
+1 -1
View File
@@ -577,7 +577,7 @@ export async function getUpdateMessageForCommandAsync({
Log.warn('Update message exceeds the allowed 1024 character limit. Truncating message...');
}
return updateMessage;
return truncatedMessage;
}
export const defaultPublishPlatforms: Platform[] = ['android', 'ios'];
@@ -0,0 +1,38 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`maybePrintBuildProfileDeprecationWarningsAsync multiple deprecation warnings prints the warnings 1`] = `
[
[
"Detected deprecated fields in eas.json:",
],
[
" The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.",
],
[
" Learn more: https://docs.expo.dev/build-reference/eas-json/#cache",
],
[
" The "build.production.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.",
],
[
" Learn more: https://docs.expo.dev/build-reference/caching/#ios-dependencies",
],
[
" Other message",
],
]
`;
exports[`maybePrintBuildProfileDeprecationWarningsAsync one deprecation warning prints the warning 1`] = `
[
[
"Detected deprecated fields in eas.json:",
],
[
" The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.",
],
[
" Learn more: https://docs.expo.dev/build-reference/eas-json/#cache",
],
]
`;
@@ -1,8 +1,13 @@
import { Platform } from '@expo/eas-build-job';
import { EasJsonAccessor, EasJsonUtils, errors } from '@expo/eas-json';
import { BuildProfile, EasJsonAccessor, EasJsonUtils, errors } from '@expo/eas-json';
import Log from '../../log';
import { selectAsync } from '../../prompts';
import { getProfilesAsync } from '../profiles';
import {
clearHasPrintedDeprecationWarnings,
getProfilesAsync,
maybePrintBuildProfileDeprecationWarningsAsync,
} from '../profiles';
jest.mock('../../prompts');
jest.mock('@expo/eas-json', () => {
@@ -11,7 +16,7 @@ jest.mock('@expo/eas-json', () => {
const EasJsonUtilsMock = {
getBuildProfileAsync: jest.fn(),
getBuildProfileNamesAsync: jest.fn(),
getBuildProfileDeprecationWarnings: jest.fn(() => []),
getBuildProfileDeprecationWarningsAsync: jest.fn(() => []),
};
return {
...actual,
@@ -21,6 +26,12 @@ jest.mock('@expo/eas-json', () => {
const getBuildProfileAsync = jest.spyOn(EasJsonUtils, 'getBuildProfileAsync');
const getBuildProfileNamesAsync = jest.spyOn(EasJsonUtils, 'getBuildProfileNamesAsync');
const getBuildProfileDeprecationWarningsAsync = jest.spyOn(
EasJsonUtils,
'getBuildProfileDeprecationWarningsAsync'
);
const newLineSpy = jest.spyOn(Log, 'newLine');
const warnSpy = jest.spyOn(Log, 'warn');
describe(getProfilesAsync, () => {
afterEach(() => {
@@ -31,6 +42,10 @@ describe(getProfilesAsync, () => {
it('defaults to production profile', async () => {
const easJsonAccessor = EasJsonAccessor.fromProjectPath('/fake');
const readRawEasJsonMock = jest.spyOn(easJsonAccessor, 'readRawJsonAsync');
readRawEasJsonMock.mockImplementation(async () => {
return {};
});
const result = await getProfilesAsync({
easJsonAccessor,
platforms: [Platform.ANDROID, Platform.IOS],
@@ -62,6 +77,10 @@ describe(getProfilesAsync, () => {
it('gets a specific profile', async () => {
const easJsonAccessor = EasJsonAccessor.fromProjectPath('/fake');
const readRawEasJsonMock = jest.spyOn(easJsonAccessor, 'readRawJsonAsync');
readRawEasJsonMock.mockImplementation(async () => {
return {};
});
const result = await getProfilesAsync({
easJsonAccessor,
platforms: [Platform.ANDROID, Platform.IOS],
@@ -94,3 +113,82 @@ describe(getProfilesAsync, () => {
).rejects.toThrowError(/eas.json is not valid/);
});
});
describe(maybePrintBuildProfileDeprecationWarningsAsync, () => {
afterEach(() => {
clearHasPrintedDeprecationWarnings();
newLineSpy.mockClear();
warnSpy.mockClear();
});
const easJsonAccessor = EasJsonAccessor.fromProjectPath('/fake');
const readRawEasJsonMock = jest.spyOn(easJsonAccessor, 'readRawJsonAsync');
readRawEasJsonMock.mockImplementation(async () => {
return {};
});
getBuildProfileAsync.mockImplementation(async () => {
return {} as BuildProfile<Platform.ANDROID>;
});
describe('no deprecation warnings', () => {
it('does not print any warnings', async () => {
getBuildProfileDeprecationWarningsAsync.mockImplementation(async () => []);
await maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(newLineSpy).not.toHaveBeenCalled();
expect(warnSpy).not.toHaveBeenCalled();
});
});
describe('one deprecation warning', () => {
it('prints the warning', async () => {
getBuildProfileDeprecationWarningsAsync.mockImplementation(async () => [
{
message: [
'The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.',
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
await maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(newLineSpy).toHaveBeenCalledTimes(2);
expect(warnSpy).toHaveBeenCalledTimes(3);
const warnCalls = warnSpy.mock.calls;
expect(warnCalls).toMatchSnapshot();
});
});
describe('multiple deprecation warnings', () => {
it('prints the warnings', async () => {
getBuildProfileDeprecationWarningsAsync.mockImplementation(async () => [
{
message: [
'The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.',
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
{
message: [
'The "build.production.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.',
],
docsUrl: 'https://docs.expo.dev/build-reference/caching/#ios-dependencies',
},
{
message: ['Other message'],
},
]);
await maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(newLineSpy).toHaveBeenCalledTimes(4);
expect(warnSpy).toHaveBeenCalledTimes(6);
const warnCalls = warnSpy.mock.calls;
expect(warnCalls).toMatchSnapshot();
});
});
});
-44
View File
@@ -1,44 +0,0 @@
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
import { BillingUpdateQuery } from '../graphql/queries/BillingUpdateQuery';
import Log from '../log';
import { getOwnerAccountForProjectIdAsync } from '../project/projectUtils';
const WARNING_THRESHOLD = 0.85;
export async function maybeWarnAboutEasPlanOverageAsync(
graphqlClient: ExpoGraphqlClient,
projectId: string
): Promise<void> {
const account = await getOwnerAccountForProjectIdAsync(graphqlClient, projectId);
const billingUpdateQuery = await BillingUpdateQuery.byAccountIdAsync(
graphqlClient,
account.id,
new Date()
);
const isFree = !billingUpdateQuery.billing; // TODO: no billing means free?
const isMetered = !!billingUpdateQuery.billing?.subscription?.meteredBillingStatus?.EAS_UPDATE;
// TODO: verify correctness
if (!isFree || isMetered) {
return;
}
const planMetrics = billingUpdateQuery.usageMetrics.byBillingPeriod.planMetrics;
for (const metric of planMetrics) {
const { value, limit, serviceMetric } = metric;
const percentageUsed = value / limit;
if (percentageUsed >= 1) {
Log.error(
'You have exceeded your EAS Update plan limit. You can create updates but they will no longer be distributed to users.'
);
Log.error('Please upgrade your plan to continue receiving updates.');
return;
} else if (percentageUsed >= WARNING_THRESHOLD && percentageUsed < 1) {
Log.warn(
`You are approaching your EAS Update plan limit. You have used ${Math.round(
percentageUsed * 100
)}% of your plan's ${serviceMetric}.`
);
Log.warn('Please upgrade your plan to continue receiving updates.');
}
}
}
+16 -7
View File
@@ -65,7 +65,7 @@ async function readProfileAsync<T extends ProfileType>({
profileName
);
maybePrintBuildProfileDeprecationWarnings(buildProfile, profileName);
await maybePrintBuildProfileDeprecationWarningsAsync(easJsonAccessor, platform, profileName);
return buildProfile as EasProfile<T>;
} else {
@@ -79,16 +79,25 @@ async function readProfileAsync<T extends ProfileType>({
let hasPrintedDeprecationWarnings = false;
function maybePrintBuildProfileDeprecationWarnings(
buildProfile: BuildProfile<Platform>,
/**
* Only for testing purposes
*/
export function clearHasPrintedDeprecationWarnings(): void {
hasPrintedDeprecationWarnings = false;
}
export async function maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor: EasJsonAccessor,
platform: Platform,
profileName?: string
): void {
): Promise<void> {
if (hasPrintedDeprecationWarnings) {
return;
}
const deprecationWarnings = EasJsonUtils.getBuildProfileDeprecationWarnings(
buildProfile,
profileName
const deprecationWarnings = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
platform,
profileName ?? 'production'
);
if (deprecationWarnings.length === 0) {
return;
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "@expo/eas-json",
"description": "A library for interacting with eas.json",
"version": "3.9.2",
"version": "3.10.1",
"author": "Expo <[email protected]>",
"bugs": "https://github.com/expo/eas-cli/issues",
"dependencies": {
"@babel/code-frame": "7.18.6",
"@expo/eas-build-job": "1.0.7",
"@expo/eas-build-job": "1.0.10",
"chalk": "4.1.2",
"env-string": "1.0.1",
"fs-extra": "10.1.0",
+10
View File
@@ -67,6 +67,16 @@
"description": "Cache key. You can invalidate the cache by changing this value."
},
"customPaths": {
"type": "array",
"description": "[DEPRECATED] Use `paths` instead. List of the paths that will be saved after a successful build and restored at the beginning of the next one.",
"markdownDescription": "[DEPRECATED] Use `paths` instead. List of the paths that will be saved after a successful build and restored at the beginning of the next one. Both absolute and relative paths are supported, where relative paths are resolved from the directory with `eas.json`.",
"uniqueItems": true,
"items": {
"type": "string"
},
"deprecated": true
},
"paths": {
"type": "array",
"description": "List of the paths that will be saved after a successful build and restored at the beginning of the next one.",
"markdownDescription": "List of the paths that will be saved after a successful build and restored at the beginning of the next one. Both absolute and relative paths are supported, where relative paths are resolved from the directory with `eas.json`.",
@@ -1,4 +1,5 @@
import { Platform } from '@expo/eas-build-job';
import chalk from 'chalk';
import fs from 'fs-extra';
import { vol } from 'memfs';
@@ -241,6 +242,65 @@ test('valid profile extending other profile with platform specific envs', async
});
test('valid profile extending other profile with platform specific caching', async () => {
await fs.writeJson('/project/eas.json', {
build: {
base: {
cache: {
disabled: true,
},
},
extension: {
extends: 'base',
distribution: 'internal',
cache: {
key: 'extend-key',
},
android: {
cache: {
paths: ['somefakepath'],
},
},
},
},
});
const accessor = EasJsonAccessor.fromProjectPath('/project');
const baseProfile = await EasJsonUtils.getBuildProfileAsync(accessor, Platform.ANDROID, 'base');
const extendedAndroidProfile = await EasJsonUtils.getBuildProfileAsync(
accessor,
Platform.ANDROID,
'extension'
);
const extendedIosProfile = await EasJsonUtils.getBuildProfileAsync(
accessor,
Platform.IOS,
'extension'
);
expect(baseProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: true,
},
});
expect(extendedAndroidProfile).toEqual({
distribution: 'internal',
credentialsSource: 'remote',
cache: {
paths: ['somefakepath'],
},
});
expect(extendedIosProfile).toEqual({
distribution: 'internal',
credentialsSource: 'remote',
cache: {
key: 'extend-key',
},
});
});
test('valid profile extending other profile with platform specific caching - backwards compatible with customPaths', async () => {
await fs.writeJson('/project/eas.json', {
build: {
base: {
@@ -286,7 +346,7 @@ test('valid profile extending other profile with platform specific caching', asy
distribution: 'internal',
credentialsSource: 'remote',
cache: {
customPaths: ['somefakepath'],
paths: ['somefakepath'],
},
});
expect(extendedIosProfile).toEqual({
@@ -484,3 +544,145 @@ test('build profiles with both platform build config', async () => {
credentialsSource: 'remote',
});
});
test('valid build profile with caching without paths', async () => {
await fs.writeJson('/project/eas.json', {
build: {
production: {
cache: {
disabled: false,
},
},
},
});
const accessor = EasJsonAccessor.fromProjectPath('/project');
const iosProfile = await EasJsonUtils.getBuildProfileAsync(accessor, Platform.IOS, 'production');
const androidProfile = await EasJsonUtils.getBuildProfileAsync(
accessor,
Platform.ANDROID,
'production'
);
expect(androidProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: false,
},
});
expect(iosProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: false,
},
});
});
test('valid build profile with caching with paths', async () => {
await fs.writeJson('/project/eas.json', {
build: {
production: {
cache: {
disabled: false,
paths: ['index.ts'],
},
},
},
});
const accessor = EasJsonAccessor.fromProjectPath('/project');
const iosProfile = await EasJsonUtils.getBuildProfileAsync(accessor, Platform.IOS, 'production');
const androidProfile = await EasJsonUtils.getBuildProfileAsync(
accessor,
Platform.ANDROID,
'production'
);
expect(androidProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: false,
paths: ['index.ts'],
},
});
expect(iosProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: false,
paths: ['index.ts'],
},
});
});
test('valid build profile with caching with customPaths - moved into paths and customPaths removed', async () => {
await fs.writeJson('/project/eas.json', {
build: {
production: {
cache: {
disabled: false,
customPaths: ['index.ts'],
},
},
},
});
const accessor = EasJsonAccessor.fromProjectPath('/project');
const iosProfile = await EasJsonUtils.getBuildProfileAsync(accessor, Platform.IOS, 'production');
const androidProfile = await EasJsonUtils.getBuildProfileAsync(
accessor,
Platform.ANDROID,
'production'
);
expect(androidProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: false,
paths: ['index.ts'],
},
});
expect(iosProfile).toEqual({
distribution: 'store',
credentialsSource: 'remote',
cache: {
disabled: false,
paths: ['index.ts'],
},
});
});
test('invalid build profile with caching with both paths and customPaths - error thrown', async () => {
await fs.writeJson('/project/eas.json', {
build: {
production: {
cache: {
disabled: false,
customPaths: ['index.ts'],
paths: ['index2.ts'],
},
},
},
});
const expectedError = new InvalidEasJsonError(
`${chalk.bold(
'eas.json'
)} is not valid.\n- Cannot provide both "cache.customPaths" and "cache.paths" - use "cache.paths"`
);
const accessor = EasJsonAccessor.fromProjectPath('/project');
await expect(async () => {
await EasJsonUtils.getBuildProfileAsync(accessor, Platform.IOS, 'production');
}).rejects.toThrow(expectedError);
await expect(async () => {
await EasJsonUtils.getBuildProfileAsync(accessor, Platform.ANDROID, 'production');
}).rejects.toThrow(expectedError);
});
@@ -0,0 +1,261 @@
import { Platform } from '@expo/eas-build-job';
import { EasJsonAccessor } from '../accessor';
import { AndroidBuildProfile, IosBuildProfile } from '../build/types';
import { EasJsonUtils } from '../utils';
jest.mock('@expo/eas-json', () => {
const actual = jest.requireActual('@expo/eas-json');
const EasJsonUtilsMock = {
getBuildProfileAsync: jest.fn(),
};
return {
...actual,
EasJsonUtils: EasJsonUtilsMock,
};
});
const getBuildProfileAsync = jest.spyOn(EasJsonUtils, 'getBuildProfileAsync');
describe('getBuildProfileDeprecationWarningsAsync', () => {
const easJsonAccessor = EasJsonAccessor.fromProjectPath('/fake');
const readRawEasJsonMock = jest.spyOn(easJsonAccessor, 'readRawJsonAsync');
describe('android', () => {
type BuildProfileType = AndroidBuildProfile;
describe('no cache settings', () => {
it('does not return deprecation warnings', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {};
});
const result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(result).toEqual([]);
});
});
describe('cache settings with paths', () => {
it('does not return deprecation warnings', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {
cache: {
paths: ['path1', 'path2'],
},
} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {
build: {
production: {
cache: {
paths: ['path1', 'path2'],
},
},
},
};
});
const result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(result).toEqual([]);
});
});
describe('cache settings with customPaths', () => {
it('returns deprecation warning', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {
cache: {
paths: ['path1', 'path2'],
},
} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {
build: {
production: {
cache: {
customPaths: ['path1', 'path2'],
},
},
dummy_profile_name: {
cache: {
customPaths: ['path1', 'path2'],
},
},
},
};
});
let result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(result).toEqual([
{
message: [
`The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'dummy_profile_name'
);
expect(result).toEqual([
{
message: [
`The "build.dummy_profile_name.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.dummy_profile_name.cache.paths" instead.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
});
});
});
describe('ios', () => {
type BuildProfileType = IosBuildProfile;
describe('no cache settings', () => {
it('does not return deprecation warnings', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {};
});
const result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.IOS,
'production'
);
expect(result).toEqual([]);
});
});
describe('cache settings with paths', () => {
it('does not return deprecation warnings', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {
cache: {
paths: ['path1', 'path2'],
},
} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {
build: {
production: {
cache: {
paths: ['path1', 'path2'],
},
},
},
};
});
const result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.IOS,
'production'
);
expect(result).toEqual([]);
});
});
describe('cache settings with customPaths', () => {
it('returns deprecation warning', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {
cache: {
paths: ['path1', 'path2'],
},
} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {
build: {
production: {
cache: {
customPaths: ['path1', 'path2'],
},
},
dummy_profile_name: {
cache: {
customPaths: ['path1', 'path2'],
},
},
},
};
});
let result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.IOS,
'production'
);
expect(result).toEqual([
{
message: [
`The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.IOS,
'dummy_profile_name'
);
expect(result).toEqual([
{
message: [
`The "build.dummy_profile_name.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.dummy_profile_name.cache.paths" instead.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
});
});
describe('cache settings with customPaths in extended profile', () => {
it('returns deprecation warning', async () => {
getBuildProfileAsync.mockImplementation(async () => {
return {
cache: {
paths: ['path1', 'path2'],
},
} as BuildProfileType;
});
readRawEasJsonMock.mockImplementation(async () => {
return {
build: {
production: {
cache: {
customPaths: ['path1', 'path2'],
},
},
dummy_profile_name: {
extends: 'production',
},
},
};
});
const result = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.IOS,
'dummy_profile_name'
);
expect(result).toEqual([
{
message: [
`The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
});
});
});
});
+5 -1
View File
@@ -23,7 +23,11 @@ const CacheSchema = Joi.object({
key: Joi.string().max(128),
cacheDefaultPaths: Joi.boolean(),
customPaths: Joi.array().items(Joi.string()),
});
paths: Joi.array().items(Joi.string()),
}).rename('customPaths', 'paths')
.messages({
'object.rename.override': 'Cannot provide both "cache.customPaths" and "cache.paths" - use "cache.paths"'
});
const CommonBuildProfileSchema = Joi.object({
// builder
+38 -7
View File
@@ -28,23 +28,54 @@ export class EasJsonUtils {
return resolveBuildProfile({ easJson, platform, profileName });
}
public static getBuildProfileDeprecationWarnings(
buildProfile: BuildProfile,
profileName?: string
): EasJsonDeprecationWarning[] {
public static async getBuildProfileDeprecationWarningsAsync(
easJsonAccessor: EasJsonAccessor,
platform: Platform,
profileName: string
): Promise<EasJsonDeprecationWarning[]> {
const warnings: EasJsonDeprecationWarning[] = [];
const buildProfile = await EasJsonUtils.getBuildProfileAsync(
easJsonAccessor,
platform,
profileName
);
const rawEasJson = await easJsonAccessor.readRawJsonAsync();
if (buildProfile.cache?.cacheDefaultPaths !== undefined) {
warnings.push({
message: [
`The "build.${
profileName ?? 'production'
}.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.`,
`The "build.${profileName}.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/caching/#ios-dependencies',
});
}
warnings.push(...EasJsonUtils.getCustomPathsDeprecationWarnings(rawEasJson, profileName));
return warnings;
}
private static getCustomPathsDeprecationWarnings(
rawEasJson: any,
profileName: string
): EasJsonDeprecationWarning[] {
const warnings: EasJsonDeprecationWarning[] = [];
if (rawEasJson.build?.[profileName]?.cache?.customPaths !== undefined) {
warnings.push({
message: [
`The "build.${profileName}.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.${profileName}.cache.paths" instead.`,
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
});
}
if (rawEasJson.build?.[profileName]?.extends !== undefined) {
warnings.push(
...EasJsonUtils.getCustomPathsDeprecationWarnings(
rawEasJson,
rawEasJson.build?.[profileName].extends
)
);
}
return warnings;
}
Generated
+4 -4
View File
@@ -1390,10 +1390,10 @@
slugify "^1.3.4"
sucrase "^3.20.0"
"@expo/[email protected].7":
version "1.0.7"
resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-1.0.7.tgz#4c50dbc37faf000c5a5d791e69995bbf0eda39ff"
integrity sha512-LBYXWS/wp6YnyNDUqt+5+k0J7P6gf3/hjf48yJp+BcLabQbqWqAuz7eqPMEDt9bezMX2fEAiYywSBdnRJKo3Ow==
"@expo/[email protected].10":
version "1.0.10"
resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-1.0.10.tgz#11c7456d7f1a8f228d5c01d51a2b1092b3d84baf"
integrity sha512-BQqVXA5wRPVRtpCyChnJfq9iYD3sp4wtHY+9s/CmsUzFcNixg9VoY4qPUuP4Bsvr40seK9Ut7fIQN0DFr6arDA==
dependencies:
joi "^17.7.0"
semver "^7.3.8"