Compare commits

..
Author SHA1 Message Date
Quinlan Jung 0bcd94e83f [eas-cli] eas updates: warn users if they near plan limits 2023-04-19 16:55:35 -07:00
34 changed files with 390 additions and 1118 deletions

No files matched your search

+5 -2
View File
@@ -1,5 +1,8 @@
<!-- 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". -->
<!-- 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.
# Why
-48
View File
@@ -1,48 +0,0 @@
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
+40 -29
View File
@@ -1,37 +1,48 @@
name: CHANGELOG.md PR check
on:
pull_request:
types:
- opened
- synchronize
- labeled
- unlabeled
issue_comment:
types: [created]
name: Changelog
jobs:
pr-changelog-entry:
name: Check CHANGELOG.md updated
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
- name: Check if CHANGELOG.md was updated
id: changelog-updated
uses: tj-actions/changed-files@v35
with:
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
token: ${{ secrets.EXPO_BOT_PAT }}
- uses: actions/setup-node@v2
with:
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.
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
+1 -3
View File
@@ -1,5 +1,4 @@
name: Run tests
on:
push:
branches: [main]
@@ -35,12 +34,11 @@ jobs:
- run: yarn lint --max-warnings=0
- run: yarn install --frozen-lockfile --check-files
working-directory: ./scripts
- run: yarn lint-changelog
- uses: codecov/codecov-action@v1
if: ${{ matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- run: yarn lint-changelog
notify-slack:
runs-on: ubuntu-latest
needs: test
-17
View File
@@ -12,23 +12,6 @@ This is the log of notable changes to EAS CLI and related packages.
### 🧹 Chores
- Add `cache.paths` field and deprecate `cache.customPaths`. ([#1794](https://github.com/expo/eas-cli/pull/1794) by [@radoslawkrzemien](https://github.com/radoslawkrzemien))
## [3.10.0](https://github.com/expo/eas-cli/releases/tag/v3.10.0) - 2023-04-21
### 🎉 New features
- Added eas device:rename command. ([#1787](https://github.com/expo/eas-cli/pull/1787) by [@keith-kurak](https://github.com/keith-kurak))
### 🐛 Bug fixes
- Fix `device:delete` not disabling on Apple. ([#1803](https://github.com/expo/eas-cli/pull/1803) by [@keith-kurak](https://github.com/keith-kurak))
- Fix message truncation for updates. ([#1801](https://github.com/expo/eas-cli/pull/1801) by [@wschurman](https://github.com/wschurman))
### 🧹 Chores
- Throw an error if somebody tries to start iOS build with the `large` resource class selected using the deprecated `--resource-class` flag. ([#1795](https://github.com/expo/eas-cli/pull/1795) by [@szdziedzic](https://github.com/szdziedzic))
## [3.9.3](https://github.com/expo/eas-cli/releases/tag/v3.9.3) - 2023-04-18
### 🐛 Bug fixes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"version": "3.10.1",
"version": "3.9.3",
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}
+53 -75
View File
@@ -86,7 +86,6 @@ 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)
@@ -132,7 +131,7 @@ ALIASES
$ eas login
```
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/account/login.ts)_
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/account/login.ts)_
## `eas account:logout`
@@ -149,7 +148,7 @@ ALIASES
$ eas logout
```
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/account/logout.ts)_
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/account/logout.ts)_
## `eas account:view`
@@ -166,7 +165,7 @@ ALIASES
$ eas whoami
```
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/account/view.ts)_
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/account/view.ts)_
## `eas analytics [STATUS]`
@@ -180,7 +179,7 @@ DESCRIPTION
display or change analytics settings
```
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/analytics.ts)_
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/analytics.ts)_
## `eas autocomplete [SHELL]`
@@ -230,7 +229,7 @@ DESCRIPTION
create a branch
```
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/create.ts)_
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/create.ts)_
## `eas branch:delete [NAME]`
@@ -251,7 +250,7 @@ DESCRIPTION
delete a branch
```
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/delete.ts)_
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/delete.ts)_
## `eas branch:list`
@@ -271,7 +270,7 @@ DESCRIPTION
list all branches
```
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/list.ts)_
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/list.ts)_
## `eas branch:rename`
@@ -291,7 +290,7 @@ DESCRIPTION
rename a branch
```
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/rename.ts)_
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/rename.ts)_
## `eas branch:view [NAME]`
@@ -314,7 +313,7 @@ DESCRIPTION
view a branch
```
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/branch/view.ts)_
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/branch/view.ts)_
## `eas build`
@@ -344,7 +343,7 @@ DESCRIPTION
start a build
```
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/index.ts)_
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/index.ts)_
## `eas build:cancel [BUILD_ID]`
@@ -361,7 +360,7 @@ DESCRIPTION
cancel a build
```
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/cancel.ts)_
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/cancel.ts)_
## `eas build:configure`
@@ -378,7 +377,7 @@ DESCRIPTION
configure the project to support EAS Build
```
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/configure.ts)_
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/configure.ts)_
## `eas build:inspect`
@@ -413,7 +412,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.10.1/packages/eas-cli/src/commands/build/inspect.ts)_
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/inspect.ts)_
## `eas build:list`
@@ -450,7 +449,7 @@ DESCRIPTION
list all builds for your project
```
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/list.ts)_
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/list.ts)_
## `eas build:resign`
@@ -476,7 +475,7 @@ DESCRIPTION
re-sign a build archive
```
_See code: [src/commands/build/resign.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/resign.ts)_
_See code: [src/commands/build/resign.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/resign.ts)_
## `eas build:run`
@@ -500,7 +499,7 @@ DESCRIPTION
run simulator/emulator builds from eas-cli
```
_See code: [src/commands/build/run.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/run.ts)_
_See code: [src/commands/build/run.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/run.ts)_
## `eas build:submit`
@@ -547,7 +546,7 @@ DESCRIPTION
Update version of an app.
```
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/version/set.ts)_
_See code: [src/commands/build/version/set.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/version/set.ts)_
## `eas build:version:sync`
@@ -566,7 +565,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.10.1/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.9.3/packages/eas-cli/src/commands/build/version/sync.ts)_
## `eas build:view [BUILD_ID]`
@@ -583,7 +582,7 @@ DESCRIPTION
view a build for your project
```
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/build/view.ts)_
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/build/view.ts)_
## `eas channel:create [NAME]`
@@ -604,7 +603,7 @@ DESCRIPTION
create a channel
```
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/create.ts)_
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/create.ts)_
## `eas channel:edit [NAME]`
@@ -626,7 +625,7 @@ DESCRIPTION
point a channel at a new branch
```
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/edit.ts)_
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/edit.ts)_
## `eas channel:list`
@@ -646,7 +645,7 @@ DESCRIPTION
list all channels
```
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/list.ts)_
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/list.ts)_
## `eas channel:rollout [CHANNEL]`
@@ -670,7 +669,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.10.1/packages/eas-cli/src/commands/channel/rollout.ts)_
_See code: [src/commands/channel/rollout.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/rollout.ts)_
## `eas channel:view [NAME]`
@@ -693,7 +692,7 @@ DESCRIPTION
view a channel
```
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/channel/view.ts)_
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/channel/view.ts)_
## `eas config`
@@ -714,7 +713,7 @@ DESCRIPTION
display project configuration (app.json + eas.json)
```
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/config.ts)_
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/config.ts)_
## `eas credentials`
@@ -731,7 +730,7 @@ DESCRIPTION
manage credentials
```
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/credentials.ts)_
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/credentials.ts)_
## `eas device:create`
@@ -745,7 +744,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.10.1/packages/eas-cli/src/commands/device/create.ts)_
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/create.ts)_
## `eas device:delete`
@@ -765,7 +764,7 @@ DESCRIPTION
remove a registered device from your account
```
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/delete.ts)_
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/delete.ts)_
## `eas device:list`
@@ -786,28 +785,7 @@ DESCRIPTION
list all registered devices for your account
```
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/list.ts)_
## `eas device:rename`
rename a registered device
```
USAGE
$ eas device:rename [--apple-team-id <value>] [--udid <value>] [--name <value>] [--json --non-interactive]
FLAGS
--apple-team-id=<value> The Apple team ID on which to find the device
--json Enable JSON output, non-JSON messages will be printed to stderr.
--name=<value> The new name for the device
--non-interactive Run the command in non-interactive mode.
--udid=<value> The Apple device ID to rename
DESCRIPTION
rename a registered device
```
_See code: [src/commands/device/rename.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/rename.ts)_
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/list.ts)_
## `eas device:view [UDID]`
@@ -821,7 +799,7 @@ DESCRIPTION
view a device for your project
```
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/device/view.ts)_
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/device/view.ts)_
## `eas diagnostics`
@@ -835,7 +813,7 @@ DESCRIPTION
display environment info
```
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/diagnostics.ts)_
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/diagnostics.ts)_
## `eas help [COMMAND]`
@@ -923,7 +901,7 @@ DESCRIPTION
validate the local store configuration
```
_See code: [src/commands/metadata/lint.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/metadata/lint.ts)_
_See code: [src/commands/metadata/lint.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/metadata/lint.ts)_
## `eas metadata:pull`
@@ -940,7 +918,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.10.1/packages/eas-cli/src/commands/metadata/pull.ts)_
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/metadata/pull.ts)_
## `eas metadata:push`
@@ -957,7 +935,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.10.1/packages/eas-cli/src/commands/metadata/push.ts)_
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/metadata/push.ts)_
## `eas open`
@@ -971,7 +949,7 @@ DESCRIPTION
open the project page in a web browser
```
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/open.ts)_
_See code: [src/commands/open.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/open.ts)_
## `eas project:info`
@@ -985,7 +963,7 @@ DESCRIPTION
information about the current project
```
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/project/info.ts)_
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/project/info.ts)_
## `eas project:init`
@@ -1007,7 +985,7 @@ ALIASES
$ eas init
```
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/project/init.ts)_
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/project/init.ts)_
## `eas secret:create`
@@ -1030,7 +1008,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.10.1/packages/eas-cli/src/commands/secret/create.ts)_
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/create.ts)_
## `eas secret:delete`
@@ -1048,7 +1026,7 @@ DESCRIPTION
delete an environment secret by ID
```
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/secret/delete.ts)_
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/delete.ts)_
## `eas secret:list`
@@ -1062,7 +1040,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.10.1/packages/eas-cli/src/commands/secret/list.ts)_
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/list.ts)_
## `eas secret:push`
@@ -1082,7 +1060,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.10.1/packages/eas-cli/src/commands/secret/push.ts)_
_See code: [src/commands/secret/push.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/secret/push.ts)_
## `eas submit`
@@ -1112,7 +1090,7 @@ ALIASES
$ eas build:submit
```
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/submit.ts)_
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/submit.ts)_
## `eas update`
@@ -1144,7 +1122,7 @@ DESCRIPTION
publish an update group
```
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/index.ts)_
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/index.ts)_
## `eas update:configure`
@@ -1162,7 +1140,7 @@ DESCRIPTION
configure the project to support EAS Update
```
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/configure.ts)_
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/configure.ts)_
## `eas update:delete GROUPID`
@@ -1183,7 +1161,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.10.1/packages/eas-cli/src/commands/update/delete.ts)_
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/delete.ts)_
## `eas update:list`
@@ -1205,7 +1183,7 @@ DESCRIPTION
view the recent updates
```
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/list.ts)_
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/list.ts)_
## `eas update:republish`
@@ -1229,7 +1207,7 @@ DESCRIPTION
roll back to an existing update
```
_See code: [src/commands/update/republish.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/republish.ts)_
_See code: [src/commands/update/republish.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/republish.ts)_
## `eas update:view GROUPID`
@@ -1249,7 +1227,7 @@ DESCRIPTION
update group details
```
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/update/view.ts)_
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/update/view.ts)_
## `eas webhook:create`
@@ -1270,7 +1248,7 @@ DESCRIPTION
create a webhook
```
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/create.ts)_
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/create.ts)_
## `eas webhook:delete [ID]`
@@ -1290,7 +1268,7 @@ DESCRIPTION
delete a webhook
```
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/delete.ts)_
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/delete.ts)_
## `eas webhook:list`
@@ -1308,7 +1286,7 @@ DESCRIPTION
list webhooks
```
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/list.ts)_
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/list.ts)_
## `eas webhook:update`
@@ -1330,7 +1308,7 @@ DESCRIPTION
update a webhook
```
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/update.ts)_
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/update.ts)_
## `eas webhook:view ID`
@@ -1347,7 +1325,7 @@ DESCRIPTION
view a webhook
```
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v3.10.1/packages/eas-cli/src/commands/webhook/view.ts)_
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v3.9.3/packages/eas-cli/src/commands/webhook/view.ts)_
## `eas whoami`
+83 -17
View File
@@ -737,7 +737,7 @@
},
{
"name": "appsPaginated",
"description": null,
"description": "Paginated list of apps associated with this account. By default sorted by name. Use filter to adjust the sorting order.",
"args": [
{
"name": "after",
@@ -763,6 +763,18 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "filter",
"description": null,
"type": {
"kind": "INPUT_OBJECT",
"name": "AccountAppsFilterInput",
"ofType": null
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "first",
"description": null,
@@ -1683,6 +1695,56 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "AccountAppsFilterInput",
"description": null,
"fields": null,
"inputFields": [
{
"name": "sortByField",
"description": null,
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "ENUM",
"name": "AccountAppsSortByField",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
"enumValues": null,
"possibleTypes": null
},
{
"kind": "ENUM",
"name": "AccountAppsSortByField",
"description": null,
"fields": null,
"inputFields": null,
"interfaces": null,
"enumValues": [
{
"name": "LATEST_ACTIVITY_TIME",
"description": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "NAME",
"description": "Name prefers the display name but falls back to full_name with @account/\npart stripped.",
"isDeprecated": false,
"deprecationReason": null
}
],
"possibleTypes": null
},
{
"kind": "INPUT_OBJECT",
"name": "AccountDataInput",
@@ -14207,22 +14269,6 @@
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "customPaths",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "disabled",
"description": null,
@@ -14246,6 +14292,26 @@
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "paths",
"description": null,
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
},
"defaultValue": null,
"isDeprecated": false,
"deprecationReason": null
}
],
"interfaces": null,
-1
View File
@@ -2,5 +2,4 @@ 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.10.1",
"version": "3.9.3",
"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.10",
"@expo/eas-json": "3.10.1",
"@expo/eas-build-job": "1.0.7",
"@expo/eas-json": "3.9.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,
paths: [],
customPaths: [],
};
export async function prepareJobAsync(
+1 -1
View File
@@ -27,7 +27,7 @@ interface JobData {
const cacheDefaults = {
disabled: false,
paths: [],
customPaths: [],
};
export async function prepareJobAsync(
@@ -5,7 +5,7 @@ import chalk from 'chalk';
import semver from 'semver';
import { BuildResourceClass } from '../../graphql/generated';
import Log, { link } from '../../log';
import Log from '../../log';
import { getReactNativeVersionAsync } from '../metadata';
type AndroidResourceClass = Exclude<
@@ -50,14 +50,14 @@ export async function resolveBuildResourceClassAsync<T extends Platform>(
if (profileResourceClass && resourceClassFlag && resourceClassFlag !== profileResourceClass) {
Log.warn(
`Build profile specifies the "${profileResourceClass}" resource class but you passed "${resourceClassFlag}" to --resource-class.\nUsing "${resourceClassFlag}" as the override.`
`Build profile specifies the "${profileResourceClass}" resource class but you passed "${resourceClassFlag}" to --resource-class.\nUsing the "${resourceClassFlag}" as the override.`
);
}
const selectedResourceClass = resourceClassFlag ?? profileResourceClass;
return platform === Platform.IOS
? await resolveIosResourceClassAsync(exp, projectDir, resourceClassFlag, profileResourceClass)
? await resolveIosResourceClassAsync(exp, projectDir, resourceClassFlag ?? profileResourceClass)
: resolveAndroidResourceClass(selectedResourceClass);
}
@@ -82,21 +82,10 @@ function resolveAndroidResourceClass(selectedResourceClass?: ResourceClass): Bui
async function resolveIosResourceClassAsync(
exp: ExpoConfig,
projectDir: string,
resourceClassFlag?: ResourceClass,
profileResourceClass?: ResourceClass
selectedResourceClass?: ResourceClass
): Promise<BuildResourceClass> {
const resourceClass =
resourceClassFlag ??
profileResourceClass ??
(await resolveIosDefaultRequestedResourceClassAsync(exp, projectDir));
if (resourceClassFlag === ResourceClass.LARGE) {
throw new Error(
`Experimental "large" resource class for Intel iOS workers is no longer available. Remove the specified resource class to use the default, or learn more about all available resource classes: ${link(
'https://docs.expo.dev/build-reference/eas-json/'
)}`
);
}
selectedResourceClass ?? (await resolveIosDefaultRequestedResourceClassAsync(exp, projectDir));
if ([ResourceClass.M1_EXPERIMENTAL, ResourceClass.M1_MEDIUM].includes(resourceClass)) {
Log.warn(
@@ -112,17 +112,11 @@ 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.attributes.udid === device.identifier
);
const appleValidatedDevice = appleValidatedDevices.find(d => d.id === device.id);
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;
@@ -1,168 +0,0 @@
import { Device } from '@expo/apple-utils';
import { Flags } from '@oclif/core';
import assert from 'assert';
import EasCommand from '../../commandUtils/EasCommand';
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
import { EasNonInteractiveAndJsonFlags } from '../../commandUtils/flags';
import { PaginatedQueryOptions, getPaginatedQueryOptions } from '../../commandUtils/pagination';
import { AppleDeviceMutation } from '../../credentials/ios/api/graphql/mutations/AppleDeviceMutation';
import {
AppleDeviceQuery,
AppleDeviceQueryResult,
} from '../../credentials/ios/api/graphql/queries/AppleDeviceQuery';
import { authenticateAsync, getRequestContext } from '../../credentials/ios/appstore/authenticate';
import {
selectAppleDeviceOnAppleTeamAsync,
selectAppleTeamOnAccountAsync,
} from '../../devices/queries';
import formatDevice from '../../devices/utils/formatDevice';
import { AppleDevice, AppleTeamFragment, Maybe } from '../../graphql/generated';
import Log from '../../log';
import { ora } from '../../ora';
import { getOwnerAccountForProjectIdAsync } from '../../project/projectUtils';
import { promptAsync } from '../../prompts';
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
export default class DeviceRename extends EasCommand {
static override description = 'rename a registered device';
static override flags = {
'apple-team-id': Flags.string({ description: 'The Apple team ID on which to find the device' }),
udid: Flags.string({ description: 'The Apple device ID to rename' }),
name: Flags.string({ description: 'The new name for the device' }),
...EasNonInteractiveAndJsonFlags,
};
static override contextDefinition = {
...this.ContextOptions.ProjectConfig,
...this.ContextOptions.LoggedIn,
};
async runAsync(): Promise<void> {
const { flags } = await this.parse(DeviceRename);
const paginatedQueryOptions = getPaginatedQueryOptions(flags);
let { 'apple-team-id': appleTeamIdentifier, udid, name } = flags;
const {
projectConfig: { projectId },
loggedIn: { graphqlClient },
} = await this.getContextAsync(DeviceRename, {
nonInteractive: paginatedQueryOptions.nonInteractive,
});
const account = await getOwnerAccountForProjectIdAsync(graphqlClient, projectId);
let appleTeamName;
if (paginatedQueryOptions.json) {
enableJsonOutput();
}
let appleTeam: AppleTeamFragment;
if (!appleTeamIdentifier) {
appleTeam = await selectAppleTeamOnAccountAsync(graphqlClient, {
accountName: account.name,
selectionPromptTitle: `What Apple team would you like to list devices for?`,
paginatedQueryOptions,
});
appleTeamIdentifier = appleTeam.appleTeamIdentifier;
appleTeamName = appleTeam.appleTeamName;
}
assert(appleTeamIdentifier, 'No team identifier is specified');
const chosenDevice = udid
? await AppleDeviceQuery.getByDeviceIdentifierAsync(graphqlClient, account.name, udid)
: await selectAppleDeviceOnAppleTeamAsync(graphqlClient, {
accountName: account.name,
appleTeamIdentifier,
selectionPromptTitle: `Which device would you like to rename?`,
paginatedQueryOptions,
});
const newDeviceName = name ? name : await this.promptForNewDeviceNameAsync(chosenDevice.name);
this.logChosenDevice(chosenDevice, appleTeamName, appleTeamIdentifier, paginatedQueryOptions);
await this.renameDeviceOnExpoAsync(graphqlClient, chosenDevice, newDeviceName!);
await this.renameDeviceOnAppleAsync(chosenDevice, appleTeamIdentifier, newDeviceName!);
}
async promptForNewDeviceNameAsync(
initial: Maybe<string> | undefined
): Promise<string | undefined> {
const { name } = await promptAsync({
type: 'text',
name: 'name',
message: 'New device name:',
initial: initial ?? undefined,
});
return name;
}
async renameDeviceOnExpoAsync(
graphqlClient: ExpoGraphqlClient,
chosenDevice: AppleDevice | AppleDeviceQueryResult,
newDeviceName: string
): Promise<void> {
const removalSpinner = ora(`Renaming Apple device on Expo`).start();
try {
await AppleDeviceMutation.updateAppleDeviceAsync(graphqlClient, chosenDevice.id, {
name: newDeviceName,
});
removalSpinner.succeed('Renamed Apple device on Expo');
} catch (err) {
removalSpinner.fail();
throw err;
}
}
async renameDeviceOnAppleAsync(
device: AppleDevice | AppleDeviceQueryResult,
appleTeamIdentifier: string,
newDeviceName: string
): Promise<void> {
const ctx = await authenticateAsync({ teamId: appleTeamIdentifier });
const context = getRequestContext(ctx);
Log.addNewLineIfNone();
const removeAppleSpinner = ora('Renaming device on Apple').start();
try {
const appleValidatedDevices = await Device.getAsync(context);
const appleValidatedDevice = appleValidatedDevices.find(
d => d.attributes.udid === device.identifier
);
if (appleValidatedDevice) {
await appleValidatedDevice.updateAsync({ name: newDeviceName });
removeAppleSpinner.succeed('Renamed device on Apple');
} else {
removeAppleSpinner.warn(
'Device not found on Apple Developer Portal. Expo-registered devices will not appear there until they are chosen for an internal distribution build.'
);
}
} catch (err) {
removeAppleSpinner.fail();
throw err;
}
}
logChosenDevice(
device: AppleDevice | AppleDeviceQueryResult,
appleTeamName: Maybe<string> | undefined,
appleTeamIdentifier: string,
{ json }: PaginatedQueryOptions
): void {
if (json) {
printJsonOnlyOutput(device);
} else {
Log.addNewLineIfNone();
Log.log(
formatDevice(device, {
appleTeamName,
appleTeamIdentifier: appleTeamIdentifier!,
})
);
Log.newLine();
}
}
}
@@ -39,6 +39,7 @@ import {
} from '../../project/publish';
import { ensureEASUpdateIsConfiguredAsync } from '../../update/configure';
import { getUpdateGroupJsonInfo } from '../../update/utils';
import { maybeWarnAboutEasPlanOverageAsync } from '../../utils/billing';
import {
checkManifestBodyAgainstUpdateInfoGroup,
getCodeSigningInfoAsync,
@@ -176,6 +177,7 @@ export default class UpdatePublish extends EasCommand {
isPublicConfig: true,
});
await maybeWarnAboutEasPlanOverageAsync(graphqlClient, projectId);
await maybeWarnAboutEasOutagesAsync(graphqlClient, [StatuspageServiceName.EasUpdate]);
await ensureEASUpdateIsConfiguredAsync(graphqlClient, {
@@ -6,10 +6,8 @@ import { withErrorHandlingAsync } from '../../../../../graphql/client';
import {
AppleDeviceFragment,
AppleDeviceInput,
AppleDeviceUpdateInput,
CreateAppleDeviceMutation,
DeleteAppleDeviceResult,
UpdateAppleDeviceMutation,
} from '../../../../../graphql/generated';
import { AppleDeviceFragmentNode } from '../../../../../graphql/types/credentials/AppleDevice';
@@ -69,35 +67,4 @@ 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,9 +81,7 @@ async function collectDeviceDataAsync(
Log.newLine();
Log.log(
`We are going to register the following device in our database.
This device will ${chalk.bold(
'not'
)} be registered on the Apple Developer Portal until it is chosen for an internal distribution build.`
This will ${chalk.bold('not')} register the device on the Apple Developer Portal yet.`
);
Log.newLine();
Log.log(formatNewDevice({ ...deviceData, identifier: deviceData.udid }, appleTeam));
+26 -9
View File
@@ -87,6 +87,7 @@ 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']>;
@@ -219,6 +220,7 @@ export type AccountAppsArgs = {
export type AccountAppsPaginatedArgs = {
after?: InputMaybe<Scalars['String']>;
before?: InputMaybe<Scalars['String']>;
filter?: InputMaybe<AccountAppsFilterInput>;
first?: InputMaybe<Scalars['Int']>;
last?: InputMaybe<Scalars['Int']>;
};
@@ -309,6 +311,19 @@ export type AccountAppsEdge = {
node: App;
};
export type AccountAppsFilterInput = {
sortByField: AccountAppsSortByField;
};
export enum AccountAppsSortByField {
LatestActivityTime = 'LATEST_ACTIVITY_TIME',
/**
* Name prefers the display name but falls back to full_name with @account/
* part stripped.
*/
Name = 'NAME'
}
export type AccountDataInput = {
name: Scalars['String'];
};
@@ -2036,9 +2051,9 @@ export type BuildArtifacts = {
export type BuildCacheInput = {
clear?: InputMaybe<Scalars['Boolean']>;
customPaths?: InputMaybe<Array<InputMaybe<Scalars['String']>>>;
disabled?: InputMaybe<Scalars['Boolean']>;
key?: InputMaybe<Scalars['String']>;
paths?: InputMaybe<Array<Scalars['String']>>;
};
export enum BuildCredentialsSource {
@@ -5506,14 +5521,6 @@ 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'];
@@ -5922,6 +5929,14 @@ export type LatestAppVersionQueryVariables = Exact<{
export type LatestAppVersionQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, latestAppVersionByPlatformAndApplicationIdentifier?: { __typename?: 'AppVersion', id: string, storeVersion: string, buildVersion: string } | null } } };
export type BillingUpdateByAccountQueryVariables = Exact<{
accountId: Scalars['String'];
date: Scalars['DateTime'];
}>;
export type BillingUpdateByAccountQuery = { __typename?: 'RootQuery', account: { __typename?: 'AccountQuery', byId: { __typename?: 'Account', id: string, billing?: { __typename?: 'Billing', id: string, subscription?: { __typename?: 'SubscriptionDetails', id: string, name?: string | null, meteredBillingStatus: { __typename?: 'MeteredBillingStatus', EAS_UPDATE: boolean } } | null } | null, usageMetrics: { __typename?: 'AccountUsageMetrics', byBillingPeriod: { __typename?: 'UsageMetricTotal', id: string, planMetrics: Array<{ __typename?: 'EstimatedUsage', id: string, serviceMetric: EasServiceMetric, metricType: UsageMetricType, value: number, limit: number }> } } } } };
export type ViewBranchQueryVariables = Exact<{
appId: Scalars['String'];
name: Scalars['String'];
@@ -6086,6 +6101,8 @@ export type WebhookByIdQuery = { __typename?: 'RootQuery', webhook: { __typename
export type AccountFragment = { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'SSOUser', id: string } | { __typename?: 'User', id: string } }> };
export type AccountUpdatesUsageFragment = { __typename?: 'Account', id: string, billing?: { __typename?: 'Billing', id: string, subscription?: { __typename?: 'SubscriptionDetails', id: string, name?: string | null, meteredBillingStatus: { __typename?: 'MeteredBillingStatus', EAS_UPDATE: boolean } } | null } | null, usageMetrics: { __typename?: 'AccountUsageMetrics', byBillingPeriod: { __typename?: 'UsageMetricTotal', id: string, planMetrics: Array<{ __typename?: 'EstimatedUsage', id: string, serviceMetric: EasServiceMetric, metricType: UsageMetricType, value: number, limit: number }> } } };
export type AppFragment = { __typename?: 'App', id: string, fullName: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string, users: Array<{ __typename?: 'UserPermission', role?: Role | null, actor: { __typename?: 'Robot', id: string } | { __typename?: 'SSOUser', id: string } | { __typename?: 'User', id: string } }> } };
export type BuildFragment = { __typename?: 'Build', id: string, status: BuildStatus, platform: AppPlatform, channel?: string | null, releaseChannel?: string | null, distribution?: DistributionType | null, iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null, buildProfile?: string | null, sdkVersion?: string | null, appVersion?: string | null, appBuildVersion?: string | null, runtimeVersion?: string | null, gitCommitHash?: string | null, gitCommitMessage?: string | null, initialQueuePosition?: number | null, queuePosition?: number | null, estimatedWaitTimeLeftSeconds?: number | null, priority: BuildPriority, createdAt: any, updatedAt: any, message?: string | null, completedAt?: any | null, resourceClass: BuildResourceClass, error?: { __typename?: 'BuildError', errorCode: string, message: string, docsUrl?: string | null } | null, artifacts?: { __typename?: 'BuildArtifacts', buildUrl?: string | null, xcodeBuildLogsUrl?: string | null, applicationArchiveUrl?: string | null } | null, initiatingActor?: { __typename: 'Robot', id: string, displayName: string } | { __typename: 'SSOUser', id: string, displayName: string } | { __typename: 'User', id: string, displayName: string } | null, project: { __typename: 'App', id: string, name: string, slug: string, ownerAccount: { __typename?: 'Account', id: string, name: string } } | { __typename: 'Snack', id: string, name: string, slug: string } };
@@ -0,0 +1,66 @@
import assert from 'assert';
import gql from 'graphql-tag';
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
import { withErrorHandlingAsync } from '../client';
import { BillingUpdateByAccountQuery } from '../generated';
export const BillingUpdateQuery = {
async byAccountIdAsync(
graphqlClient: ExpoGraphqlClient,
accountId: string,
date: Date
): Promise<BillingUpdateByAccountQuery['account']['byId']> {
const data = await withErrorHandlingAsync(
graphqlClient
.query<BillingUpdateByAccountQuery>(
gql`
query BillingUpdateByAccountQuery($accountId: String!, $date: DateTime!) {
account {
byId(accountId: $accountId) {
id
billing {
id
subscription {
id
name
meteredBillingStatus {
EAS_UPDATE
}
}
}
usageMetrics {
byBillingPeriod(date: $date, service: UPDATES) {
id
planMetrics {
id
serviceMetric
metricType
value
limit
}
}
}
}
}
}
`,
{ accountId, date },
{
additionalTypenames: [
'Account',
'Billing',
'SubscriptionDetails',
'AccountUsageMetrics',
'UsageMetricTotal',
'EstimatedUsage',
],
}
)
.toPromise()
);
assert(data.account, 'GraphQL: `account` not defined in server response');
return data.account.byId;
},
};
@@ -0,0 +1,29 @@
import gql from 'graphql-tag';
export const AccountUpdatesUsageFragmentNode = gql`
fragment AccountUpdatesUsageFragment on Account {
id
billing {
id
subscription {
id
name
meteredBillingStatus {
EAS_UPDATE
}
}
}
usageMetrics {
byBillingPeriod(date: $date, service: UPDATES) {
id
planMetrics {
id
serviceMetric
metricType
value
limit
}
}
}
}
`;
+1 -4
View File
@@ -1,4 +1,3 @@
import { boolish } from 'getenv';
// eslint-disable-next-line
import oraReal, { Options, Ora } from 'ora';
@@ -15,8 +14,6 @@ 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).
*
@@ -25,7 +22,7 @@ const isCi = boolish('CI', false);
*/
export function ora(options?: Options | string): Ora {
const inputOptions = typeof options === 'string' ? { text: options } : options ?? {};
const disabled = Log.isDebug || !process.stdin.isTTY || isCi;
const disabled = Log.isDebug || !process.stdin.isTTY;
const spinner = oraReal({
// Ensure our non-interactive mode emulates CI mode.
isEnabled: !disabled,
+1 -1
View File
@@ -577,7 +577,7 @@ export async function getUpdateMessageForCommandAsync({
Log.warn('Update message exceeds the allowed 1024 character limit. Truncating message...');
}
return truncatedMessage;
return updateMessage;
}
export const defaultPublishPlatforms: Platform[] = ['android', 'ios'];
@@ -1,38 +0,0 @@
// 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,13 +1,8 @@
import { Platform } from '@expo/eas-build-job';
import { BuildProfile, EasJsonAccessor, EasJsonUtils, errors } from '@expo/eas-json';
import { EasJsonAccessor, EasJsonUtils, errors } from '@expo/eas-json';
import Log from '../../log';
import { selectAsync } from '../../prompts';
import {
clearHasPrintedDeprecationWarnings,
getProfilesAsync,
maybePrintBuildProfileDeprecationWarningsAsync,
} from '../profiles';
import { getProfilesAsync } from '../profiles';
jest.mock('../../prompts');
jest.mock('@expo/eas-json', () => {
@@ -16,7 +11,7 @@ jest.mock('@expo/eas-json', () => {
const EasJsonUtilsMock = {
getBuildProfileAsync: jest.fn(),
getBuildProfileNamesAsync: jest.fn(),
getBuildProfileDeprecationWarningsAsync: jest.fn(() => []),
getBuildProfileDeprecationWarnings: jest.fn(() => []),
};
return {
...actual,
@@ -26,12 +21,6 @@ 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(() => {
@@ -42,10 +31,6 @@ 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],
@@ -77,10 +62,6 @@ 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],
@@ -113,82 +94,3 @@ describe(getProfilesAsync, () => {
).rejects.toThrowError(/eas.json is not valid/);
});
});
describe(maybePrintBuildProfileDeprecationWarningsAsync, () => {
afterEach(() => {
clearHasPrintedDeprecationWarnings();
newLineSpy.mockClear();
warnSpy.mockClear();
});
const easJsonAccessor = EasJsonAccessor.fromProjectPath('/fake');
const readRawEasJsonMock = jest.spyOn(easJsonAccessor, 'readRawJsonAsync');
readRawEasJsonMock.mockImplementation(async () => {
return {};
});
getBuildProfileAsync.mockImplementation(async () => {
return {} as BuildProfile<Platform.ANDROID>;
});
describe('no deprecation warnings', () => {
it('does not print any warnings', async () => {
getBuildProfileDeprecationWarningsAsync.mockImplementation(async () => []);
await maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(newLineSpy).not.toHaveBeenCalled();
expect(warnSpy).not.toHaveBeenCalled();
});
});
describe('one deprecation warning', () => {
it('prints the warning', async () => {
getBuildProfileDeprecationWarningsAsync.mockImplementation(async () => [
{
message: [
'The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.',
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
]);
await maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(newLineSpy).toHaveBeenCalledTimes(2);
expect(warnSpy).toHaveBeenCalledTimes(3);
const warnCalls = warnSpy.mock.calls;
expect(warnCalls).toMatchSnapshot();
});
});
describe('multiple deprecation warnings', () => {
it('prints the warnings', async () => {
getBuildProfileDeprecationWarningsAsync.mockImplementation(async () => [
{
message: [
'The "build.production.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.production.cache.paths" instead.',
],
docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
},
{
message: [
'The "build.production.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.',
],
docsUrl: 'https://docs.expo.dev/build-reference/caching/#ios-dependencies',
},
{
message: ['Other message'],
},
]);
await maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
Platform.ANDROID,
'production'
);
expect(newLineSpy).toHaveBeenCalledTimes(4);
expect(warnSpy).toHaveBeenCalledTimes(6);
const warnCalls = warnSpy.mock.calls;
expect(warnCalls).toMatchSnapshot();
});
});
});
+44
View File
@@ -0,0 +1,44 @@
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
import { BillingUpdateQuery } from '../graphql/queries/BillingUpdateQuery';
import Log from '../log';
import { getOwnerAccountForProjectIdAsync } from '../project/projectUtils';
const WARNING_THRESHOLD = 0.85;
export async function maybeWarnAboutEasPlanOverageAsync(
graphqlClient: ExpoGraphqlClient,
projectId: string
): Promise<void> {
const account = await getOwnerAccountForProjectIdAsync(graphqlClient, projectId);
const billingUpdateQuery = await BillingUpdateQuery.byAccountIdAsync(
graphqlClient,
account.id,
new Date()
);
const isFree = !billingUpdateQuery.billing; // TODO: no billing means free?
const isMetered = !!billingUpdateQuery.billing?.subscription?.meteredBillingStatus?.EAS_UPDATE;
// TODO: verify correctness
if (!isFree || isMetered) {
return;
}
const planMetrics = billingUpdateQuery.usageMetrics.byBillingPeriod.planMetrics;
for (const metric of planMetrics) {
const { value, limit, serviceMetric } = metric;
const percentageUsed = value / limit;
if (percentageUsed >= 1) {
Log.error(
'You have exceeded your EAS Update plan limit. You can create updates but they will no longer be distributed to users.'
);
Log.error('Please upgrade your plan to continue receiving updates.');
return;
} else if (percentageUsed >= WARNING_THRESHOLD && percentageUsed < 1) {
Log.warn(
`You are approaching your EAS Update plan limit. You have used ${Math.round(
percentageUsed * 100
)}% of your plan's ${serviceMetric}.`
);
Log.warn('Please upgrade your plan to continue receiving updates.');
}
}
}
+7 -16
View File
@@ -65,7 +65,7 @@ async function readProfileAsync<T extends ProfileType>({
profileName
);
await maybePrintBuildProfileDeprecationWarningsAsync(easJsonAccessor, platform, profileName);
maybePrintBuildProfileDeprecationWarnings(buildProfile, profileName);
return buildProfile as EasProfile<T>;
} else {
@@ -79,25 +79,16 @@ async function readProfileAsync<T extends ProfileType>({
let hasPrintedDeprecationWarnings = false;
/**
* Only for testing purposes
*/
export function clearHasPrintedDeprecationWarnings(): void {
hasPrintedDeprecationWarnings = false;
}
export async function maybePrintBuildProfileDeprecationWarningsAsync(
easJsonAccessor: EasJsonAccessor,
platform: Platform,
function maybePrintBuildProfileDeprecationWarnings(
buildProfile: BuildProfile<Platform>,
profileName?: string
): Promise<void> {
): void {
if (hasPrintedDeprecationWarnings) {
return;
}
const deprecationWarnings = await EasJsonUtils.getBuildProfileDeprecationWarningsAsync(
easJsonAccessor,
platform,
profileName ?? 'production'
const deprecationWarnings = EasJsonUtils.getBuildProfileDeprecationWarnings(
buildProfile,
profileName
);
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.10.1",
"version": "3.9.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.10",
"@expo/eas-build-job": "1.0.7",
"chalk": "4.1.2",
"env-string": "1.0.1",
"fs-extra": "10.1.0",
-10
View File
@@ -67,16 +67,6 @@
"description": "Cache key. You can invalidate the cache by changing this value."
},
"customPaths": {
"type": "array",
"description": "[DEPRECATED] Use `paths` instead. List of the paths that will be saved after a successful build and restored at the beginning of the next one.",
"markdownDescription": "[DEPRECATED] Use `paths` instead. List of the paths that will be saved after a successful build and restored at the beginning of the next one. Both absolute and relative paths are supported, where relative paths are resolved from the directory with `eas.json`.",
"uniqueItems": true,
"items": {
"type": "string"
},
"deprecated": true
},
"paths": {
"type": "array",
"description": "List of the paths that will be saved after a successful build and restored at the beginning of the next one.",
"markdownDescription": "List of the paths that will be saved after a successful build and restored at the beginning of the next one. Both absolute and relative paths are supported, where relative paths are resolved from the directory with `eas.json`.",
@@ -1,5 +1,4 @@
import { Platform } from '@expo/eas-build-job';
import chalk from 'chalk';
import fs from 'fs-extra';
import { vol } from 'memfs';
@@ -242,65 +241,6 @@ 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: {
@@ -346,7 +286,7 @@ test('valid profile extending other profile with platform specific caching - bac
distribution: 'internal',
credentialsSource: 'remote',
cache: {
paths: ['somefakepath'],
customPaths: ['somefakepath'],
},
});
expect(extendedIosProfile).toEqual({
@@ -544,145 +484,3 @@ 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);
});
@@ -1,261 +0,0 @@
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',
},
]);
});
});
});
});
+1 -5
View File
@@ -23,11 +23,7 @@ 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
+7 -38
View File
@@ -28,54 +28,23 @@ export class EasJsonUtils {
return resolveBuildProfile({ easJson, platform, profileName });
}
public static async getBuildProfileDeprecationWarningsAsync(
easJsonAccessor: EasJsonAccessor,
platform: Platform,
profileName: string
): Promise<EasJsonDeprecationWarning[]> {
public static getBuildProfileDeprecationWarnings(
buildProfile: BuildProfile,
profileName?: string
): 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}.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.`,
`The "build.${
profileName ?? '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',
});
}
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].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==
"@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==
dependencies:
joi "^17.7.0"
semver "^7.3.8"