Compare commits

..
21 Commits
Author SHA1 Message Date
Szymon Dziedzic aa22163688 v3.10.2 2023-04-25 16:23:04 +02:00
Szymon Dziedzic 5e5395b0c6 [ENG-7676][eas-cli] don't resolve default resource class for iOS based on metadata in CLI (#1734)
* [eas-cli] don't resolve default resource class for iOS based on metadata

* don't set m1-medium as default in `eas build:configure`

* pass sdkVersion and reactNativeVersion in buildParams

* convert it to sync function

* update gql schema

* update CHANGELOG.md
2023-04-25 15:51:41 +02:00
Szymon Dziedzic c94a1e7d9c [eas-cli] allow users to select app to run if multiple apps are found in the build tarball (#1807)
* [eas-cli] allow users to select app to run if multiple apps are found in the build tarball

* rename variable

* improve error message

* apply suggested changes

* add dot

* update CHANGELOG.md
2023-04-25 15:42:50 +02:00
Szymon Dziedzic aefadf9376 [ENG-8074][eas-json] add info about new image (#1808)
* [eas-json] add info about new image

* update eas.schema.json

* update images descriptions

* update CHANGELOG.md
2023-04-25 15:28:10 +02:00
Expo CI 7acea869ff update CHANGELOG.md 2023-04-25 13:07:56 +00:00
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
Brent Vatne da4b56a58d Fix changelog for 3.9.3 2023-04-18 15:59:05 -07:00
Expo CI 1080600af6 update CHANGELOG.md 2023-04-18 22:47:47 +00:00
Will Schurman dcb6713f12 v3.9.3 2023-04-18 15:38:20 -07:00
Will Schurman 24a1d2d581 [eas-cli] Fix another prompt again in shared code (#1797) 2023-04-18 15:36:36 -07:00
Will Schurman 8af88c2d29 [eas-cli] Fix update message prompt (#1791) 2023-04-13 16:25:22 -07:00
Expo CI d416ac2162 update CHANGELOG.md 2023-04-13 10:11:07 +00:00
34 changed files with 2320 additions and 434 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
+37
View File
@@ -10,6 +10,43 @@ This is the log of notable changes to EAS CLI and related packages.
### 🐛 Bug fixes
### 🧹 Chores
- Add info about Xcode 14.3 image to `eas.schema.json`. ([#1808](https://github.com/expo/eas-cli/pull/1808) by [@szdziedzic](https://github.com/szdziedzic))
- Allow users to select an app to run using the `build:run` command if multiple apps are found in the tarball. ([#1807](https://github.com/expo/eas-cli/pull/1807) by [@szdziedzic](https://github.com/szdziedzic))
- Don't resolve `default` resource class for iOS in CLI. ([#1734](https://github.com/expo/eas-cli/pull/1734) by [@szdziedzic](https://github.com/szdziedzic))
## [3.10.1](https://github.com/expo/eas-cli/releases/tag/v3.10.1) - 2023-04-25
### 🧹 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
- Fix prompts in `eas update`. ([#1797](https://github.com/expo/eas-cli/pull/1797) by [@wschurman](https://github.com/wschurman))
## [3.9.2](https://github.com/expo/eas-cli/releases/tag/v3.9.2) - 2023-04-13
### 🐛 Bug fixes
- Fixes the rollout percentages when ending a rollout. ([#1781](https://github.com/expo/eas-cli/pull/1781) by [@jonsamp](https://github.com/jonsamp))
- Print meaningful error message if `extra.eas.projectId` is not a string. ([#1788](https://github.com/expo/eas-cli/pull/1788) by [@dsokal](https://github.com/dsokal))
+1 -1
View File
@@ -1,6 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "3.9.2",
"version": "3.10.2",
"$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.2/packages/eas-cli/src/commands/account/login.ts)_
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/account/logout.ts)_
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/account/view.ts)_
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/analytics.ts)_
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/branch/create.ts)_
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/branch/delete.ts)_
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/branch/list.ts)_
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/branch/rename.ts)_
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/branch/view.ts)_
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/index.ts)_
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/cancel.ts)_
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/configure.ts)_
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/inspect.ts)_
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/list.ts)_
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/resign.ts)_
_See code: [src/commands/build/resign.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/build/run.ts)_
_See code: [src/commands/build/run.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/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.2/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.2/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.2/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.2/packages/eas-cli/src/commands/build/view.ts)_
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/channel/create.ts)_
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/channel/edit.ts)_
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/channel/list.ts)_
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/channel/rollout.ts)_
_See code: [src/commands/channel/rollout.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/channel/view.ts)_
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/credentials.ts)_
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/device/create.ts)_
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/device/delete.ts)_
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/device/list.ts)_
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/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.2/packages/eas-cli/src/commands/device/view.ts)_
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/diagnostics.ts)_
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/metadata/lint.ts)_
_See code: [src/commands/metadata/lint.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/metadata/pull.ts)_
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/metadata/push.ts)_
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/open.ts)_
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/project/info.ts)_
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/project/init.ts)_
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/secret/create.ts)_
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/secret/delete.ts)_
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/secret/list.ts)_
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/secret/push.ts)_
_See code: [src/commands/secret/push.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/submit.ts)_
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/update/index.ts)_
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/update/configure.ts)_
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/update/delete.ts)_
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/update/list.ts)_
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/update/republish.ts)_
_See code: [src/commands/update/republish.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/update/view.ts)_
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/webhook/create.ts)_
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/webhook/delete.ts)_
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/webhook/list.ts)_
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/webhook/update.ts)_
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v3.10.2/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.2/packages/eas-cli/src/commands/webhook/view.ts)_
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v3.10.2/packages/eas-cli/src/commands/webhook/view.ts)_
## `eas whoami`
+1006 -208
View File
File diff suppressed because it is too large. Load diff
+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.2",
"version": "3.10.2",
"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.2",
"@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(
+7 -2
View File
@@ -80,9 +80,14 @@ interface Builder<TPlatform extends Platform, Credentials, TJob extends Job> {
export type BuildRequestSender = () => Promise<BuildFragment | undefined>;
function resolveBuildParamsInput<T extends Platform>(ctx: BuildContext<T>): BuildParamsInput {
function resolveBuildParamsInput<T extends Platform>(
ctx: BuildContext<T>,
metadata: Metadata
): BuildParamsInput {
return {
resourceClass: ctx.resourceClass,
sdkVersion: metadata.sdkVersion,
reactNativeVersion: metadata.reactNativeVersion,
};
}
@@ -142,7 +147,7 @@ export async function prepareBuildRequestForPlatformAsync<
assert(projectArchive);
const metadata = await collectMetadataAsync(ctx);
const buildParams = resolveBuildParamsInput(ctx);
const buildParams = resolveBuildParamsInput(ctx, metadata);
const job = await builder.prepareJobAsync(ctx, {
projectArchive,
credentials: credentialsResult?.credentials,
+3 -21
View File
@@ -1,5 +1,5 @@
import { Platform, Workflow } from '@expo/eas-build-job';
import { EasJson, EasJsonAccessor, ResourceClass } from '@expo/eas-json';
import { EasJson, EasJsonAccessor } from '@expo/eas-json';
import chalk from 'chalk';
import fs from 'fs-extra';
@@ -53,21 +53,11 @@ const EAS_JSON_MANAGED_DEFAULT: EasJson = {
development: {
developmentClient: true,
distribution: 'internal',
ios: {
resourceClass: ResourceClass.M_MEDIUM,
},
},
preview: {
distribution: 'internal',
ios: {
resourceClass: ResourceClass.M_MEDIUM,
},
},
production: {
ios: {
resourceClass: ResourceClass.M_MEDIUM,
},
},
production: {},
},
submit: {
production: {},
@@ -86,20 +76,12 @@ const EAS_JSON_BARE_DEFAULT: EasJson = {
},
ios: {
buildConfiguration: 'Debug',
resourceClass: ResourceClass.M_MEDIUM,
},
},
preview: {
distribution: 'internal',
ios: {
resourceClass: ResourceClass.M_MEDIUM,
},
},
production: {
ios: {
resourceClass: ResourceClass.M_MEDIUM,
},
},
production: {},
},
submit: {
production: {},
@@ -90,8 +90,6 @@ export async function createBuildContextAsync<T extends Platform>({
const resourceClass = await resolveBuildResourceClassAsync(
buildProfile,
platform,
projectDir,
exp,
resourceClassFlag
);
+1 -1
View File
@@ -27,7 +27,7 @@ interface JobData {
const cacheDefaults = {
disabled: false,
customPaths: [],
paths: [],
};
export async function prepareJobAsync(
@@ -1,12 +1,9 @@
import { ExpoConfig } from '@expo/config-types';
import { Platform } from '@expo/eas-build-job';
import { BuildProfile, ResourceClass } from '@expo/eas-json';
import chalk from 'chalk';
import semver from 'semver';
import { BuildResourceClass } from '../../graphql/generated';
import Log from '../../log';
import { getReactNativeVersionAsync } from '../metadata';
import Log, { link } from '../../log';
type AndroidResourceClass = Exclude<
ResourceClass,
@@ -42,22 +39,20 @@ const androidResourceClassToBuildResourceClassMapping: Record<
export async function resolveBuildResourceClassAsync<T extends Platform>(
profile: BuildProfile<T>,
platform: Platform,
projectDir: string,
exp: ExpoConfig,
resourceClassFlag?: ResourceClass
): Promise<BuildResourceClass> {
const profileResourceClass = profile.resourceClass;
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)
? resolveIosResourceClass(resourceClassFlag, profileResourceClass)
: resolveAndroidResourceClass(selectedResourceClass);
}
@@ -79,13 +74,19 @@ function resolveAndroidResourceClass(selectedResourceClass?: ResourceClass): Bui
return androidResourceClassToBuildResourceClassMapping[resourceClass as AndroidResourceClass];
}
async function resolveIosResourceClassAsync(
exp: ExpoConfig,
projectDir: string,
selectedResourceClass?: ResourceClass
): Promise<BuildResourceClass> {
const resourceClass =
selectedResourceClass ?? (await resolveIosDefaultRequestedResourceClassAsync(exp, projectDir));
function resolveIosResourceClass(
resourceClassFlag?: ResourceClass,
profileResourceClass?: ResourceClass
): BuildResourceClass {
const resourceClass = resourceClassFlag ?? profileResourceClass ?? ResourceClass.DEFAULT;
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(
@@ -105,19 +106,3 @@ async function resolveIosResourceClassAsync(
return iosResourceClassToBuildResourceClassMapping[resourceClass];
}
async function resolveIosDefaultRequestedResourceClassAsync(
exp: ExpoConfig,
projectDir: string
): Promise<ResourceClass> {
const { sdkVersion } = exp;
const reactNativeVersion = await getReactNativeVersionAsync(projectDir);
if (
(sdkVersion && semver.satisfies(sdkVersion, '>=48')) ||
(reactNativeVersion && semver.satisfies(reactNativeVersion, '>=0.71.0'))
) {
return ResourceClass.M_MEDIUM;
} else {
return ResourceClass.DEFAULT;
}
}
@@ -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();
}
}
}
@@ -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));
+162 -27
View File
@@ -87,6 +87,8 @@ 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']>;
/** Billing information. Only visible to members with the ADMIN or OWNER role. */
@@ -211,6 +213,19 @@ export type AccountAppsArgs = {
};
/**
* An account is a container owning projects, credentials, billing and other organization
* data and settings. Actors may own and be members of accounts.
*/
export type AccountAppsPaginatedArgs = {
after?: InputMaybe<Scalars['String']>;
before?: InputMaybe<Scalars['String']>;
filter?: InputMaybe<AccountAppsFilterInput>;
first?: InputMaybe<Scalars['Int']>;
last?: InputMaybe<Scalars['Int']>;
};
/**
* An account is a container owning projects, credentials, billing and other organization
* data and settings. Actors may own and be members of accounts.
@@ -284,6 +299,31 @@ export type AccountTimelineActivityArgs = {
last?: InputMaybe<Scalars['Int']>;
};
export type AccountAppsConnection = {
__typename?: 'AccountAppsConnection';
edges: Array<AccountAppsEdge>;
pageInfo: PageInfo;
};
export type AccountAppsEdge = {
__typename?: 'AccountAppsEdge';
cursor: Scalars['String'];
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'];
};
@@ -295,6 +335,8 @@ export type AccountMutation = {
* @deprecated Build packs are no longer supported
*/
buyProduct?: Maybe<Account>;
/** Cancels all subscriptions immediately */
cancelAllSubscriptionsImmediately: Account;
/** Cancel scheduled subscription change */
cancelScheduledSubscriptionChange: Account;
/** Cancels the active subscription */
@@ -329,6 +371,11 @@ export type AccountMutationBuyProductArgs = {
};
export type AccountMutationCancelAllSubscriptionsImmediatelyArgs = {
accountID: Scalars['ID'];
};
export type AccountMutationCancelScheduledSubscriptionChangeArgs = {
accountID: Scalars['ID'];
};
@@ -502,6 +549,7 @@ export type AccountSsoConfigurationPublicDataQueryPublicDataByAccountNameArgs =
export type AccountUsageEasBuildMetadata = {
__typename?: 'AccountUsageEASBuildMetadata';
billingResourceClass: EasBuildBillingResourceClass;
platform: AppPlatform;
};
@@ -976,6 +1024,8 @@ export type App = Project & {
isLikedByMe: Scalars['Boolean'];
/** @deprecated No longer supported */
lastPublishedTime: Scalars['DateTime'];
/** Time of the last user activity (update, branch, submission). */
latestActivity: Scalars['DateTime'];
latestAppVersionByPlatformAndApplicationIdentifier?: Maybe<AppVersion>;
latestReleaseForReleaseChannel?: Maybe<AppRelease>;
/** ID of latest classic update release */
@@ -1002,6 +1052,7 @@ export type App = Project & {
releaseChannels: Array<Scalars['String']>;
/** @deprecated Legacy access tokens are deprecated */
requiresAccessTokenForPushSecurity: Scalars['Boolean'];
scopeKey: Scalars['String'];
/** SDK version of the latest classic update publish, 0.0.0 otherwise */
sdkVersion: Scalars['String'];
slug: Scalars['String'];
@@ -1593,6 +1644,8 @@ export type AppleDeviceMutation = {
createAppleDevice: AppleDevice;
/** Delete an Apple Device */
deleteAppleDevice: DeleteAppleDeviceResult;
/** Update an Apple Device */
updateAppleDevice: AppleDevice;
};
@@ -1606,6 +1659,12 @@ export type AppleDeviceMutationDeleteAppleDeviceArgs = {
id: Scalars['ID'];
};
export type AppleDeviceMutationUpdateAppleDeviceArgs = {
appleDeviceUpdateInput: AppleDeviceUpdateInput;
id: Scalars['ID'];
};
export type AppleDeviceRegistrationRequest = {
__typename?: 'AppleDeviceRegistrationRequest';
account: Account;
@@ -1635,6 +1694,10 @@ export type AppleDeviceRegistrationRequestQueryByIdArgs = {
id: Scalars['ID'];
};
export type AppleDeviceUpdateInput = {
name?: InputMaybe<Scalars['String']>;
};
export type AppleDistributionCertificate = {
__typename?: 'AppleDistributionCertificate';
account: Account;
@@ -1924,6 +1987,8 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
expirationDate?: Maybe<Scalars['DateTime']>;
gitCommitHash?: Maybe<Scalars['String']>;
gitCommitMessage?: Maybe<Scalars['String']>;
gitRef?: Maybe<Scalars['String']>;
githubRepositoryOwnerAndName?: Maybe<Scalars['String']>;
id: Scalars['ID'];
/** Queue position is 1-indexed */
initialQueuePosition?: Maybe<Scalars['Int']>;
@@ -1942,6 +2007,7 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
platform: AppPlatform;
priority: BuildPriority;
project: Project;
projectRootDirectory?: Maybe<Scalars['String']>;
provisioningStartedAt?: Maybe<Scalars['DateTime']>;
/** Queue position is 1-indexed */
queuePosition?: Maybe<Scalars['Int']>;
@@ -1984,11 +2050,10 @@ export type BuildArtifacts = {
};
export type BuildCacheInput = {
cacheDefaultPaths?: InputMaybe<Scalars['Boolean']>;
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 {
@@ -2058,9 +2123,7 @@ export enum BuildJobLogsFormat {
export type BuildJobMutation = {
__typename?: 'BuildJobMutation';
cancel: BuildJob;
del?: Maybe<BuildJob>;
restart: BuildJob;
};
export type BuildJobQuery = {
@@ -2375,27 +2438,6 @@ export type Charge = {
wasRefunded: Scalars['Boolean'];
};
/** Represents a client build request */
export type ClientBuild = {
__typename?: 'ClientBuild';
buildJobId?: Maybe<Scalars['String']>;
id: Scalars['ID'];
manifestPlistUrl?: Maybe<Scalars['String']>;
status?: Maybe<Scalars['String']>;
userFacingErrorMessage?: Maybe<Scalars['String']>;
userId?: Maybe<Scalars['String']>;
};
export type ClientBuildQuery = {
__typename?: 'ClientBuildQuery';
byId: ClientBuild;
};
export type ClientBuildQueryByIdArgs = {
requestId: Scalars['ID'];
};
export type CodeSigningInfo = {
__typename?: 'CodeSigningInfo';
alg: Scalars['String'];
@@ -2536,6 +2578,11 @@ export type DeleteEnvironmentSecretResult = {
id: Scalars['ID'];
};
export type DeleteGitHubUserResult = {
__typename?: 'DeleteGitHubUserResult';
id: Scalars['ID'];
};
export type DeleteGoogleServiceAccountKeyResult = {
__typename?: 'DeleteGoogleServiceAccountKeyResult';
id: Scalars['ID'];
@@ -2657,6 +2704,11 @@ export enum DistributionType {
Store = 'STORE'
}
export enum EasBuildBillingResourceClass {
Large = 'LARGE',
Medium = 'MEDIUM'
}
export type EasBuildDeprecationInfo = {
__typename?: 'EASBuildDeprecationInfo';
message: Scalars['String'];
@@ -2897,6 +2949,17 @@ export enum GitHubAppInstallationStatus {
Suspended = 'SUSPENDED'
}
export type GitHubAppMutation = {
__typename?: 'GitHubAppMutation';
/** Create a GitHub build for an app */
createGitHubBuild: Scalars['Boolean'];
};
export type GitHubAppMutationCreateGitHubBuildArgs = {
buildInput: GitHubBuildInput;
};
export type GitHubAppQuery = {
__typename?: 'GitHubAppQuery';
appIdentifier: Scalars['String'];
@@ -2918,6 +2981,14 @@ export type GitHubAppQuerySearchRepositoriesArgs = {
query: Scalars['String'];
};
export type GitHubBuildInput = {
appId: Scalars['ID'];
baseDirectory?: InputMaybe<Scalars['String']>;
buildProfile: Scalars['String'];
gitRef: Scalars['String'];
platform: AppPlatform;
};
export type GitHubRepository = {
__typename?: 'GitHubRepository';
app: App;
@@ -3007,6 +3078,33 @@ export type GitHubRepositorySettingsMutationUpdateGitHubRepositorySettingsArgs =
githubRepositorySettingsId: Scalars['ID'];
};
export type GitHubUser = {
__typename?: 'GitHubUser';
githubUserIdentifier: Scalars['String'];
id: Scalars['ID'];
metadata?: Maybe<GitHubUserMetadata>;
userActor: UserActor;
};
export type GitHubUserMetadata = {
__typename?: 'GitHubUserMetadata';
avatarUrl: Scalars['String'];
login: Scalars['String'];
name?: Maybe<Scalars['String']>;
url: Scalars['String'];
};
export type GitHubUserMutation = {
__typename?: 'GitHubUserMutation';
/** Delete a GitHub User by ID */
deleteGitHubUser: DeleteGitHubUserResult;
};
export type GitHubUserMutationDeleteGitHubUserArgs = {
id: Scalars['ID'];
};
export type GoogleServiceAccountKey = {
__typename?: 'GoogleServiceAccountKey';
account: Account;
@@ -3443,8 +3541,10 @@ export type MeMutation = {
unpublishApp: App;
/** Update an App that the current user owns */
updateApp: App;
/** Update the current user's data */
/** Update the current regular user's data */
updateProfile: User;
/** Update the current SSO user's data */
updateSSOProfile: SsoUser;
};
@@ -3531,6 +3631,11 @@ export type MeMutationUpdateProfileArgs = {
userData: UserDataInput;
};
export type MeMutationUpdateSsoProfileArgs = {
userData: SsoUserDataInput;
};
export type MeteredBillingStatus = {
__typename?: 'MeteredBillingStatus';
EAS_BUILD: Scalars['Boolean'];
@@ -3863,12 +3968,16 @@ export type RootMutation = {
emailSubscription: EmailSubscriptionMutation;
/** Mutations that create and delete EnvironmentSecrets */
environmentSecret: EnvironmentSecretMutation;
/** Mutations that utilize services facilitated by the GitHub App */
githubApp: GitHubAppMutation;
/** Mutations for GitHub App installations */
githubAppInstallation: GitHubAppInstallationMutation;
/** Mutations for GitHub repositories */
githubRepository: GitHubRepositoryMutation;
/** Mutations for GitHub repository settings */
githubRepositorySettings: GitHubRepositorySettingsMutation;
/** Mutations for GitHub users */
githubUser: GitHubUserMutation;
/** Mutations that modify a Google Service Account Key */
googleServiceAccountKey: GoogleServiceAccountKeyMutation;
/** Mutations that modify the build credentials for an iOS app */
@@ -3949,7 +4058,6 @@ export type RootQuery = {
/** Top-level query object for querying BuildPublicData publicly. */
buildPublicData: BuildPublicDataQuery;
builds: BuildQuery;
clientBuilds: ClientBuildQuery;
/** Top-level query object for querying Experimentation configuration. */
experimentation: ExperimentationQuery;
/** Top-level query object for querying GitHub App information and resources it has access to. */
@@ -4051,6 +4159,8 @@ export type SsoUser = Actor & UserActor & {
apps: Array<App>;
bestContactEmail?: Maybe<Scalars['String']>;
created: Scalars['DateTime'];
/** Discord account linked to a user */
discordUser?: Maybe<DiscordUser>;
displayName: Scalars['String'];
/**
* Server feature gate values for this actor, optionally filtering by desired gates.
@@ -4059,6 +4169,8 @@ export type SsoUser = Actor & UserActor & {
featureGates: Scalars['JSONObject'];
firstName?: Maybe<Scalars['String']>;
fullName?: Maybe<Scalars['String']>;
/** GitHub account linked to a user */
githubUser?: Maybe<GitHubUser>;
githubUsername?: Maybe<Scalars['String']>;
id: Scalars['ID'];
industry?: Maybe<Scalars['String']>;
@@ -4110,6 +4222,15 @@ export type SsoUserSnacksArgs = {
offset: Scalars['Int'];
};
export type SsoUserDataInput = {
firstName?: InputMaybe<Scalars['String']>;
githubUsername?: InputMaybe<Scalars['String']>;
industry?: InputMaybe<Scalars['String']>;
lastName?: InputMaybe<Scalars['String']>;
location?: InputMaybe<Scalars['String']>;
twitterUsername?: InputMaybe<Scalars['String']>;
};
export type SsoUserQuery = {
__typename?: 'SSOUserQuery';
/** Query an SSOUser by ID */
@@ -4782,6 +4903,8 @@ export type User = Actor & UserActor & {
featureGates: Scalars['JSONObject'];
firstName?: Maybe<Scalars['String']>;
fullName?: Maybe<Scalars['String']>;
/** GitHub account linked to a user */
githubUser?: Maybe<GitHubUser>;
githubUsername?: Maybe<Scalars['String']>;
/** Whether this user has any pending user invitations. Only resolves for the viewer. */
hasPendingUserInvitations: Scalars['Boolean'];
@@ -4858,6 +4981,8 @@ export type UserActor = {
apps: Array<App>;
bestContactEmail?: Maybe<Scalars['String']>;
created: Scalars['DateTime'];
/** Discord account linked to a user */
discordUser?: Maybe<DiscordUser>;
/**
* Best-effort human readable name for this human actor for use in user interfaces during action attribution.
* For example, when displaying a sentence indicating that actor X created a build or published an update.
@@ -4870,6 +4995,8 @@ export type UserActor = {
featureGates: Scalars['JSONObject'];
firstName?: Maybe<Scalars['String']>;
fullName?: Maybe<Scalars['String']>;
/** GitHub account linked to a user */
githubUser?: Maybe<GitHubUser>;
githubUsername?: Maybe<Scalars['String']>;
id: Scalars['ID'];
industry?: Maybe<Scalars['String']>;
@@ -5394,6 +5521,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'];
+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,
+3 -3
View File
@@ -509,7 +509,7 @@ export async function getBranchNameForCommandAsync({
try {
const branch = await selectBranchOnAppAsync(graphqlClient, {
projectId,
promptTitle: `Which branch would you like to roll back to embedded on?`,
promptTitle: `Which branch would you like to use?`,
displayTextForListItem: updateBranch => ({
title: `${updateBranch.name} ${chalk.grey(
`- current update: ${formatUpdateMessage(updateBranch.updates[0])}`
@@ -563,7 +563,7 @@ export async function getUpdateMessageForCommandAsync({
const { updateMessageLocal } = await promptAsync({
type: 'text',
name: 'updateMessageLocal',
message: `Provide an roll back message:`,
message: `Provide an update message:`,
initial: (await getVcsClient().getLastCommitMessageAsync())?.trim(),
validate: (value: any) => (value ? true : validationMessage),
});
@@ -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();
});
});
});
+24 -4
View File
@@ -10,6 +10,7 @@ import { v4 as uuidv4 } from 'uuid';
import fetch, { RequestInit, Response } from '../fetch';
import { AppPlatform } from '../graphql/generated';
import Log from '../log';
import { promptAsync } from '../prompts';
import { formatBytes } from './files';
import { getTmpDirectory } from './paths';
import { ProgressHandler, createProgressTracker } from './progress';
@@ -162,16 +163,35 @@ export async function extractAppFromLocalArchiveAsync(
}
async function getAppPathAsync(outputDir: string, applicationExtension: string): Promise<string> {
const appFileName = await glob(`*.${applicationExtension}`, {
const appFilePaths = await glob(`./**/*.${applicationExtension}`, {
cwd: outputDir,
onlyFiles: false,
});
if (appFileName.length === 0) {
throw Error('Something went wrong while extracting the app from app archive');
if (appFilePaths.length === 0) {
throw Error('Did not find any installable apps inside tarball.');
}
return path.join(outputDir, appFileName[0]);
if (appFilePaths.length === 1) {
return path.join(outputDir, appFilePaths[0]);
}
Log.newLine();
Log.log('Detected multiple apps in the tarball:');
Log.newLine();
const { selectedFile } = await promptAsync({
type: 'select',
message: 'Select the app to run:',
name: 'selectedFile',
choices: [
...appFilePaths.map(filePath => ({
title: filePath,
value: filePath,
})),
],
});
return path.join(outputDir, selectedFile);
}
async function tarExtractAsync(input: string, output: string): Promise<void> {
+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.2",
"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",
+14 -2
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`.",
@@ -324,6 +334,7 @@
"enum": [
"default",
"latest",
"macos-ventura-13.3-xcode-14.3",
"macos-monterey-12.6-xcode-14.2",
"macos-monterey-12.6-xcode-14.1",
"macos-monterey-12.6-xcode-14.0",
@@ -334,8 +345,9 @@
"macos-big-sur-11.4-xcode-12.5"
],
"markdownEnumDescriptions": [
"`macos-monterey-12.6-xcode-14.1`",
"`macos-monterey-12.6-xcode-14.2`"
"`macos-monterey-12.6-xcode-14.2` for Apple silicon builders, `macos-monterey-12.6-xcode-14.1` for Intel builders",
"`macos-ventura-13.3-xcode-14.3` for Apple silicon builders, `macos-monterey-12.6-xcode-14.2` for Intel builders",
"only available for Apple silicon builders"
]
},
{
@@ -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"