mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-13 20:28:08 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5191b2da6 |
No files matched your search
@@ -1,146 +0,0 @@
|
||||
name: Issue Triage
|
||||
on:
|
||||
issues:
|
||||
types: [labeled]
|
||||
|
||||
jobs:
|
||||
needs-repro:
|
||||
runs-on: ubuntu-20.04
|
||||
if: "${{ contains(github.event.label.name, 'incomplete issue: missing or invalid repro') }}"
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.
|
||||
|
||||
**The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine.** Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.
|
||||
|
||||
A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.
|
||||
|
||||
### Resources
|
||||
|
||||
- ["How to create a Minimal, Reproducible Example"](https://stackoverflow.com/help/minimal-reproducible-example)
|
||||
- ["How to narrow down the source of an error"](https://expo.fyi/manual-debugging)
|
||||
|
||||
### Common concerns
|
||||
|
||||
#### "I've only been able to reproduce it in private, proprietary code"
|
||||
|
||||
You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this [manual debugging guide](https://expo.fyi/manual-debugging) to learn how to isolate the problem from the rest of your codebase.
|
||||
|
||||
#### "I didn't have time to create one"
|
||||
|
||||
That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.
|
||||
|
||||
#### "You can reproduce it by yourself by creating a project and following these steps"
|
||||
|
||||
This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.
|
||||
`})
|
||||
github.issues.update({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
})
|
||||
|
||||
needs-info:
|
||||
runs-on: ubuntu-20.04
|
||||
if: "${{ contains(github.event.label.name, 'incomplete issue: missing info') }}"
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Hello! There isn't enough information provided in your issue description for us to be able to help you. The best way to get help is to provide information to enable other developers to understand the issue and reproduce it on their own machines.
|
||||
|
||||
Please create a new issue and fill out the entire issue template to the best of your ability. Refer to the following resources for more information on how to create a good issue report.
|
||||
|
||||
### Resources
|
||||
|
||||
- ["How do I ask a good question?"](https://stackoverflow.com/help/how-to-ask)
|
||||
- ["How to create a Minimal, Reproducible Example"](https://stackoverflow.com/help/minimal-reproducible-example)
|
||||
- ["How to narrow down the source of an error"](https://expo.fyi/manual-debugging)
|
||||
`})
|
||||
github.issues.update({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
})
|
||||
|
||||
issue-accepted:
|
||||
runs-on: ubuntu-20.04
|
||||
if: github.event.label.name == 'issue accepted'
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Thank you for filing this issue!
|
||||
This comment acknowledges we believe this may be a bug and there’s enough information to investigate it.
|
||||
However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
|
||||
`})
|
||||
|
||||
question:
|
||||
runs-on: ubuntu-20.04
|
||||
if: "${{ contains(github.event.label.name, 'invalid issue: question') }}"
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Hello! Our GitHub issues are reserved for bug reports.
|
||||
|
||||
If you have a question about Expo or related tools, please post on our forums at https://forums.expo.dev/ or join our Discord at https://chat.expo.dev/.
|
||||
|
||||
### Resources
|
||||
|
||||
- ["How do I ask a good question?"](https://stackoverflow.com/help/how-to-ask)
|
||||
- ["Join the community"](https://docs.expo.dev/next-steps/community/)
|
||||
`})
|
||||
github.issues.update({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
})
|
||||
|
||||
feature-request:
|
||||
runs-on: ubuntu-20.04
|
||||
if: "${{ contains(github.event.label.name, 'invalid issue: feature request') }}"
|
||||
steps:
|
||||
- uses: actions/github-script@v3
|
||||
with:
|
||||
github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
github.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: `Hello! Our GitHub issues are reserved for bug reports.
|
||||
|
||||
If you would like to request a feature, please post to https://expo.canny.io/feature-requests.
|
||||
`})
|
||||
github.issues.update({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
})
|
||||
@@ -1,26 +0,0 @@
|
||||
name: Test scripts
|
||||
|
||||
defaults:
|
||||
run:
|
||||
working-directory: scripts
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'scripts/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'scripts/**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 18
|
||||
- run: yarn install --frozen-lockfile --check-files
|
||||
- run: yarn typecheck
|
||||
@@ -27,10 +27,6 @@ jobs:
|
||||
if: ${{ !matrix.coverage }}
|
||||
- run: yarn test --coverage
|
||||
if: ${{ matrix.coverage }}
|
||||
env:
|
||||
# Oclif seems to cause OOM errors when testing with coverage enabled.
|
||||
# Remove this whenever we solved those OOM errors.
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
- run: yarn lint --max-warnings=0
|
||||
- run: shellcheck bin/*.sh
|
||||
- uses: codecov/codecov-action@v1
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
packages/*/build
|
||||
packages/eas-cli/dist
|
||||
packages/eas-cli/tmp
|
||||
scripts/build
|
||||
|
||||
# Code editors
|
||||
.idea
|
||||
|
||||
@@ -8,31 +8,11 @@ This is the log of notable changes to EAS CLI and related packages.
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Show spinner instead of silently timing out during asset upload. ([#1206](https://github.com/expo/eas-cli/pull/1206) by [@wschurman](https://github.com/wschurman))
|
||||
- Fix build archive S3 URLs. ([#1207](https://github.com/expo/eas-cli/pull/1207) by [@dsokal](https://github.com/dsokal))
|
||||
|
||||
### 🧹 Chores
|
||||
|
||||
- Increase max number of chained "extends" in build profiles. ([#1208](https://github.com/expo/eas-cli/pull/1208) by [@wkozyra95](https://github.com/wkozyra95))
|
||||
|
||||
## [0.55.1](https://github.com/expo/eas-cli/releases/tag/v0.55.1) - 2022-07-12
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
- Fix asset upload crash. ([#1205](https://github.com/expo/eas-cli/pull/1205) by [@wschurman](https://github.com/wschurman))
|
||||
|
||||
## [0.55.0](https://github.com/expo/eas-cli/releases/tag/v0.55.0) - 2022-07-11
|
||||
|
||||
### 🎉 New features
|
||||
|
||||
- Show bundler output by default for eas update command. ([#1171](https://github.com/expo/eas-cli/pull/1171) by [@kgc00](https://github.com/kgc00/))
|
||||
- Allow users to skip metadata validation. ([#1175](https://github.com/expo/eas-cli/pull/1175) by [@byCedric](https://github.com/byCedric))
|
||||
- Add experimental `--resource-class` flag for Build commands. ([#1138](https://github.com/expo/eas-cli/pull/1138) by [@christopherwalter](https://github.com/christopherwalter))
|
||||
- Truncate long messages for `eas update` command, rather than failing. ([#1178](https://github.com/expo/eas-cli/pull/1178) by [@kgc00](https://github.com/kgc00))
|
||||
- Add review details to metadata store configuration. ([#1184](https://github.com/expo/eas-cli/pull/1184) by [@byCedric](https://github.com/byCedric))
|
||||
- Override applicationId via env. ([#1203](https://github.com/expo/eas-cli/pull/1203) by [@wkozyra95](https://github.com/wkozyra95))
|
||||
|
||||
### 🐛 Bug fixes
|
||||
|
||||
@@ -42,8 +22,6 @@ This is the log of notable changes to EAS CLI and related packages.
|
||||
|
||||
- Update validation rules for metadata info locales. ([#1174](https://github.com/expo/eas-cli/pull/1174) by [@byCedric](https://github.com/byCedric))
|
||||
- Improve store configuration defaults and schema documentation. ([#1183](https://github.com/expo/eas-cli/pull/1183) by [@byCedric](https://github.com/byCedric))
|
||||
- Improve store config categories configuration. ([#1187](https://github.com/expo/eas-cli/pull/1187) by [@byCedric](https://github.com/byCedric))
|
||||
- Remove deprecated idfa and price tier from store config. ([#1193](https://github.com/expo/eas-cli/pull/1193) by [@byCedric](https://github.com/byCedric))
|
||||
|
||||
## [0.54.1](https://github.com/expo/eas-cli/releases/tag/v0.54.1) - 2022-06-15
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"npmClient": "yarn",
|
||||
"useWorkspaces": true,
|
||||
"version": "0.55.1"
|
||||
"version": "0.54.1"
|
||||
}
|
||||
+1
-1
@@ -29,7 +29,7 @@
|
||||
"oclif": "3.0.1",
|
||||
"prettier": "2.6.2",
|
||||
"ts-jest": "28.0.2",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "4.6.4"
|
||||
},
|
||||
"volta": {
|
||||
"node": "18.2.0",
|
||||
|
||||
+98
-100
@@ -22,69 +22,68 @@ yarn global add eas-cli
|
||||
# Usage
|
||||
|
||||
```sh
|
||||
# runs the command
|
||||
eas COMMAND
|
||||
# prints the version
|
||||
# runs the command
|
||||
eas (-v|--version|version)
|
||||
# outputs help for specific command
|
||||
# prints the version
|
||||
eas --help COMMAND
|
||||
# outputs help for specific command
|
||||
```
|
||||
|
||||
# Commands
|
||||
|
||||
<!-- commands -->
|
||||
|
||||
- [`eas account:login`](#eas-accountlogin)
|
||||
- [`eas account:logout`](#eas-accountlogout)
|
||||
- [`eas account:view`](#eas-accountview)
|
||||
- [`eas analytics [STATUS]`](#eas-analytics-status)
|
||||
- [`eas autocomplete [SHELL]`](#eas-autocomplete-shell)
|
||||
- [`eas branch:create [NAME]`](#eas-branchcreate-name)
|
||||
- [`eas branch:delete [NAME]`](#eas-branchdelete-name)
|
||||
- [`eas branch:list`](#eas-branchlist)
|
||||
- [`eas branch:rename`](#eas-branchrename)
|
||||
- [`eas branch:view [NAME]`](#eas-branchview-name)
|
||||
- [`eas build`](#eas-build)
|
||||
- [`eas build:cancel [BUILD_ID]`](#eas-buildcancel-build_id)
|
||||
- [`eas build:configure`](#eas-buildconfigure)
|
||||
- [`eas build:inspect`](#eas-buildinspect)
|
||||
- [`eas build:list`](#eas-buildlist)
|
||||
- [`eas build:submit`](#eas-buildsubmit)
|
||||
- [`eas build:view [BUILD_ID]`](#eas-buildview-build_id)
|
||||
- [`eas channel:create [NAME]`](#eas-channelcreate-name)
|
||||
- [`eas channel:edit [NAME]`](#eas-channeledit-name)
|
||||
- [`eas channel:list`](#eas-channellist)
|
||||
- [`eas channel:view [NAME]`](#eas-channelview-name)
|
||||
- [`eas config`](#eas-config)
|
||||
- [`eas credentials`](#eas-credentials)
|
||||
- [`eas device:create`](#eas-devicecreate)
|
||||
- [`eas device:delete`](#eas-devicedelete)
|
||||
- [`eas device:list`](#eas-devicelist)
|
||||
- [`eas device:view [UDID]`](#eas-deviceview-udid)
|
||||
- [`eas diagnostics`](#eas-diagnostics)
|
||||
- [`eas help [COMMAND]`](#eas-help-command)
|
||||
- [`eas init`](#eas-init)
|
||||
- [`eas login`](#eas-login)
|
||||
- [`eas logout`](#eas-logout)
|
||||
- [`eas metadata:pull`](#eas-metadatapull)
|
||||
- [`eas metadata:push`](#eas-metadatapush)
|
||||
- [`eas project:info`](#eas-projectinfo)
|
||||
- [`eas project:init`](#eas-projectinit)
|
||||
- [`eas secret:create`](#eas-secretcreate)
|
||||
- [`eas secret:delete`](#eas-secretdelete)
|
||||
- [`eas secret:list`](#eas-secretlist)
|
||||
- [`eas submit`](#eas-submit)
|
||||
- [`eas update`](#eas-update)
|
||||
- [`eas update:configure`](#eas-updateconfigure)
|
||||
- [`eas update:delete GROUPID`](#eas-updatedelete-groupid)
|
||||
- [`eas update:list`](#eas-updatelist)
|
||||
- [`eas update:view GROUPID`](#eas-updateview-groupid)
|
||||
- [`eas webhook:create`](#eas-webhookcreate)
|
||||
- [`eas webhook:delete [ID]`](#eas-webhookdelete-id)
|
||||
- [`eas webhook:list`](#eas-webhooklist)
|
||||
- [`eas webhook:update`](#eas-webhookupdate)
|
||||
- [`eas webhook:view ID`](#eas-webhookview-id)
|
||||
- [`eas whoami`](#eas-whoami)
|
||||
* [`eas account:login`](#eas-accountlogin)
|
||||
* [`eas account:logout`](#eas-accountlogout)
|
||||
* [`eas account:view`](#eas-accountview)
|
||||
* [`eas analytics [STATUS]`](#eas-analytics-status)
|
||||
* [`eas autocomplete [SHELL]`](#eas-autocomplete-shell)
|
||||
* [`eas branch:create [NAME]`](#eas-branchcreate-name)
|
||||
* [`eas branch:delete [NAME]`](#eas-branchdelete-name)
|
||||
* [`eas branch:list`](#eas-branchlist)
|
||||
* [`eas branch:rename`](#eas-branchrename)
|
||||
* [`eas branch:view [NAME]`](#eas-branchview-name)
|
||||
* [`eas build`](#eas-build)
|
||||
* [`eas build:cancel [BUILD_ID]`](#eas-buildcancel-build_id)
|
||||
* [`eas build:configure`](#eas-buildconfigure)
|
||||
* [`eas build:inspect`](#eas-buildinspect)
|
||||
* [`eas build:list`](#eas-buildlist)
|
||||
* [`eas build:submit`](#eas-buildsubmit)
|
||||
* [`eas build:view [BUILD_ID]`](#eas-buildview-build_id)
|
||||
* [`eas channel:create [NAME]`](#eas-channelcreate-name)
|
||||
* [`eas channel:edit [NAME]`](#eas-channeledit-name)
|
||||
* [`eas channel:list`](#eas-channellist)
|
||||
* [`eas channel:view [NAME]`](#eas-channelview-name)
|
||||
* [`eas config`](#eas-config)
|
||||
* [`eas credentials`](#eas-credentials)
|
||||
* [`eas device:create`](#eas-devicecreate)
|
||||
* [`eas device:delete`](#eas-devicedelete)
|
||||
* [`eas device:list`](#eas-devicelist)
|
||||
* [`eas device:view [UDID]`](#eas-deviceview-udid)
|
||||
* [`eas diagnostics`](#eas-diagnostics)
|
||||
* [`eas help [COMMAND]`](#eas-help-command)
|
||||
* [`eas init`](#eas-init)
|
||||
* [`eas login`](#eas-login)
|
||||
* [`eas logout`](#eas-logout)
|
||||
* [`eas metadata:pull`](#eas-metadatapull)
|
||||
* [`eas metadata:push`](#eas-metadatapush)
|
||||
* [`eas project:info`](#eas-projectinfo)
|
||||
* [`eas project:init`](#eas-projectinit)
|
||||
* [`eas secret:create`](#eas-secretcreate)
|
||||
* [`eas secret:delete`](#eas-secretdelete)
|
||||
* [`eas secret:list`](#eas-secretlist)
|
||||
* [`eas submit`](#eas-submit)
|
||||
* [`eas update`](#eas-update)
|
||||
* [`eas update:configure`](#eas-updateconfigure)
|
||||
* [`eas update:delete GROUPID`](#eas-updatedelete-groupid)
|
||||
* [`eas update:list`](#eas-updatelist)
|
||||
* [`eas update:view GROUPID`](#eas-updateview-groupid)
|
||||
* [`eas webhook:create`](#eas-webhookcreate)
|
||||
* [`eas webhook:delete [ID]`](#eas-webhookdelete-id)
|
||||
* [`eas webhook:list`](#eas-webhooklist)
|
||||
* [`eas webhook:update`](#eas-webhookupdate)
|
||||
* [`eas webhook:view ID`](#eas-webhookview-id)
|
||||
* [`eas whoami`](#eas-whoami)
|
||||
|
||||
## `eas account:login`
|
||||
|
||||
@@ -101,7 +100,7 @@ ALIASES
|
||||
$ eas login
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/account/login.ts)_
|
||||
_See code: [src/commands/account/login.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/account/login.ts)_
|
||||
|
||||
## `eas account:logout`
|
||||
|
||||
@@ -118,7 +117,7 @@ ALIASES
|
||||
$ eas logout
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/account/logout.ts)_
|
||||
_See code: [src/commands/account/logout.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/account/logout.ts)_
|
||||
|
||||
## `eas account:view`
|
||||
|
||||
@@ -135,7 +134,7 @@ ALIASES
|
||||
$ eas whoami
|
||||
```
|
||||
|
||||
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/account/view.ts)_
|
||||
_See code: [src/commands/account/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/account/view.ts)_
|
||||
|
||||
## `eas analytics [STATUS]`
|
||||
|
||||
@@ -149,7 +148,7 @@ DESCRIPTION
|
||||
display or change analytics settings
|
||||
```
|
||||
|
||||
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/analytics.ts)_
|
||||
_See code: [src/commands/analytics.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/analytics.ts)_
|
||||
|
||||
## `eas autocomplete [SHELL]`
|
||||
|
||||
@@ -198,7 +197,7 @@ DESCRIPTION
|
||||
create a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/branch/create.ts)_
|
||||
_See code: [src/commands/branch/create.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/branch/create.ts)_
|
||||
|
||||
## `eas branch:delete [NAME]`
|
||||
|
||||
@@ -218,7 +217,7 @@ DESCRIPTION
|
||||
delete a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/branch/delete.ts)_
|
||||
_See code: [src/commands/branch/delete.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/branch/delete.ts)_
|
||||
|
||||
## `eas branch:list`
|
||||
|
||||
@@ -235,7 +234,7 @@ DESCRIPTION
|
||||
list all branches
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/branch/list.ts)_
|
||||
_See code: [src/commands/branch/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/branch/list.ts)_
|
||||
|
||||
## `eas branch:rename`
|
||||
|
||||
@@ -254,7 +253,7 @@ DESCRIPTION
|
||||
rename a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/branch/rename.ts)_
|
||||
_See code: [src/commands/branch/rename.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/branch/rename.ts)_
|
||||
|
||||
## `eas branch:view [NAME]`
|
||||
|
||||
@@ -274,7 +273,7 @@ DESCRIPTION
|
||||
view a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/branch/view.ts)_
|
||||
_See code: [src/commands/branch/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/branch/view.ts)_
|
||||
|
||||
## `eas build`
|
||||
|
||||
@@ -303,7 +302,7 @@ DESCRIPTION
|
||||
start a build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/build/index.ts)_
|
||||
_See code: [src/commands/build/index.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/build/index.ts)_
|
||||
|
||||
## `eas build:cancel [BUILD_ID]`
|
||||
|
||||
@@ -317,7 +316,7 @@ DESCRIPTION
|
||||
cancel a build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/build/cancel.ts)_
|
||||
_See code: [src/commands/build/cancel.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/build/cancel.ts)_
|
||||
|
||||
## `eas build:configure`
|
||||
|
||||
@@ -334,7 +333,7 @@ DESCRIPTION
|
||||
configure the project to support EAS Build
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/build/configure.ts)_
|
||||
_See code: [src/commands/build/configure.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/build/configure.ts)_
|
||||
|
||||
## `eas build:inspect`
|
||||
|
||||
@@ -369,7 +368,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/v0.55.1/packages/eas-cli/src/commands/build/inspect.ts)_
|
||||
_See code: [src/commands/build/inspect.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/build/inspect.ts)_
|
||||
|
||||
## `eas build:list`
|
||||
|
||||
@@ -402,7 +401,7 @@ DESCRIPTION
|
||||
list all builds for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/build/list.ts)_
|
||||
_See code: [src/commands/build/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/build/list.ts)_
|
||||
|
||||
## `eas build:submit`
|
||||
|
||||
@@ -447,7 +446,7 @@ DESCRIPTION
|
||||
view a build for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/build/view.ts)_
|
||||
_See code: [src/commands/build/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/build/view.ts)_
|
||||
|
||||
## `eas channel:create [NAME]`
|
||||
|
||||
@@ -467,7 +466,7 @@ DESCRIPTION
|
||||
create a channel
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/channel/create.ts)_
|
||||
_See code: [src/commands/channel/create.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/channel/create.ts)_
|
||||
|
||||
## `eas channel:edit [NAME]`
|
||||
|
||||
@@ -488,7 +487,7 @@ DESCRIPTION
|
||||
point a channel at a new branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/channel/edit.ts)_
|
||||
_See code: [src/commands/channel/edit.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/channel/edit.ts)_
|
||||
|
||||
## `eas channel:list`
|
||||
|
||||
@@ -505,7 +504,7 @@ DESCRIPTION
|
||||
list all channels
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/channel/list.ts)_
|
||||
_See code: [src/commands/channel/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/channel/list.ts)_
|
||||
|
||||
## `eas channel:view [NAME]`
|
||||
|
||||
@@ -525,7 +524,7 @@ DESCRIPTION
|
||||
view a channel
|
||||
```
|
||||
|
||||
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/channel/view.ts)_
|
||||
_See code: [src/commands/channel/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/channel/view.ts)_
|
||||
|
||||
## `eas config`
|
||||
|
||||
@@ -543,7 +542,7 @@ DESCRIPTION
|
||||
display project configuration (app.json + eas.json)
|
||||
```
|
||||
|
||||
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/config.ts)_
|
||||
_See code: [src/commands/config.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/config.ts)_
|
||||
|
||||
## `eas credentials`
|
||||
|
||||
@@ -557,7 +556,7 @@ DESCRIPTION
|
||||
manage credentials
|
||||
```
|
||||
|
||||
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/credentials.ts)_
|
||||
_See code: [src/commands/credentials.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/credentials.ts)_
|
||||
|
||||
## `eas device:create`
|
||||
|
||||
@@ -571,7 +570,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/v0.55.1/packages/eas-cli/src/commands/device/create.ts)_
|
||||
_See code: [src/commands/device/create.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/device/create.ts)_
|
||||
|
||||
## `eas device:delete`
|
||||
|
||||
@@ -589,7 +588,7 @@ DESCRIPTION
|
||||
remove a registered device from your account
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/device/delete.ts)_
|
||||
_See code: [src/commands/device/delete.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/device/delete.ts)_
|
||||
|
||||
## `eas device:list`
|
||||
|
||||
@@ -606,7 +605,7 @@ DESCRIPTION
|
||||
list all registered devices for your account
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/device/list.ts)_
|
||||
_See code: [src/commands/device/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/device/list.ts)_
|
||||
|
||||
## `eas device:view [UDID]`
|
||||
|
||||
@@ -620,7 +619,7 @@ DESCRIPTION
|
||||
view a device for your project
|
||||
```
|
||||
|
||||
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/device/view.ts)_
|
||||
_See code: [src/commands/device/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/device/view.ts)_
|
||||
|
||||
## `eas diagnostics`
|
||||
|
||||
@@ -634,7 +633,7 @@ DESCRIPTION
|
||||
display environment info
|
||||
```
|
||||
|
||||
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/diagnostics.ts)_
|
||||
_See code: [src/commands/diagnostics.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/diagnostics.ts)_
|
||||
|
||||
## `eas help [COMMAND]`
|
||||
|
||||
@@ -716,7 +715,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/v0.55.1/packages/eas-cli/src/commands/metadata/pull.ts)_
|
||||
_See code: [src/commands/metadata/pull.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/metadata/pull.ts)_
|
||||
|
||||
## `eas metadata:push`
|
||||
|
||||
@@ -733,7 +732,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/v0.55.1/packages/eas-cli/src/commands/metadata/push.ts)_
|
||||
_See code: [src/commands/metadata/push.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/metadata/push.ts)_
|
||||
|
||||
## `eas project:info`
|
||||
|
||||
@@ -747,7 +746,7 @@ DESCRIPTION
|
||||
information about the current project
|
||||
```
|
||||
|
||||
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/project/info.ts)_
|
||||
_See code: [src/commands/project/info.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/project/info.ts)_
|
||||
|
||||
## `eas project:init`
|
||||
|
||||
@@ -764,7 +763,7 @@ ALIASES
|
||||
$ eas init
|
||||
```
|
||||
|
||||
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/project/init.ts)_
|
||||
_See code: [src/commands/project/init.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/project/init.ts)_
|
||||
|
||||
## `eas secret:create`
|
||||
|
||||
@@ -784,7 +783,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/v0.55.1/packages/eas-cli/src/commands/secret/create.ts)_
|
||||
_See code: [src/commands/secret/create.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/secret/create.ts)_
|
||||
|
||||
## `eas secret:delete`
|
||||
|
||||
@@ -801,7 +800,7 @@ DESCRIPTION
|
||||
delete an environment secret by ID
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/secret/delete.ts)_
|
||||
_See code: [src/commands/secret/delete.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/secret/delete.ts)_
|
||||
|
||||
## `eas secret:list`
|
||||
|
||||
@@ -815,7 +814,7 @@ DESCRIPTION
|
||||
list environment secrets available for your current app
|
||||
```
|
||||
|
||||
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/secret/list.ts)_
|
||||
_See code: [src/commands/secret/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/secret/list.ts)_
|
||||
|
||||
## `eas submit`
|
||||
|
||||
@@ -845,7 +844,7 @@ ALIASES
|
||||
$ eas build:submit
|
||||
```
|
||||
|
||||
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/submit.ts)_
|
||||
_See code: [src/commands/submit.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/submit.ts)_
|
||||
|
||||
## `eas update`
|
||||
|
||||
@@ -875,7 +874,7 @@ DESCRIPTION
|
||||
publish an update group
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/update/index.ts)_
|
||||
_See code: [src/commands/update/index.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/update/index.ts)_
|
||||
|
||||
## `eas update:configure`
|
||||
|
||||
@@ -892,7 +891,7 @@ DESCRIPTION
|
||||
configure the project to support EAS Update
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/update/configure.ts)_
|
||||
_See code: [src/commands/update/configure.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/update/configure.ts)_
|
||||
|
||||
## `eas update:delete GROUPID`
|
||||
|
||||
@@ -912,7 +911,7 @@ DESCRIPTION
|
||||
delete all the updates in an update group
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/update/delete.ts)_
|
||||
_See code: [src/commands/update/delete.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/update/delete.ts)_
|
||||
|
||||
## `eas update:list`
|
||||
|
||||
@@ -931,7 +930,7 @@ DESCRIPTION
|
||||
view the recent updates for a branch
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/update/list.ts)_
|
||||
_See code: [src/commands/update/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/update/list.ts)_
|
||||
|
||||
## `eas update:view GROUPID`
|
||||
|
||||
@@ -951,7 +950,7 @@ DESCRIPTION
|
||||
update group details
|
||||
```
|
||||
|
||||
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/update/view.ts)_
|
||||
_See code: [src/commands/update/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/update/view.ts)_
|
||||
|
||||
## `eas webhook:create`
|
||||
|
||||
@@ -971,7 +970,7 @@ DESCRIPTION
|
||||
create a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/webhook/create.ts)_
|
||||
_See code: [src/commands/webhook/create.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/webhook/create.ts)_
|
||||
|
||||
## `eas webhook:delete [ID]`
|
||||
|
||||
@@ -988,7 +987,7 @@ DESCRIPTION
|
||||
delete a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/webhook/delete.ts)_
|
||||
_See code: [src/commands/webhook/delete.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/webhook/delete.ts)_
|
||||
|
||||
## `eas webhook:list`
|
||||
|
||||
@@ -1005,7 +1004,7 @@ DESCRIPTION
|
||||
list webhooks
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/webhook/list.ts)_
|
||||
_See code: [src/commands/webhook/list.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/webhook/list.ts)_
|
||||
|
||||
## `eas webhook:update`
|
||||
|
||||
@@ -1026,7 +1025,7 @@ DESCRIPTION
|
||||
update a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/webhook/update.ts)_
|
||||
_See code: [src/commands/webhook/update.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/webhook/update.ts)_
|
||||
|
||||
## `eas webhook:view ID`
|
||||
|
||||
@@ -1043,7 +1042,7 @@ DESCRIPTION
|
||||
view a webhook
|
||||
```
|
||||
|
||||
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.55.1/packages/eas-cli/src/commands/webhook/view.ts)_
|
||||
_See code: [src/commands/webhook/view.ts](https://github.com/expo/eas-cli/blob/v0.54.1/packages/eas-cli/src/commands/webhook/view.ts)_
|
||||
|
||||
## `eas whoami`
|
||||
|
||||
@@ -1059,5 +1058,4 @@ DESCRIPTION
|
||||
ALIASES
|
||||
$ eas whoami
|
||||
```
|
||||
|
||||
<!-- commandsstop -->
|
||||
Generated
+23
-1
@@ -10209,7 +10209,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "assetContentTypes",
|
||||
"description": "max 600",
|
||||
"description": "max 1400",
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
@@ -10763,6 +10763,22 @@
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "maxBuildTimeSeconds",
|
||||
"description": null,
|
||||
"args": [],
|
||||
"type": {
|
||||
"kind": "NON_NULL",
|
||||
"name": null,
|
||||
"ofType": {
|
||||
"kind": "SCALAR",
|
||||
"name": "Int",
|
||||
"ofType": null
|
||||
}
|
||||
},
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "metrics",
|
||||
"description": null,
|
||||
@@ -12574,6 +12590,12 @@
|
||||
"description": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
},
|
||||
{
|
||||
"name": "NORMAL_PLUS",
|
||||
"description": null,
|
||||
"isDeprecated": false,
|
||||
"deprecationReason": null
|
||||
}
|
||||
],
|
||||
"possibleTypes": null
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "eas-cli",
|
||||
"description": "EAS command line tool",
|
||||
"version": "0.55.1",
|
||||
"version": "0.54.1",
|
||||
"author": "Expo <[email protected]>",
|
||||
"bin": {
|
||||
"eas": "./bin/run"
|
||||
@@ -14,7 +14,7 @@
|
||||
"@expo/config-plugins": "4.1.4",
|
||||
"@expo/config-types": "45.0.0",
|
||||
"@expo/eas-build-job": "0.2.77",
|
||||
"@expo/eas-json": "0.55.0",
|
||||
"@expo/eas-json": "0.54.0",
|
||||
"@expo/json-file": "8.2.36",
|
||||
"@expo/multipart-body-parser": "1.1.0",
|
||||
"@expo/pkcs12": "0.0.8",
|
||||
@@ -103,7 +103,7 @@
|
||||
"nock": "13.2.4",
|
||||
"tempy": "0.7.0",
|
||||
"ts-deepmerge": "2.0.1",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "4.6.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
|
||||
@@ -33,152 +33,96 @@
|
||||
]
|
||||
},
|
||||
"AppleCategory": {
|
||||
"type": "array",
|
||||
"description": "App Store categories for the app, can add up to two categories. The first item in this list is the primary category, the second is the secondary and optional category. `STICKERS` and `GAMES` categories can add up to two additional subcategories, written as nested array.",
|
||||
"markdownDescription": "App Store categories for the app, can add up to two categories. The first item in this list is the primary category, the second is the secondary and optional category. `STICKERS` and `GAMES` categories can add up to two additional subcategories, written as nested array. E.g.\n\n- `[\"SPORTS\"]`\n- `[\"SPORTS\", \"LIFESTYLE\"]`\n- `[[\"GAMES\", \"GAMES_CARD\"], \"ENTERTAINMENT\"]`\n- `[\"GAMES\", \"WEATHER\"]`",
|
||||
"minItems": 1,
|
||||
"maxItems": 2,
|
||||
"uniqueItems": true,
|
||||
"enum": [
|
||||
"FOOD_AND_DRINK",
|
||||
"BUSINESS",
|
||||
"EDUCATION",
|
||||
"SOCIAL_NETWORKING",
|
||||
"BOOKS",
|
||||
"SPORTS",
|
||||
"FINANCE",
|
||||
"REFERENCE",
|
||||
"GRAPHICS_AND_DESIGN",
|
||||
"DEVELOPER_TOOLS",
|
||||
"HEALTH_AND_FITNESS",
|
||||
"MUSIC",
|
||||
"WEATHER",
|
||||
"TRAVEL",
|
||||
"ENTERTAINMENT",
|
||||
"STICKERS",
|
||||
"GAMES",
|
||||
"LIFESTYLE",
|
||||
"MEDICAL",
|
||||
"MAGAZINES_AND_NEWSPAPERS",
|
||||
"UTILITIES",
|
||||
"SHOPPING",
|
||||
"PRODUCTIVITY",
|
||||
"NEWS",
|
||||
"PHOTO_AND_VIDEO",
|
||||
"NAVIGATION"
|
||||
]
|
||||
},
|
||||
"AppleSubcategory": {
|
||||
"enum": [
|
||||
"STICKERS_PLACES_AND_OBJECTS",
|
||||
"STICKERS_EMOJI_AND_EXPRESSIONS",
|
||||
"STICKERS_CELEBRATIONS",
|
||||
"STICKERS_CELEBRITIES",
|
||||
"STICKERS_MOVIES_AND_TV",
|
||||
"STICKERS_SPORTS_AND_ACTIVITIES",
|
||||
"STICKERS_EATING_AND_DRINKING",
|
||||
"STICKERS_CHARACTERS",
|
||||
"STICKERS_ANIMALS",
|
||||
"STICKERS_FASHION",
|
||||
"STICKERS_ART",
|
||||
"STICKERS_GAMING",
|
||||
"STICKERS_KIDS_AND_FAMILY",
|
||||
"STICKERS_PEOPLE",
|
||||
"STICKERS_MUSIC",
|
||||
"GAMES_SPORTS",
|
||||
"GAMES_WORD",
|
||||
"GAMES_MUSIC",
|
||||
"GAMES_ADVENTURE",
|
||||
"GAMES_ACTION",
|
||||
"GAMES_ROLE_PLAYING",
|
||||
"GAMES_CASUAL",
|
||||
"GAMES_BOARD",
|
||||
"GAMES_TRIVIA",
|
||||
"GAMES_CARD",
|
||||
"GAMES_PUZZLE",
|
||||
"GAMES_CASINO",
|
||||
"GAMES_STRATEGY",
|
||||
"GAMES_SIMULATION",
|
||||
"GAMES_RACING",
|
||||
"GAMES_FAMILY"
|
||||
]
|
||||
},
|
||||
"AppleIdfa": {
|
||||
"description": "Identifier for Advertisers",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"defaultSnippets": [
|
||||
{
|
||||
"label": "Basic categories",
|
||||
"description": "Add two simple categories",
|
||||
"body": [
|
||||
"$1",
|
||||
"$2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Category with subcategories",
|
||||
"description": "Add a category containing subcategories",
|
||||
"body": [
|
||||
[
|
||||
"${1|GAMES,STICKERS|}",
|
||||
"$3",
|
||||
"$4"
|
||||
]
|
||||
]
|
||||
"body": {
|
||||
"servesAds": false,
|
||||
"attributesAppInstallationToPreviousAd": false,
|
||||
"attributesActionWithPreviousAd": false,
|
||||
"honorsLimitedAdTracking": false
|
||||
}
|
||||
}
|
||||
],
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory/categories/root"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory/categories/parent"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"description": "The GAMES category can have additional subcategories",
|
||||
"minItems": 1,
|
||||
"maxItems": 3,
|
||||
"uniqueItems": true,
|
||||
"items": [
|
||||
{
|
||||
"const": "GAMES"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory/categories/games"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory/categories/games"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"description": "The STICKERS category can have additional subcategories",
|
||||
"minItems": 1,
|
||||
"maxItems": 3,
|
||||
"uniqueItems": true,
|
||||
"items": [
|
||||
{
|
||||
"const": "STICKERS"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory/categories/stickers"
|
||||
},
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory/categories/stickers"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"categories": {
|
||||
"root": {
|
||||
"enum": [
|
||||
"BUSINESS",
|
||||
"SOCIAL_NETWORKING",
|
||||
"MEDICAL",
|
||||
"FOOD_AND_DRINK",
|
||||
"EDUCATION",
|
||||
"BOOKS",
|
||||
"SPORTS",
|
||||
"FINANCE",
|
||||
"REFERENCE",
|
||||
"GRAPHICS_AND_DESIGN",
|
||||
"DEVELOPER_TOOLS",
|
||||
"HEALTH_AND_FITNESS",
|
||||
"MUSIC",
|
||||
"WEATHER",
|
||||
"TRAVEL",
|
||||
"ENTERTAINMENT",
|
||||
"LIFESTYLE",
|
||||
"MAGAZINES_AND_NEWSPAPERS",
|
||||
"UTILITIES",
|
||||
"SHOPPING",
|
||||
"PRODUCTIVITY",
|
||||
"NEWS",
|
||||
"PHOTO_AND_VIDEO",
|
||||
"NAVIGATION"
|
||||
]
|
||||
"properties": {
|
||||
"servesAds": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"parent": {
|
||||
"enum": [
|
||||
"GAMES",
|
||||
"STICKERS"
|
||||
]
|
||||
"attributesAppInstallationToPreviousAd": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"games": {
|
||||
"enum": [
|
||||
"GAMES_SPORTS",
|
||||
"GAMES_WORD",
|
||||
"GAMES_MUSIC",
|
||||
"GAMES_ADVENTURE",
|
||||
"GAMES_ACTION",
|
||||
"GAMES_ROLE_PLAYING",
|
||||
"GAMES_CASUAL",
|
||||
"GAMES_BOARD",
|
||||
"GAMES_TRIVIA",
|
||||
"GAMES_CARD",
|
||||
"GAMES_PUZZLE",
|
||||
"GAMES_CASINO",
|
||||
"GAMES_STRATEGY",
|
||||
"GAMES_SIMULATION",
|
||||
"GAMES_RACING",
|
||||
"GAMES_FAMILY"
|
||||
]
|
||||
"attributesActionWithPreviousAd": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"stickers": {
|
||||
"enum": [
|
||||
"STICKERS_PLACES_AND_OBJECTS",
|
||||
"STICKERS_EMOJI_AND_EXPRESSIONS",
|
||||
"STICKERS_CELEBRATIONS",
|
||||
"STICKERS_CELEBRITIES",
|
||||
"STICKERS_MOVIES_AND_TV",
|
||||
"STICKERS_SPORTS_AND_ACTIVITIES",
|
||||
"STICKERS_EATING_AND_DRINKING",
|
||||
"STICKERS_CHARACTERS",
|
||||
"STICKERS_ANIMALS",
|
||||
"STICKERS_FASHION",
|
||||
"STICKERS_ART",
|
||||
"STICKERS_GAMING",
|
||||
"STICKERS_KIDS_AND_FAMILY",
|
||||
"STICKERS_PEOPLE",
|
||||
"STICKERS_MUSIC"
|
||||
]
|
||||
"honorsLimitedAdTracking": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -610,7 +554,79 @@
|
||||
"$ref": "#/definitions/apple/AppleAdvisory"
|
||||
},
|
||||
"categories": {
|
||||
"$ref": "#/definitions/apple/AppleCategory"
|
||||
"type": "array",
|
||||
"maxItems": 2,
|
||||
"description": "App Store categories for the app. Can add up to two categories. STICKERS and GAMES categories can add an additional subcategory.",
|
||||
"items": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/apple/AppleCategory"
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"maxItems": 2,
|
||||
"items": [
|
||||
{
|
||||
"enum": [
|
||||
"GAMES"
|
||||
]
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"GAMES_SPORTS",
|
||||
"GAMES_WORD",
|
||||
"GAMES_MUSIC",
|
||||
"GAMES_ADVENTURE",
|
||||
"GAMES_ACTION",
|
||||
"GAMES_ROLE_PLAYING",
|
||||
"GAMES_CASUAL",
|
||||
"GAMES_BOARD",
|
||||
"GAMES_TRIVIA",
|
||||
"GAMES_CARD",
|
||||
"GAMES_PUZZLE",
|
||||
"GAMES_CASINO",
|
||||
"GAMES_STRATEGY",
|
||||
"GAMES_SIMULATION",
|
||||
"GAMES_RACING",
|
||||
"GAMES_FAMILY"
|
||||
]
|
||||
}
|
||||
],
|
||||
"additionalItems": false
|
||||
},
|
||||
{
|
||||
"type": "array",
|
||||
"maxItems": 2,
|
||||
"items": [
|
||||
{
|
||||
"enum": [
|
||||
"STICKERS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"enum": [
|
||||
"STICKERS_PLACES_AND_OBJECTS",
|
||||
"STICKERS_EMOJI_AND_EXPRESSIONS",
|
||||
"STICKERS_CELEBRATIONS",
|
||||
"STICKERS_CELEBRITIES",
|
||||
"STICKERS_MOVIES_AND_TV",
|
||||
"STICKERS_SPORTS_AND_ACTIVITIES",
|
||||
"STICKERS_EATING_AND_DRINKING",
|
||||
"STICKERS_CHARACTERS",
|
||||
"STICKERS_ANIMALS",
|
||||
"STICKERS_FASHION",
|
||||
"STICKERS_ART",
|
||||
"STICKERS_GAMING",
|
||||
"STICKERS_KIDS_AND_FAMILY",
|
||||
"STICKERS_PEOPLE",
|
||||
"STICKERS_MUSIC"
|
||||
]
|
||||
}
|
||||
],
|
||||
"additionalItems": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"copyright": {
|
||||
"type": "string",
|
||||
@@ -626,6 +642,9 @@
|
||||
"storeInfo": "The name of the person or entity that owns the exclusive rights to your app, preceded by the year the rights were obtained (for example, \"2008 Acme Inc.\"). Do not provide a URL."
|
||||
}
|
||||
},
|
||||
"idfa": {
|
||||
"$ref": "#/definitions/apple/AppleIdfa"
|
||||
},
|
||||
"info": {
|
||||
"description": "Localized core app info",
|
||||
"type": "object",
|
||||
@@ -967,6 +986,10 @@
|
||||
"review": {
|
||||
"$ref": "#/definitions/apple/AppleReview",
|
||||
"description": "Info for the App Store reviewer"
|
||||
},
|
||||
"priceTier": {
|
||||
"type": "number",
|
||||
"description": "App price tier. 0 is Free."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { fixS3Url } from '../uploads';
|
||||
import { fixArchiveUrl } from '../uploads';
|
||||
|
||||
describe(fixS3Url, () => {
|
||||
describe(fixArchiveUrl, () => {
|
||||
it('fixes broken links', () => {
|
||||
const input =
|
||||
'https://submission-service-archives.s3.amazonaws.com/production%2Fdc98ca84-1473-4cb3-ae81-8c7b291cb27e%2F4424aa95-b985-4e2f-8755-9507b1037c1c';
|
||||
const expectedOutput =
|
||||
'https://submission-service-archives.s3.amazonaws.com/production/dc98ca84-1473-4cb3-ae81-8c7b291cb27e/4424aa95-b985-4e2f-8755-9507b1037c1c';
|
||||
expect(fixS3Url(input)).toBe(expectedOutput);
|
||||
expect(fixArchiveUrl(input)).toBe(expectedOutput);
|
||||
});
|
||||
|
||||
it('does not change correct urls', () => {
|
||||
const correctUrl =
|
||||
'https://submission-service-archives.s3.amazonaws.com/production/dc98ca84-1473-4cb3-ae81-8c7b291cb27e/4424aa95-b985-4e2f-8755-9507b1037c1c';
|
||||
expect(fixS3Url(correctUrl)).toBe(correctUrl);
|
||||
expect(fixArchiveUrl(correctUrl)).toBe(correctUrl);
|
||||
});
|
||||
});
|
||||
@@ -17,23 +17,24 @@ import { getExpoConfig } from '../../project/expoConfig';
|
||||
import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUtils';
|
||||
import { UPDATE_COLUMNS, formatUpdate, getPlatformsForGroup } from '../../update/utils';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
|
||||
const BRANCHES_LIMIT = 10_000;
|
||||
export const BRANCHES_LIMIT = 50;
|
||||
|
||||
export async function listBranchesAsync({
|
||||
projectId,
|
||||
}: {
|
||||
projectId: string;
|
||||
}): Promise<UpdateBranchFragment[]> {
|
||||
appId,
|
||||
limit = BRANCHES_LIMIT,
|
||||
offset = 0,
|
||||
}: BranchesByAppQueryVariables): Promise<UpdateBranchFragment[]> {
|
||||
const data = await withErrorHandlingAsync(
|
||||
graphqlClient
|
||||
.query<BranchesByAppQuery, BranchesByAppQueryVariables>(
|
||||
gql`
|
||||
query BranchesByAppQuery($appId: String!, $limit: Int!) {
|
||||
query BranchesByAppQuery($appId: String!, $limit: Int!, $offset: Int!) {
|
||||
app {
|
||||
byId(appId: $appId) {
|
||||
id
|
||||
updateBranches(offset: 0, limit: $limit) {
|
||||
updateBranches(offset: $offset, limit: $limit) {
|
||||
id
|
||||
...UpdateBranchFragment
|
||||
}
|
||||
@@ -43,8 +44,9 @@ export async function listBranchesAsync({
|
||||
${print(UpdateBranchFragmentNode)}
|
||||
`,
|
||||
{
|
||||
appId: projectId,
|
||||
limit: BRANCHES_LIMIT,
|
||||
appId,
|
||||
limit,
|
||||
offset,
|
||||
},
|
||||
{ additionalTypenames: ['UpdateBranch'] }
|
||||
)
|
||||
@@ -73,9 +75,28 @@ export default class BranchList extends EasCommand {
|
||||
const projectDir = await findProjectRootAsync();
|
||||
const exp = getExpoConfig(projectDir);
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
const branches = await listBranchesAsync({ projectId });
|
||||
await queryForPaginatedBranchesAsync(projectId, flags);
|
||||
}
|
||||
}
|
||||
|
||||
async function queryForPaginatedBranchesAsync(
|
||||
projectId: string,
|
||||
flags: { json: boolean } & { json: boolean | undefined }
|
||||
): Promise<void> {
|
||||
const queryAdditionalBranchesAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<UpdateBranchFragment>> => {
|
||||
const branches = await listBranchesAsync({ appId: projectId, limit: pageSize, offset });
|
||||
return {
|
||||
queryResponse: branches,
|
||||
queryResponseRawLength: branches.length,
|
||||
};
|
||||
};
|
||||
|
||||
const renderPageOfBranches = (currentPage: UpdateBranchFragment[]): void => {
|
||||
if (flags.json) {
|
||||
printJsonOnlyOutput(branches);
|
||||
printJsonOnlyOutput(currentPage);
|
||||
} else {
|
||||
const table = new CliTable({
|
||||
head: ['Branch', ...UPDATE_COLUMNS],
|
||||
@@ -83,7 +104,7 @@ export default class BranchList extends EasCommand {
|
||||
});
|
||||
|
||||
table.push(
|
||||
...branches.map(branch => [
|
||||
...currentPage.map(branch => [
|
||||
branch.name,
|
||||
formatUpdate(branch.updates[0]),
|
||||
branch.updates[0]?.runtimeVersion ?? 'N/A',
|
||||
@@ -96,11 +117,20 @@ export default class BranchList extends EasCommand {
|
||||
);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Branches with their most recent update group:'));
|
||||
Log.log(chalk.bold('Branches:'));
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(table.toString());
|
||||
if (branches.length >= BRANCHES_LIMIT) {
|
||||
Log.warn(`Showing first ${BRANCHES_LIMIT} branches, some results might be omitted.`);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryAdditionalBranchesAsync,
|
||||
promptOptions: {
|
||||
type: 'confirm',
|
||||
title: 'Fetch next page of branches?',
|
||||
renderListItems: renderPageOfBranches,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import chalk from 'chalk';
|
||||
import Table from 'cli-table3';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { ViewBranchUpdatesQuery } from '../../graphql/generated';
|
||||
import { UpdateQuery } from '../../graphql/queries/UpdateQuery';
|
||||
import Log from '../../log';
|
||||
import { getExpoConfig } from '../../project/expoConfig';
|
||||
@@ -12,6 +13,7 @@ import { UPDATE_COLUMNS, formatUpdate, getPlatformsForGroup } from '../../update
|
||||
import groupBy from '../../utils/expodash/groupBy';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
|
||||
export default class BranchView extends EasCommand {
|
||||
static description = 'view a branch';
|
||||
@@ -57,50 +59,97 @@ export default class BranchView extends EasCommand {
|
||||
}));
|
||||
}
|
||||
|
||||
await queryForPaginatedBranchesAsync(projectId, name, { json: jsonFlag });
|
||||
}
|
||||
}
|
||||
|
||||
type BranchUpdateObject = Exclude<
|
||||
ViewBranchUpdatesQuery['app']['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'][0];
|
||||
|
||||
async function queryForPaginatedBranchesAsync(
|
||||
projectId: string,
|
||||
name: string,
|
||||
flags: { json: boolean } & { json: boolean | undefined }
|
||||
): Promise<void> {
|
||||
const queryAdditionalBranchesAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<BranchUpdateObject>> => {
|
||||
const { app } = await UpdateQuery.viewBranchAsync({
|
||||
appId: projectId,
|
||||
name,
|
||||
limit: pageSize,
|
||||
offset,
|
||||
});
|
||||
const UpdateBranch = app?.byId.updateBranchByName;
|
||||
if (!UpdateBranch) {
|
||||
throw new Error(`Could not find branch "${name}"`);
|
||||
}
|
||||
|
||||
const updates = Object.values(groupBy(UpdateBranch.updates, u => u.group)).map(
|
||||
group => group[0]
|
||||
const updateGroups = Object.values(groupBy(UpdateBranch.updates, u => u.group)).map(
|
||||
updateGroup => ({
|
||||
...updateGroup[0],
|
||||
platform: getPlatformsForGroup({
|
||||
updates: updateGroup,
|
||||
group: updateGroup[0].group,
|
||||
}),
|
||||
})
|
||||
);
|
||||
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput({ ...UpdateBranch, updates });
|
||||
return {
|
||||
queryResponse: updateGroups,
|
||||
queryResponseRawLength: UpdateBranch.updates.length,
|
||||
};
|
||||
};
|
||||
|
||||
const renderPageOfBranches = (currentPage: BranchUpdateObject[]): void => {
|
||||
if (flags.json) {
|
||||
printJsonOnlyOutput(currentPage);
|
||||
} else {
|
||||
const groupTable = new Table({
|
||||
head: UPDATE_COLUMNS,
|
||||
wordWrap: true,
|
||||
});
|
||||
if (flags.json) {
|
||||
printJsonOnlyOutput({ currentPage });
|
||||
} else {
|
||||
const groupTable = new Table({
|
||||
head: UPDATE_COLUMNS,
|
||||
wordWrap: true,
|
||||
});
|
||||
|
||||
for (const update of updates) {
|
||||
groupTable.push([
|
||||
formatUpdate(update),
|
||||
update.runtimeVersion,
|
||||
update.group,
|
||||
getPlatformsForGroup({
|
||||
updates: UpdateBranch.updates,
|
||||
group: update.group,
|
||||
}),
|
||||
]);
|
||||
for (const update of currentPage) {
|
||||
groupTable.push([
|
||||
formatUpdate(update),
|
||||
update.runtimeVersion,
|
||||
update.group,
|
||||
getPlatformsForGroup({
|
||||
updates: currentPage,
|
||||
group: update.group,
|
||||
}),
|
||||
]);
|
||||
}
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Branch:'));
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'Name', value: currentPage[0]['branch']['name'] },
|
||||
{ label: 'ID', value: currentPage[0]['branch']['id'] },
|
||||
])
|
||||
);
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(groupTable.toString());
|
||||
}
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Branch:'));
|
||||
Log.log(
|
||||
formatFields([
|
||||
{ label: 'Name', value: UpdateBranch.name },
|
||||
{ label: 'ID', value: UpdateBranch.id },
|
||||
])
|
||||
);
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Recently published update groups:'));
|
||||
Log.log(groupTable.toString());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryAdditionalBranchesAsync,
|
||||
promptOptions: {
|
||||
type: 'confirm',
|
||||
title: 'Fetch next page of branches?',
|
||||
renderListItems: renderPageOfBranches,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { graphqlClient, withErrorHandlingAsync } from '../../graphql/client';
|
||||
import {
|
||||
Build,
|
||||
BuildFragment,
|
||||
BuildStatus,
|
||||
CancelBuildMutation,
|
||||
CancelBuildMutationVariables,
|
||||
@@ -19,7 +20,8 @@ import {
|
||||
getProjectFullNameAsync,
|
||||
getProjectIdAsync,
|
||||
} from '../../project/projectUtils';
|
||||
import { confirmAsync, selectAsync } from '../../prompts';
|
||||
import { confirmAsync } from '../../prompts';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
|
||||
async function cancelBuildAsync(buildId: string): Promise<Pick<Build, 'id' | 'status'>> {
|
||||
const data = await withErrorHandlingAsync(
|
||||
@@ -59,48 +61,6 @@ function formatUnfinishedBuild(
|
||||
return `${platform} Started at: ${startTime}, Status: ${status}, Id: ${build.id}`;
|
||||
}
|
||||
|
||||
async function selectBuildToCancelAsync(
|
||||
projectId: string,
|
||||
projectFullName: string
|
||||
): Promise<string | null> {
|
||||
const spinner = ora().start('Fetching the uncompleted builds…');
|
||||
let builds;
|
||||
try {
|
||||
const [newBuilds, inQueueBuilds, inProgressBuilds] = await Promise.all([
|
||||
BuildQuery.allForAppAsync(projectId, { filter: { status: BuildStatus.New } }),
|
||||
BuildQuery.allForAppAsync(projectId, { filter: { status: BuildStatus.InQueue } }),
|
||||
BuildQuery.allForAppAsync(projectId, { filter: { status: BuildStatus.InProgress } }),
|
||||
]);
|
||||
spinner.stop();
|
||||
builds = [...newBuilds, ...inQueueBuilds, ...inProgressBuilds];
|
||||
} catch (error) {
|
||||
spinner.fail(
|
||||
`Something went wrong and we couldn't fetch the builds for the project ${projectFullName}.`
|
||||
);
|
||||
throw error;
|
||||
}
|
||||
if (builds.length === 0) {
|
||||
Log.warn(`There aren't any uncompleted builds for the project ${projectFullName}.`);
|
||||
return null;
|
||||
} else if (builds.length === 1) {
|
||||
Log.log('Found one build');
|
||||
Log.log(formatUnfinishedBuild(builds[0]));
|
||||
await confirmAsync({
|
||||
message: 'Do you want to cancel it?',
|
||||
});
|
||||
return builds[0].id;
|
||||
} else {
|
||||
const buildId = await selectAsync<string>(
|
||||
'Which build do you want to cancel?',
|
||||
builds.map(build => ({
|
||||
title: formatUnfinishedBuild(build),
|
||||
value: build.id,
|
||||
}))
|
||||
);
|
||||
return buildId;
|
||||
}
|
||||
}
|
||||
|
||||
async function ensureBuildExistsAsync(buildId: string): Promise<void> {
|
||||
try {
|
||||
await BuildQuery.byIdAsync(buildId);
|
||||
@@ -126,7 +86,8 @@ export default class BuildCancel extends EasCommand {
|
||||
await ensureBuildExistsAsync(buildIdFromArg);
|
||||
}
|
||||
|
||||
const buildId = buildIdFromArg || (await selectBuildToCancelAsync(projectId, projectFullName));
|
||||
const buildId =
|
||||
buildIdFromArg || (await queryForBuildToCancelAsync(projectId, projectFullName));
|
||||
if (!buildId) {
|
||||
return;
|
||||
}
|
||||
@@ -146,3 +107,69 @@ export default class BuildCancel extends EasCommand {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function queryForBuildToCancelAsync(
|
||||
projectId: string,
|
||||
projectFullName: string
|
||||
): Promise<string | null> {
|
||||
const queryToPerformAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<BuildFragment>> => {
|
||||
const [newBuilds, inQueueBuilds, inProgressBuilds] = await Promise.all([
|
||||
BuildQuery.allForAppAsync(projectId, {
|
||||
limit: pageSize,
|
||||
offset,
|
||||
filter: { status: BuildStatus.New },
|
||||
}),
|
||||
BuildQuery.allForAppAsync(projectId, {
|
||||
limit: pageSize,
|
||||
offset,
|
||||
filter: { status: BuildStatus.InQueue },
|
||||
}),
|
||||
BuildQuery.allForAppAsync(projectId, {
|
||||
limit: pageSize,
|
||||
offset,
|
||||
filter: { status: BuildStatus.InProgress },
|
||||
}),
|
||||
]);
|
||||
|
||||
// this variable controls whether performPaginatedQueryAsync will query the next page.
|
||||
// force another query if we have hit the query limit for any of these 3 queries.
|
||||
const queryResponseLength =
|
||||
newBuilds.length < pageSize &&
|
||||
inQueueBuilds.length < pageSize &&
|
||||
inProgressBuilds.length < pageSize
|
||||
? pageSize - 1
|
||||
: pageSize;
|
||||
|
||||
return {
|
||||
queryResponse: [...newBuilds, ...inQueueBuilds, ...inProgressBuilds],
|
||||
queryResponseRawLength: queryResponseLength,
|
||||
};
|
||||
};
|
||||
const getIdentifierForQueryItem = (buildFragment: BuildFragment): string => buildFragment.id;
|
||||
const selectedBuild = (
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryToPerformAsync,
|
||||
promptOptions: {
|
||||
type: 'select',
|
||||
title: 'Which build would you like to cancel?',
|
||||
getIdentifierForQueryItem,
|
||||
createDisplayTextForSelectionPromptListItem: formatUnfinishedBuild,
|
||||
},
|
||||
})
|
||||
).pop();
|
||||
|
||||
if (!selectedBuild) {
|
||||
Log.warn(`There aren't any uncompleted builds for the project ${projectFullName}.`);
|
||||
return null;
|
||||
}
|
||||
|
||||
const userConfirmedCancellation = await confirmAsync({
|
||||
message: `Are you sure you want to cancel ${formatUnfinishedBuild(selectedBuild)}?`,
|
||||
});
|
||||
return userConfirmedCancellation ? selectedBuild.id : null;
|
||||
}
|
||||
@@ -6,12 +6,12 @@ import { formatGraphQLBuild } from '../../build/utils/formatBuild';
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import {
|
||||
AppPlatform,
|
||||
BuildFragment,
|
||||
DistributionType,
|
||||
BuildStatus as GraphQLBuildStatus,
|
||||
} from '../../graphql/generated';
|
||||
import { BuildQuery } from '../../graphql/queries/BuildQuery';
|
||||
import { BuildQuery, BuildsQuery } from '../../graphql/queries/BuildQuery';
|
||||
import Log from '../../log';
|
||||
import { ora } from '../../ora';
|
||||
import { RequestedPlatform } from '../../platform';
|
||||
import { getExpoConfig } from '../../project/expoConfig';
|
||||
import {
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
getProjectIdAsync,
|
||||
} from '../../project/projectUtils';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
|
||||
export default class BuildList extends EasCommand {
|
||||
static description = 'list all builds for your project';
|
||||
@@ -56,7 +57,6 @@ export default class BuildList extends EasCommand {
|
||||
appIdentifier: Flags.string(),
|
||||
buildProfile: Flags.string(),
|
||||
gitCommitHash: Flags.string(),
|
||||
limit: Flags.integer(),
|
||||
};
|
||||
|
||||
async runAsync(): Promise<void> {
|
||||
@@ -66,7 +66,6 @@ export default class BuildList extends EasCommand {
|
||||
platform: requestedPlatform,
|
||||
status: buildStatus,
|
||||
distribution: buildDistribution,
|
||||
limit = 10,
|
||||
} = flags;
|
||||
if (json) {
|
||||
enableJsonOutput();
|
||||
@@ -81,51 +80,24 @@ export default class BuildList extends EasCommand {
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
const projectName = await getProjectFullNameAsync(exp);
|
||||
|
||||
const spinner = ora().start('Fetching the build list for the project…');
|
||||
|
||||
try {
|
||||
const builds = await BuildQuery.allForAppAsync(projectId, {
|
||||
limit,
|
||||
filter: {
|
||||
platform,
|
||||
status: graphqlBuildStatus,
|
||||
distribution: graphqlBuildDistribution,
|
||||
channel: flags.channel,
|
||||
appVersion: flags.appVersion,
|
||||
appBuildVersion: flags.appBuildVersion,
|
||||
sdkVersion: flags.sdkVersion,
|
||||
runtimeVersion: flags.runtimeVersion,
|
||||
appIdentifier: flags.appIdentifier,
|
||||
buildProfile: flags.buildProfile,
|
||||
gitCommitHash: flags.gitCommitHash,
|
||||
},
|
||||
});
|
||||
|
||||
if (builds.length) {
|
||||
if (platform || graphqlBuildStatus) {
|
||||
spinner.succeed(
|
||||
`Showing ${builds.length} matching builds for the project ${projectName}`
|
||||
);
|
||||
} else {
|
||||
spinner.succeed(`Showing last ${builds.length} builds for the project ${projectName}`);
|
||||
}
|
||||
|
||||
if (json) {
|
||||
printJsonOnlyOutput(builds);
|
||||
} else {
|
||||
const list = builds
|
||||
.map(build => formatGraphQLBuild(build))
|
||||
.join(`\n\n${chalk.dim('———')}\n\n`);
|
||||
|
||||
Log.log(`\n${list}`);
|
||||
}
|
||||
} else {
|
||||
spinner.fail(`Couldn't find any builds for the project ${projectName}`);
|
||||
}
|
||||
} catch (e) {
|
||||
spinner.fail(`Something went wrong and we couldn't fetch the build list ${projectName}`);
|
||||
throw e;
|
||||
}
|
||||
await queryForPaginatedBuildsAsync(
|
||||
projectId,
|
||||
projectName,
|
||||
{
|
||||
platform,
|
||||
status: graphqlBuildStatus,
|
||||
distribution: graphqlBuildDistribution,
|
||||
channel: flags.channel,
|
||||
appVersion: flags.appVersion,
|
||||
appBuildVersion: flags.appBuildVersion,
|
||||
sdkVersion: flags.sdkVersion,
|
||||
runtimeVersion: flags.runtimeVersion,
|
||||
appIdentifier: flags.appIdentifier,
|
||||
buildProfile: flags.buildProfile,
|
||||
gitCommitHash: flags.gitCommitHash,
|
||||
},
|
||||
flags
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,3 +142,57 @@ const toGraphQLBuildDistribution = (
|
||||
return undefined;
|
||||
}
|
||||
};
|
||||
|
||||
async function queryForPaginatedBuildsAsync(
|
||||
projectId: string,
|
||||
projectName: string,
|
||||
filter: BuildsQuery['filter'],
|
||||
flags: { json: boolean } & { json: boolean | undefined }
|
||||
): Promise<void> {
|
||||
const queryAdditionalBuildsAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<BuildFragment>> => {
|
||||
const builds = await BuildQuery.allForAppAsync(projectId, {
|
||||
limit: pageSize,
|
||||
offset,
|
||||
filter,
|
||||
});
|
||||
|
||||
return {
|
||||
queryResponse: builds,
|
||||
queryResponseRawLength: builds.length,
|
||||
};
|
||||
};
|
||||
|
||||
const renderPageOfBuilds = (currentPage: BuildFragment[]): void => {
|
||||
if (flags.json) {
|
||||
printJsonOnlyOutput(currentPage);
|
||||
} else {
|
||||
if (currentPage.length) {
|
||||
const list = currentPage
|
||||
.map(build => formatGraphQLBuild(build))
|
||||
.join(`\n\n${chalk.dim('———')}\n\n`);
|
||||
|
||||
Log.addNewLineIfNone();
|
||||
Log.withTick(chalk.bold(`Builds for ${projectName}:`));
|
||||
Log.log(`\n${list}`);
|
||||
Log.addNewLineIfNone();
|
||||
} else {
|
||||
Log.withCross(chalk.bold(`Couldn't find any builds for the project ${projectName}`));
|
||||
Log.addNewLineIfNone();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryAdditionalBuildsAsync,
|
||||
promptOptions: {
|
||||
type: 'confirm',
|
||||
title: 'Fetch next page of builds?',
|
||||
renderListItems: renderPageOfBuilds,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Flags } from '@oclif/core';
|
||||
import chalk from 'chalk';
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
@@ -12,31 +13,41 @@ import { getExpoConfig } from '../../project/expoConfig';
|
||||
import { findProjectRootAsync, getProjectIdAsync } from '../../project/projectUtils';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
import { BRANCHES_LIMIT } from '../branch/list';
|
||||
import { logChannelDetails } from './view';
|
||||
|
||||
const CHANNEL_LIMIT = 10_000;
|
||||
const CHANNEL_LIMIT = 50;
|
||||
|
||||
async function getAllUpdateChannelForAppAsync({
|
||||
appId,
|
||||
}: {
|
||||
appId: string;
|
||||
}): Promise<GetAllChannelsForAppQuery> {
|
||||
channelLimit = CHANNEL_LIMIT,
|
||||
channelOffset = 0,
|
||||
branchLimit = BRANCHES_LIMIT,
|
||||
branchOffset = 0,
|
||||
}: GetAllChannelsForAppQueryVariables): Promise<GetAllChannelsForAppQuery> {
|
||||
return await withErrorHandlingAsync(
|
||||
graphqlClient
|
||||
.query<GetAllChannelsForAppQuery, GetAllChannelsForAppQueryVariables>(
|
||||
gql`
|
||||
query GetAllChannelsForApp($appId: String!, $offset: Int!, $limit: Int!) {
|
||||
query GetAllChannelsForApp(
|
||||
$appId: String!
|
||||
$channelOffset: Int!
|
||||
$channelLimit: Int!
|
||||
$branchLimit: Int!
|
||||
$branchOffset: Int!
|
||||
) {
|
||||
app {
|
||||
byId(appId: $appId) {
|
||||
id
|
||||
updateChannels(offset: $offset, limit: $limit) {
|
||||
updateChannels(offset: $channelOffset, limit: $channelLimit) {
|
||||
id
|
||||
name
|
||||
branchMapping
|
||||
updateBranches(offset: 0, limit: $limit) {
|
||||
updateBranches(offset: $branchOffset, limit: $branchLimit) {
|
||||
id
|
||||
name
|
||||
updates(offset: 0, limit: 10) {
|
||||
updates(offset: 0, limit: 1) {
|
||||
id
|
||||
group
|
||||
message
|
||||
@@ -59,7 +70,7 @@ async function getAllUpdateChannelForAppAsync({
|
||||
}
|
||||
}
|
||||
`,
|
||||
{ appId, offset: 0, limit: CHANNEL_LIMIT },
|
||||
{ appId, channelOffset, channelLimit, branchLimit, branchOffset },
|
||||
{ additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] }
|
||||
)
|
||||
.toPromise()
|
||||
@@ -88,18 +99,77 @@ export default class ChannelList extends EasCommand {
|
||||
const exp = getExpoConfig(projectDir);
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
|
||||
const getAllUpdateChannelForAppResult = await getAllUpdateChannelForAppAsync({
|
||||
appId: projectId,
|
||||
});
|
||||
const channels = getAllUpdateChannelForAppResult.app?.byId.updateChannels;
|
||||
if (!channels) {
|
||||
throw new Error(`Could not find channels on project with id ${projectId}`);
|
||||
}
|
||||
await queryForChannelsAsync(projectId, jsonFlag);
|
||||
}
|
||||
}
|
||||
|
||||
type UpdateChannelObject = GetAllChannelsForAppQuery['app']['byId']['updateChannels'][0];
|
||||
|
||||
async function queryForChannelsAsync(projectId: string, jsonFlag: boolean): Promise<void> {
|
||||
const queryToPerformAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<UpdateChannelObject>> => {
|
||||
let queriedAllBranches = false;
|
||||
let branchOffset = 0;
|
||||
const branchLimit = 10;
|
||||
const paginatedQuery: PaginatedQueryResponse<UpdateChannelObject> = {
|
||||
queryResponse: [],
|
||||
queryResponseRawLength: 0,
|
||||
};
|
||||
const branchesForChannels: Record<string, UpdateChannelObject['updateBranches']> = {};
|
||||
|
||||
// we need to paginate our paginated query. Each channel (N) can have M branches
|
||||
// and we need to fetch all branches to populate our 'branch mapping' portion
|
||||
// of the UI properly.
|
||||
do {
|
||||
const getAllUpdateChannelForAppResult = await getAllUpdateChannelForAppAsync({
|
||||
appId: projectId,
|
||||
channelLimit: pageSize,
|
||||
channelOffset: offset,
|
||||
branchLimit,
|
||||
branchOffset,
|
||||
});
|
||||
const channels = getAllUpdateChannelForAppResult.app?.byId.updateChannels;
|
||||
if (!channels) {
|
||||
throw new Error(`Could not find channels on project with id ${projectId}`);
|
||||
}
|
||||
queriedAllBranches = true;
|
||||
// save each array of branches using a record so we can lookup in O(1) later on
|
||||
channels.forEach(channel => {
|
||||
if (channel.updateBranches.length === branchLimit) {
|
||||
queriedAllBranches = false;
|
||||
}
|
||||
|
||||
branchesForChannels[channel.id] = [
|
||||
...(branchesForChannels[channel.id] ? branchesForChannels[channel.id] : []),
|
||||
...channel.updateBranches,
|
||||
];
|
||||
});
|
||||
|
||||
if (!paginatedQuery.queryResponse.length) {
|
||||
paginatedQuery.queryResponse = channels;
|
||||
} else {
|
||||
paginatedQuery.queryResponse.forEach(channel => {
|
||||
channel.updateBranches = branchesForChannels[channel.id];
|
||||
});
|
||||
}
|
||||
|
||||
paginatedQuery.queryResponseRawLength = channels.length;
|
||||
branchOffset += branchLimit + 1;
|
||||
} while (!queriedAllBranches);
|
||||
|
||||
return paginatedQuery;
|
||||
};
|
||||
|
||||
const renderListItems = (currentPage: UpdateChannelObject[]): void => {
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput(channels);
|
||||
printJsonOnlyOutput(currentPage);
|
||||
} else {
|
||||
for (const channel of channels) {
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(chalk.bold('Channels:'));
|
||||
Log.addNewLineIfNone();
|
||||
for (const channel of currentPage) {
|
||||
Log.addNewLineIfNone();
|
||||
Log.log(
|
||||
formatFields([
|
||||
@@ -110,5 +180,16 @@ export default class ChannelList extends EasCommand {
|
||||
logChannelDetails(channel);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 25, // lower, because we need to query all branches per channel O(N*M)
|
||||
offset: 0,
|
||||
queryToPerform: queryToPerformAsync,
|
||||
promptOptions: {
|
||||
type: 'confirm',
|
||||
title: 'Fetch next page of channels?',
|
||||
renderListItems,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -351,6 +351,8 @@ export default class ChannelRollout extends EasCommand {
|
||||
const channel = await ChannelQuery.getUpdateChannelByNameForAppAsync({
|
||||
appId: projectId,
|
||||
channelName: channelName!,
|
||||
offset: 0,
|
||||
limit: 50,
|
||||
});
|
||||
if (!channel) {
|
||||
throw new Error(
|
||||
|
||||
@@ -111,7 +111,7 @@ export function logChannelDetails(channel: {
|
||||
}
|
||||
|
||||
const { branchId } = branchMapping.data[index];
|
||||
const branch = channel.updateBranches.filter(branch => branch.id === branchId)[0];
|
||||
const branch = channel.updateBranches.find(branch => branch.id === branchId);
|
||||
if (!branch) {
|
||||
throw new Error('Branch mapping is pointing at a missing branch.');
|
||||
}
|
||||
@@ -184,6 +184,8 @@ export default class ChannelView extends EasCommand {
|
||||
const channel = await ChannelQuery.getUpdateChannelByNameForAppAsync({
|
||||
appId: projectId,
|
||||
channelName,
|
||||
offset: 0,
|
||||
limit: 50,
|
||||
});
|
||||
if (!channel) {
|
||||
throw new Error(`Could not find a channel with name: ${channelName}`);
|
||||
|
||||
@@ -19,6 +19,7 @@ import {
|
||||
Robot,
|
||||
RootQueryUpdatesByGroupArgs,
|
||||
Update,
|
||||
UpdateBranchFragment,
|
||||
UpdateInfoGroup,
|
||||
UpdatePublishMutation,
|
||||
User,
|
||||
@@ -44,7 +45,7 @@ import {
|
||||
uploadAssetsAsync,
|
||||
} from '../../project/publish';
|
||||
import { resolveWorkflowAsync } from '../../project/workflow';
|
||||
import { confirmAsync, promptAsync, selectAsync } from '../../prompts';
|
||||
import { confirmAsync, promptAsync } from '../../prompts';
|
||||
import { formatUpdate } from '../../update/utils';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
import {
|
||||
@@ -53,9 +54,9 @@ import {
|
||||
getManifestBodyAsync,
|
||||
signManifestBody,
|
||||
} from '../../utils/code-signing';
|
||||
import uniqBy from '../../utils/expodash/uniqBy';
|
||||
import formatFields from '../../utils/formatFields';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
import { getVcsClient } from '../../vcs';
|
||||
import { createUpdateBranchOnAppAsync } from '../branch/create';
|
||||
import { listBranchesAsync } from '../branch/list';
|
||||
@@ -128,8 +129,8 @@ export async function ensureBranchExistsAsync({
|
||||
}: {
|
||||
appId: string;
|
||||
name: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
limit: number;
|
||||
offset: number;
|
||||
}): Promise<{
|
||||
id: string;
|
||||
updates: Exclude<
|
||||
@@ -282,40 +283,16 @@ export default class UpdatePublish extends EasCommand {
|
||||
}
|
||||
|
||||
if (!branchName) {
|
||||
const validationMessage = 'Branch name may not be empty.';
|
||||
if (nonInteractive) {
|
||||
throw new Error('Must supply --branch or use --auto when in non-interactive mode');
|
||||
}
|
||||
|
||||
const validationMessage = 'Branch name may not be empty.';
|
||||
if (jsonFlag) {
|
||||
throw new Error(validationMessage);
|
||||
}
|
||||
|
||||
const branches = await listBranchesAsync({ projectId });
|
||||
if (branches.length === 0) {
|
||||
({ name: branchName } = await promptAsync({
|
||||
type: 'text',
|
||||
name: 'name',
|
||||
message: 'No branches found. Creating a new one. Please name the new branch:',
|
||||
initial:
|
||||
(await getVcsClient().getBranchNameAsync()) ||
|
||||
`branch-${Math.random().toString(36).substr(2, 4)}`,
|
||||
validate: value => (value ? true : validationMessage),
|
||||
}));
|
||||
} else {
|
||||
branchName = await selectAsync<string>(
|
||||
'Which branch would you like to publish on?',
|
||||
branches.map(branch => {
|
||||
return {
|
||||
title: `${branch.name} ${chalk.grey(
|
||||
`- current update: ${formatUpdate(branch.updates[0])}`
|
||||
)}`,
|
||||
value: branch.name,
|
||||
};
|
||||
})
|
||||
);
|
||||
}
|
||||
assert(branchName, 'Branch name must be specified.');
|
||||
branchName = await getBranchNameToPublishOnAsync(projectId, validationMessage);
|
||||
}
|
||||
|
||||
let unsortedUpdateInfoGroups: UpdateInfoGroup = {};
|
||||
@@ -341,12 +318,7 @@ export default class UpdatePublish extends EasCommand {
|
||||
throw new Error('You must specify the update group to republish.');
|
||||
}
|
||||
|
||||
updatesToRepublish = await getUpdatesToRepublishInteractiveAsync(
|
||||
projectId,
|
||||
branchName,
|
||||
platformFlag,
|
||||
50
|
||||
);
|
||||
updatesToRepublish = await getUpdatesToRepublishAsync(projectId, branchName, platformFlag);
|
||||
}
|
||||
const updatesToRepublishFilteredByPlatform = updatesToRepublish.filter(
|
||||
// Only republish to the specified platforms
|
||||
@@ -411,7 +383,6 @@ export default class UpdatePublish extends EasCommand {
|
||||
if (nonInteractive) {
|
||||
throw new Error('Must supply --message or use --auto when in non-interactive mode');
|
||||
}
|
||||
|
||||
const validationMessage = 'publish message may not be empty.';
|
||||
if (jsonFlag) {
|
||||
throw new Error(validationMessage);
|
||||
@@ -443,11 +414,7 @@ export default class UpdatePublish extends EasCommand {
|
||||
const assets = await collectAssetsAsync({ inputDir: inputDir!, platforms });
|
||||
const { uniqueUploadedAssetCount } = await uploadAssetsAsync(
|
||||
assets,
|
||||
(totalAssets, missingAssets) => {
|
||||
assetSpinner.text = `Uploading assets. Finished (${
|
||||
totalAssets - missingAssets
|
||||
}/${totalAssets})`;
|
||||
}
|
||||
spinnerText => (assetSpinner.text = `Uploading assets... ${spinnerText}`)
|
||||
);
|
||||
uploadedAssetCount = uniqueUploadedAssetCount;
|
||||
unsortedUpdateInfoGroups = await buildUnsortedUpdateInfoGroupAsync(assets, exp);
|
||||
@@ -474,6 +441,7 @@ export default class UpdatePublish extends EasCommand {
|
||||
appId: projectId,
|
||||
name: branchName,
|
||||
limit: 0,
|
||||
offset: 0,
|
||||
});
|
||||
|
||||
// Sort the updates into different groups based on their platform specific runtime versions
|
||||
@@ -603,71 +571,52 @@ export default class UpdatePublish extends EasCommand {
|
||||
}
|
||||
}
|
||||
|
||||
export async function getUpdatesToRepublishInteractiveAsync(
|
||||
export async function getUpdatesToRepublishAsync(
|
||||
projectId: string,
|
||||
branchName: string,
|
||||
platformFlag: string,
|
||||
pageSize: number,
|
||||
offset: number = 0,
|
||||
cumulativeUpdates: Exclude<
|
||||
Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'] = []
|
||||
): Promise<
|
||||
Exclude<
|
||||
Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates']
|
||||
> {
|
||||
const fetchMoreValue = '_fetchMore';
|
||||
platformFlag: string
|
||||
): Promise<AppUpdateObject[]> {
|
||||
const queryUpdatesForBranchAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<AppUpdateObject>> => {
|
||||
const { updates } = await ensureBranchExistsAsync({
|
||||
appId: projectId,
|
||||
name: branchName!,
|
||||
limit: pageSize,
|
||||
offset,
|
||||
});
|
||||
if (!updates.length) {
|
||||
throw new Error(
|
||||
`There are no updates on branch "${branchName}" published for the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`
|
||||
);
|
||||
}
|
||||
const relevantUpdates =
|
||||
platformFlag === 'all'
|
||||
? updates
|
||||
: updates.filter(update => {
|
||||
// Only show groups that have updates on the specified platform(s).
|
||||
return update.platform === platformFlag;
|
||||
});
|
||||
return {
|
||||
queryResponse: relevantUpdates,
|
||||
queryResponseRawLength: updates.length,
|
||||
};
|
||||
};
|
||||
|
||||
const { updates } = await ensureBranchExistsAsync({
|
||||
appId: projectId,
|
||||
name: branchName,
|
||||
limit: pageSize + 1, // fetch an extra item so we know if there are additional pages
|
||||
offset,
|
||||
const getUpdateIdentifier = (update: AppUpdateObject): string => update.group;
|
||||
|
||||
return await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryUpdatesForBranchAsync,
|
||||
promptOptions: {
|
||||
type: 'select',
|
||||
title: 'Which update would you like to republish?',
|
||||
createDisplayTextForSelectionPromptListItem: formatUpdateTitle,
|
||||
getIdentifierForQueryItem: getUpdateIdentifier,
|
||||
},
|
||||
});
|
||||
cumulativeUpdates = [
|
||||
...cumulativeUpdates,
|
||||
// drop that extra item used for pagination from our render logic
|
||||
...updates.slice(0, updates.length - 1),
|
||||
];
|
||||
const cumulativeUpdatesForTargetPlatforms =
|
||||
platformFlag === 'all'
|
||||
? cumulativeUpdates
|
||||
: cumulativeUpdates.filter(update => {
|
||||
// Only show groups that have updates on the specified platform(s).
|
||||
return update.platform === platformFlag;
|
||||
});
|
||||
const updateGroups = uniqBy(cumulativeUpdatesForTargetPlatforms, u => u.group).map(update => ({
|
||||
title: formatUpdateTitle(update),
|
||||
value: update.group,
|
||||
}));
|
||||
if (!updateGroups.length) {
|
||||
throw new Error(
|
||||
`There are no updates on branch "${branchName}" published for the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`
|
||||
);
|
||||
}
|
||||
|
||||
if (updates.length > pageSize) {
|
||||
updateGroups.push({ title: 'Next page...', value: fetchMoreValue });
|
||||
}
|
||||
|
||||
const selectedUpdateGroup = await selectAsync<string>(
|
||||
'Which update would you like to republish?',
|
||||
updateGroups
|
||||
);
|
||||
if (selectedUpdateGroup === fetchMoreValue) {
|
||||
return await getUpdatesToRepublishInteractiveAsync(
|
||||
projectId,
|
||||
branchName,
|
||||
platformFlag,
|
||||
pageSize,
|
||||
offset + pageSize,
|
||||
cumulativeUpdates
|
||||
);
|
||||
}
|
||||
return cumulativeUpdates.filter(update => update.group === selectedUpdateGroup);
|
||||
}
|
||||
|
||||
async function getRuntimeVersionObjectAsync(
|
||||
@@ -700,12 +649,24 @@ async function getRuntimeVersionObjectAsync(
|
||||
);
|
||||
}
|
||||
|
||||
function formatUpdateTitle(
|
||||
update: Exclude<
|
||||
Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'][number]
|
||||
): string {
|
||||
async function checkEASUpdateURLIsSetAsync(exp: ExpoConfig): Promise<void> {
|
||||
const configuredURL = exp.updates?.url;
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
const expectedURL = getEASUpdateURL(projectId);
|
||||
|
||||
if (configuredURL !== expectedURL) {
|
||||
throw new Error(
|
||||
`The update URL is incorrectly configured for EAS Update. Please set updates.url to ${expectedURL} in your app.json.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export type AppUpdateObject = Exclude<
|
||||
Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'][0];
|
||||
|
||||
export function formatUpdateTitle(update: AppUpdateObject): string {
|
||||
const { message, createdAt, actor, runtimeVersion } = update;
|
||||
|
||||
let actorName: string;
|
||||
@@ -728,16 +689,52 @@ function formatUpdateTitle(
|
||||
)} by ${actorName}, runtimeVersion: ${runtimeVersion}] ${message}`;
|
||||
}
|
||||
|
||||
async function checkEASUpdateURLIsSetAsync(exp: ExpoConfig): Promise<void> {
|
||||
const configuredURL = exp.updates?.url;
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
const expectedURL = getEASUpdateURL(projectId);
|
||||
async function getBranchNameToPublishOnAsync(
|
||||
projectId: string,
|
||||
validationMessage: string
|
||||
): Promise<string> {
|
||||
const queryForBanchesToPublishOnAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<UpdateBranchFragment>> => {
|
||||
const branches = await listBranchesAsync({ appId: projectId, limit: pageSize, offset });
|
||||
if (branches.length === 0) {
|
||||
const { name: newBranchName } = await promptAsync({
|
||||
type: 'text',
|
||||
name: 'name',
|
||||
message: 'No branches found. Creating a new one. Please name the new branch:',
|
||||
initial:
|
||||
(await getVcsClient().getBranchNameAsync()) ||
|
||||
`branch-${Math.random().toString(36).substring(2, 7)}`,
|
||||
validate: value => (value ? true : validationMessage),
|
||||
});
|
||||
branches.push({
|
||||
id: '_defaultId',
|
||||
name: newBranchName,
|
||||
updates: [],
|
||||
});
|
||||
}
|
||||
return { queryResponse: branches, queryResponseRawLength: branches.length };
|
||||
};
|
||||
const formatBranchTitle = (branch: UpdateBranchFragment): string =>
|
||||
`${branch.name} ${chalk.grey(`- current update: ${formatUpdate(branch.updates[0])}`)}`;
|
||||
const getBranchIdentifier = (branch: UpdateBranchFragment): string => branch.id;
|
||||
|
||||
if (configuredURL !== expectedURL) {
|
||||
throw new Error(
|
||||
`The update URL is incorrectly configured for EAS Update. Please set updates.url to ${expectedURL} in your app.json.`
|
||||
);
|
||||
}
|
||||
const branches = await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryForBanchesToPublishOnAsync,
|
||||
promptOptions: {
|
||||
type: 'select',
|
||||
createDisplayTextForSelectionPromptListItem: formatBranchTitle,
|
||||
getIdentifierForQueryItem: getBranchIdentifier,
|
||||
title: 'Which branch would you like to publish on?',
|
||||
},
|
||||
});
|
||||
|
||||
const branchName = branches?.pop()?.name;
|
||||
assert(branchName, validationMessage);
|
||||
return branchName;
|
||||
}
|
||||
|
||||
export const truncatePublishUpdateMessage = (originalMessage: string): string => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import chalk from 'chalk';
|
||||
import CliTable from 'cli-table3';
|
||||
|
||||
import EasCommand from '../../commandUtils/EasCommand';
|
||||
import { ViewAllUpdatesQuery } from '../../graphql/generated';
|
||||
import { ViewAllUpdatesQuery, ViewBranchUpdatesQuery } from '../../graphql/generated';
|
||||
import { UpdateQuery } from '../../graphql/queries/UpdateQuery';
|
||||
import Log from '../../log';
|
||||
import { getExpoConfig } from '../../project/expoConfig';
|
||||
@@ -13,6 +13,7 @@ import { promptAsync } from '../../prompts';
|
||||
import { FormatUpdateParameter, UPDATE_COLUMNS, formatUpdate } from '../../update/utils';
|
||||
import groupBy from '../../utils/expodash/groupBy';
|
||||
import { enableJsonOutput, printJsonOnlyOutput } from '../../utils/json';
|
||||
import { PaginatedQueryResponse, performPaginatedQueryAsync } from '../../utils/queries';
|
||||
import { getVcsClient } from '../../vcs';
|
||||
|
||||
type UpdateGroupDescription = FormatUpdateParameter & {
|
||||
@@ -53,12 +54,8 @@ export default class BranchView extends EasCommand {
|
||||
const exp = getExpoConfig(projectDir);
|
||||
const projectId = await getProjectIdAsync(exp);
|
||||
|
||||
let updateGroupDescriptions: UpdateGroupDescription[];
|
||||
if (all) {
|
||||
const branchesAndUpdates = await UpdateQuery.viewAllAsync({ appId: projectId });
|
||||
updateGroupDescriptions = getUpdateGroupDescriptions(
|
||||
branchesAndUpdates.app.byId.updateBranches
|
||||
);
|
||||
await fetchAllUpdatesForAppAsync(projectId, jsonFlag);
|
||||
} else {
|
||||
let branchInteractive: string | undefined;
|
||||
if (!branchFlag) {
|
||||
@@ -77,46 +74,120 @@ export default class BranchView extends EasCommand {
|
||||
const branch = branchFlag ?? branchInteractive;
|
||||
assert(branch, 'Branch name may not be empty.');
|
||||
|
||||
const branchesAndUpdates = await UpdateQuery.viewBranchAsync({
|
||||
appId: projectId,
|
||||
name: branch,
|
||||
});
|
||||
const UpdateBranch = branchesAndUpdates.app?.byId.updateBranchByName;
|
||||
if (!UpdateBranch) {
|
||||
throw new Error(`Could not find branch "${branch}"`);
|
||||
}
|
||||
updateGroupDescriptions = getUpdateGroupDescriptions([UpdateBranch]);
|
||||
fetchAllUpdatesForBranchAsync(projectId, branch, jsonFlag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type BranchUpdateObject = Exclude<
|
||||
ViewBranchUpdatesQuery['app']['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'][0];
|
||||
type AppUpdateObject = ViewAllUpdatesQuery['app']['byId']['updates'][0];
|
||||
|
||||
async function fetchAllUpdatesForBranchAsync(
|
||||
projectId: string,
|
||||
branchName: string,
|
||||
jsonFlag: boolean
|
||||
): Promise<void> {
|
||||
const queryToPerformAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<BranchUpdateObject>> => {
|
||||
const branchesAndUpdates = await UpdateQuery.viewBranchAsync({
|
||||
appId: projectId,
|
||||
name: branchName,
|
||||
limit: pageSize,
|
||||
offset,
|
||||
});
|
||||
const UpdateBranch = branchesAndUpdates.app?.byId.updateBranchByName;
|
||||
if (!UpdateBranch) {
|
||||
throw new Error(`Could not find branch "${branchName}"`);
|
||||
}
|
||||
|
||||
return {
|
||||
queryResponse: UpdateBranch.updates,
|
||||
queryResponseRawLength: UpdateBranch.updates.length,
|
||||
};
|
||||
};
|
||||
|
||||
const renderListItems = (currentPage: BranchUpdateObject[]): void => {
|
||||
const updateGroupDescriptions = getUpdateGroupDescriptions(currentPage);
|
||||
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput(updateGroupDescriptions);
|
||||
} else {
|
||||
logAsTable(updateGroupDescriptions);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryToPerformAsync,
|
||||
promptOptions: {
|
||||
type: 'confirm',
|
||||
title: 'View next page of updates?',
|
||||
renderListItems,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function fetchAllUpdatesForAppAsync(projectId: string, jsonFlag: boolean): Promise<void> {
|
||||
const queryToPerformAsync = async (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
): Promise<PaginatedQueryResponse<AppUpdateObject>> => {
|
||||
const viewAllUpdates = await UpdateQuery.viewAllAsync({
|
||||
appId: projectId,
|
||||
limit: pageSize,
|
||||
offset,
|
||||
});
|
||||
const { updates } = viewAllUpdates.app.byId;
|
||||
|
||||
return {
|
||||
queryResponse: updates,
|
||||
queryResponseRawLength: updates.length,
|
||||
};
|
||||
};
|
||||
|
||||
const renderListItems = (currentPage: AppUpdateObject[]): void => {
|
||||
const updateGroupDescriptions = getUpdateGroupDescriptions(currentPage);
|
||||
|
||||
if (jsonFlag) {
|
||||
printJsonOnlyOutput(updateGroupDescriptions);
|
||||
} else {
|
||||
logAsTable(updateGroupDescriptions);
|
||||
}
|
||||
};
|
||||
|
||||
await performPaginatedQueryAsync({
|
||||
pageSize: 50,
|
||||
offset: 0,
|
||||
queryToPerform: queryToPerformAsync,
|
||||
promptOptions: {
|
||||
type: 'confirm',
|
||||
title: 'View next page of updates?',
|
||||
renderListItems,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function getUpdateGroupDescriptions(
|
||||
branchesAndUpdates: ViewAllUpdatesQuery['app']['byId']['updateBranches']
|
||||
updates: (BranchUpdateObject | AppUpdateObject)[]
|
||||
): UpdateGroupDescription[] {
|
||||
const flattenedBranchesAndUpdates = branchesAndUpdates.flatMap(branch =>
|
||||
branch.updates.map(update => {
|
||||
return { branch: branch.name, ...update };
|
||||
return Object.values(groupBy(updates, update => update.group))
|
||||
.map(updateGroup => {
|
||||
return {
|
||||
platforms: updateGroup
|
||||
.map(update => update.platform)
|
||||
.sort()
|
||||
.join(', '),
|
||||
...updateGroup[0],
|
||||
branch: updateGroup[0].branch.name,
|
||||
} as UpdateGroupDescription;
|
||||
})
|
||||
);
|
||||
const updateGroupDescriptions = Object.values(
|
||||
groupBy(flattenedBranchesAndUpdates, update => update.group)
|
||||
).map(updateGroup => {
|
||||
const platforms = updateGroup
|
||||
.map(update => update.platform)
|
||||
.sort()
|
||||
.join(', ');
|
||||
return { ...updateGroup[0], platforms };
|
||||
});
|
||||
updateGroupDescriptions.sort(
|
||||
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
||||
);
|
||||
return updateGroupDescriptions;
|
||||
.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
|
||||
}
|
||||
|
||||
function logAsTable(updateGroupDescriptions: UpdateGroupDescription[]): void {
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
export default {
|
||||
/**
|
||||
* Dangerous overrides, use only if you know what you are doing
|
||||
*/
|
||||
|
||||
/**
|
||||
* Overrides applicationId from Android project, setting this option will also
|
||||
* ignore failures when parsing build.gradle.
|
||||
*/
|
||||
overrideAndroidApplicationId: process.env.EAS_DANGEROUS_OVERRIDE_ANDROID_APPLICATION_ID,
|
||||
};
|
||||
+13
-5
@@ -1584,6 +1584,7 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
|
||||
iosEnterpriseProvisioning?: Maybe<BuildIosEnterpriseProvisioning>;
|
||||
isGitWorkingTreeDirty?: Maybe<Scalars['Boolean']>;
|
||||
logFiles: Array<Scalars['String']>;
|
||||
maxBuildTimeSeconds: Scalars['Int'];
|
||||
metrics?: Maybe<BuildMetrics>;
|
||||
parentBuild?: Maybe<Build>;
|
||||
platform: AppPlatform;
|
||||
@@ -1817,7 +1818,8 @@ export type BuildParamsInput = {
|
||||
|
||||
export enum BuildPriority {
|
||||
High = 'HIGH',
|
||||
Normal = 'NORMAL'
|
||||
Normal = 'NORMAL',
|
||||
NormalPlus = 'NORMAL_PLUS'
|
||||
}
|
||||
|
||||
/** Publicly visible data for a Build. */
|
||||
@@ -3849,6 +3851,7 @@ export type DeleteUpdateBranchMutation = { __typename?: 'RootMutation', updateBr
|
||||
export type BranchesByAppQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
limit: Scalars['Int'];
|
||||
offset: Scalars['Int'];
|
||||
}>;
|
||||
|
||||
|
||||
@@ -3910,8 +3913,10 @@ export type UpdateChannelBranchMappingMutation = { __typename?: 'RootMutation',
|
||||
|
||||
export type GetAllChannelsForAppQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
offset: Scalars['Int'];
|
||||
limit: Scalars['Int'];
|
||||
channelOffset: Scalars['Int'];
|
||||
channelLimit: Scalars['Int'];
|
||||
branchLimit: Scalars['Int'];
|
||||
branchOffset: Scalars['Int'];
|
||||
}>;
|
||||
|
||||
|
||||
@@ -4476,6 +4481,8 @@ export type GetAllBuildsForAppQuery = { __typename?: 'RootQuery', app: { __typen
|
||||
export type GetChannelByNameForAppQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
channelName: Scalars['String'];
|
||||
limit: Scalars['Int'];
|
||||
offset: Scalars['Int'];
|
||||
}>;
|
||||
|
||||
|
||||
@@ -4531,10 +4538,11 @@ export type GetAllSubmissionsForAppQuery = { __typename?: 'RootQuery', app: { __
|
||||
export type ViewAllUpdatesQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
limit: Scalars['Int'];
|
||||
offset: Scalars['Int'];
|
||||
}>;
|
||||
|
||||
|
||||
export type ViewAllUpdatesQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, updateBranches: Array<{ __typename?: 'UpdateBranch', id: string, name: string, updates: Array<{ __typename?: 'Update', id: string, group: string, message?: string | null, createdAt: any, runtimeVersion: string, platform: string, actor?: { __typename?: 'Robot', firstName?: string | null, id: string } | { __typename?: 'User', username: string, id: string } | null }> }> } } };
|
||||
export type ViewAllUpdatesQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, updates: Array<{ __typename?: 'Update', id: string, group: string, message?: string | null, createdAt: any, runtimeVersion: string, platform: string, actor?: { __typename?: 'Robot', firstName?: string | null, id: string } | { __typename?: 'User', username: string, id: string } | null, branch: { __typename?: 'UpdateBranch', id: string, name: string } }> } } };
|
||||
|
||||
export type ViewBranchUpdatesQueryVariables = Exact<{
|
||||
appId: Scalars['String'];
|
||||
@@ -4544,7 +4552,7 @@ export type ViewBranchUpdatesQueryVariables = Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type ViewBranchUpdatesQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, updateBranchByName?: { __typename?: 'UpdateBranch', id: string, name: string, updates: Array<{ __typename?: 'Update', id: string, group: string, message?: string | null, createdAt: any, runtimeVersion: string, platform: string, manifestFragment: string, actor?: { __typename?: 'Robot', firstName?: string | null, id: string } | { __typename?: 'User', username: string, id: string } | null }> } | null } } };
|
||||
export type ViewBranchUpdatesQuery = { __typename?: 'RootQuery', app: { __typename?: 'AppQuery', byId: { __typename?: 'App', id: string, updateBranchByName?: { __typename?: 'UpdateBranch', id: string, name: string, updates: Array<{ __typename?: 'Update', id: string, group: string, message?: string | null, createdAt: any, runtimeVersion: string, platform: string, manifestFragment: string, actor?: { __typename?: 'Robot', firstName?: string | null, id: string } | { __typename?: 'User', username: string, id: string } | null, branch: { __typename?: 'UpdateBranch', id: string, name: string } }> } | null } } };
|
||||
|
||||
export type CurrentUserQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from '../generated';
|
||||
import { BuildFragmentNode } from '../types/Build';
|
||||
|
||||
type BuildsQuery = {
|
||||
export type BuildsQuery = {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
filter?: {
|
||||
|
||||
@@ -3,10 +3,14 @@ import gql from 'graphql-tag';
|
||||
import { graphqlClient, withErrorHandlingAsync } from '../client';
|
||||
import { GetChannelByNameForAppQuery, GetChannelByNameForAppQueryVariables } from '../generated';
|
||||
|
||||
const BRANCHES_LIMIT = 50;
|
||||
|
||||
export const ChannelQuery = {
|
||||
async getUpdateChannelByNameForAppAsync({
|
||||
appId,
|
||||
channelName,
|
||||
offset = 0,
|
||||
limit = BRANCHES_LIMIT,
|
||||
}: GetChannelByNameForAppQueryVariables): Promise<
|
||||
GetChannelByNameForAppQuery['app']['byId']['updateChannelByName']
|
||||
> {
|
||||
@@ -18,7 +22,12 @@ export const ChannelQuery = {
|
||||
graphqlClient
|
||||
.query<GetChannelByNameForAppQuery, GetChannelByNameForAppQueryVariables>(
|
||||
gql`
|
||||
query GetChannelByNameForApp($appId: String!, $channelName: String!) {
|
||||
query GetChannelByNameForApp(
|
||||
$appId: String!
|
||||
$channelName: String!
|
||||
$limit: Int!
|
||||
$offset: Int!
|
||||
) {
|
||||
app {
|
||||
byId(appId: $appId) {
|
||||
id
|
||||
@@ -27,10 +36,10 @@ export const ChannelQuery = {
|
||||
name
|
||||
createdAt
|
||||
branchMapping
|
||||
updateBranches(offset: 0, limit: 1000) {
|
||||
updateBranches(offset: $offset, limit: $limit) {
|
||||
id
|
||||
name
|
||||
updates(offset: 0, limit: 10) {
|
||||
updates(offset: 0, limit: 1) {
|
||||
id
|
||||
group
|
||||
message
|
||||
@@ -53,7 +62,7 @@ export const ChannelQuery = {
|
||||
}
|
||||
}
|
||||
`,
|
||||
{ appId, channelName },
|
||||
{ appId, channelName, offset, limit },
|
||||
{ additionalTypenames: ['UpdateChannel', 'UpdateBranch', 'Update'] }
|
||||
)
|
||||
.toPromise()
|
||||
|
||||
@@ -8,41 +8,41 @@ import {
|
||||
ViewBranchUpdatesQueryVariables,
|
||||
} from '../generated';
|
||||
|
||||
export const viewBranchUpdatesQueryUpdateLimit = 300;
|
||||
|
||||
type ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset =
|
||||
Partial<ViewBranchUpdatesQueryVariables> &
|
||||
Pick<ViewBranchUpdatesQueryVariables, 'appId' | 'name'>;
|
||||
const UPDATE_LIMIT = 50;
|
||||
|
||||
export const UpdateQuery = {
|
||||
async viewAllAsync({ appId }: { appId: string }): Promise<ViewAllUpdatesQuery> {
|
||||
async viewAllAsync({
|
||||
appId,
|
||||
limit = UPDATE_LIMIT,
|
||||
offset = 0,
|
||||
}: ViewAllUpdatesQueryVariables): Promise<ViewAllUpdatesQuery> {
|
||||
return withErrorHandlingAsync(
|
||||
graphqlClient
|
||||
.query<ViewAllUpdatesQuery, ViewAllUpdatesQueryVariables>(
|
||||
gql`
|
||||
query ViewAllUpdates($appId: String!, $limit: Int!) {
|
||||
query ViewAllUpdates($appId: String!, $limit: Int!, $offset: Int!) {
|
||||
app {
|
||||
byId(appId: $appId) {
|
||||
id
|
||||
updateBranches(offset: 0, limit: $limit) {
|
||||
updates(offset: $offset, limit: $limit) {
|
||||
id
|
||||
name
|
||||
updates(offset: 0, limit: $limit) {
|
||||
group
|
||||
message
|
||||
createdAt
|
||||
runtimeVersion
|
||||
platform
|
||||
actor {
|
||||
id
|
||||
group
|
||||
message
|
||||
createdAt
|
||||
runtimeVersion
|
||||
platform
|
||||
actor {
|
||||
id
|
||||
... on User {
|
||||
username
|
||||
}
|
||||
... on Robot {
|
||||
firstName
|
||||
}
|
||||
... on User {
|
||||
username
|
||||
}
|
||||
... on Robot {
|
||||
firstName
|
||||
}
|
||||
}
|
||||
branch {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,8 @@ export const UpdateQuery = {
|
||||
`,
|
||||
{
|
||||
appId,
|
||||
limit: viewBranchUpdatesQueryUpdateLimit,
|
||||
limit,
|
||||
offset,
|
||||
},
|
||||
{ additionalTypenames: ['UpdateBranch', 'Update'] }
|
||||
)
|
||||
@@ -61,9 +62,9 @@ export const UpdateQuery = {
|
||||
async viewBranchAsync({
|
||||
appId,
|
||||
name,
|
||||
limit = viewBranchUpdatesQueryUpdateLimit,
|
||||
limit = UPDATE_LIMIT,
|
||||
offset = 0,
|
||||
}: ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset) {
|
||||
}: ViewBranchUpdatesQueryVariables) {
|
||||
return withErrorHandlingAsync<ViewBranchUpdatesQuery>(
|
||||
graphqlClient
|
||||
.query<ViewBranchUpdatesQuery, ViewBranchUpdatesQueryVariables>(
|
||||
@@ -92,6 +93,10 @@ export const UpdateQuery = {
|
||||
firstName
|
||||
}
|
||||
}
|
||||
branch {
|
||||
id
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ export const UpdateBranchFragmentNode = gql`
|
||||
fragment UpdateBranchFragment on UpdateBranch {
|
||||
id
|
||||
name
|
||||
updates(offset: 0, limit: 10) {
|
||||
updates(offset: 0, limit: 1) {
|
||||
id
|
||||
actor {
|
||||
__typename
|
||||
|
||||
@@ -49,6 +49,10 @@ export default class Log {
|
||||
Log.log(`${chalk.green(logSymbols.success)} ${message}`);
|
||||
}
|
||||
|
||||
public static withCross(...args: any[]): void {
|
||||
Log.consoleLog(chalk.red(figures.cross), ...args);
|
||||
}
|
||||
|
||||
public static withTick(...args: any[]): void {
|
||||
Log.consoleLog(chalk.green(figures.tick), ...args);
|
||||
}
|
||||
|
||||
@@ -1,37 +1,23 @@
|
||||
import { AppCategory, AppCategoryId, AppSubcategoryId, BundleIdPlatform } from '@expo/apple-utils';
|
||||
import { AppCategory, AppInfo, BundleIdPlatform } from '@expo/apple-utils';
|
||||
|
||||
import { AppleConfigWriter } from '../../writer';
|
||||
import { AttributesOf } from '../../../../utils/asc';
|
||||
|
||||
/** Infered type of the AppleConfigWriter.setCategories attributes */
|
||||
type CategoryInfoProps = Parameters<typeof AppleConfigWriter.prototype.setCategories>[0];
|
||||
|
||||
/**
|
||||
* Export a factory method instead of fixed categories.
|
||||
* In the tests, we need to create a couple of different categories,
|
||||
* adding them here as fixed objects won't be readable.
|
||||
*/
|
||||
export function makeCategory(id?: AppCategoryId | AppSubcategoryId): AppCategory | undefined {
|
||||
if (!id) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return new AppCategory({} as any, id, {
|
||||
export const primaryOnlyCategory: Pick<AttributesOf<AppInfo>, 'primaryCategory'> = {
|
||||
primaryCategory: new AppCategory({} as any, 'ENTERTAINMENT', {
|
||||
platforms: [BundleIdPlatform.IOS, BundleIdPlatform.MAC_OS],
|
||||
});
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
/**
|
||||
* Export a helper method to create the AppInfo object, using only AppCategoryIds or AppSubcategoryId.
|
||||
*/
|
||||
export function makeCategoryInfo(
|
||||
attributes: Partial<Record<keyof CategoryInfoProps, AppCategoryId | AppSubcategoryId>>
|
||||
): CategoryInfoProps {
|
||||
return {
|
||||
primaryCategory: makeCategory(attributes.primaryCategory),
|
||||
primarySubcategoryOne: makeCategory(attributes.primarySubcategoryOne),
|
||||
primarySubcategoryTwo: makeCategory(attributes.primarySubcategoryTwo),
|
||||
secondaryCategory: makeCategory(attributes.secondaryCategory),
|
||||
secondarySubcategoryOne: makeCategory(attributes.secondarySubcategoryOne),
|
||||
secondarySubcategoryTwo: makeCategory(attributes.secondarySubcategoryTwo),
|
||||
};
|
||||
}
|
||||
export const secondaryOnlyCategory: Pick<AttributesOf<AppInfo>, 'secondaryCategory'> = {
|
||||
secondaryCategory: new AppCategory({} as any, 'GAMES', {
|
||||
platforms: [BundleIdPlatform.IOS, BundleIdPlatform.MAC_OS],
|
||||
}),
|
||||
};
|
||||
|
||||
export const primaryAndSecondaryCategory: Pick<
|
||||
AttributesOf<AppInfo>,
|
||||
'primaryCategory' | 'secondaryCategory'
|
||||
> = {
|
||||
...primaryOnlyCategory,
|
||||
...secondaryOnlyCategory,
|
||||
};
|
||||
@@ -1,73 +1,7 @@
|
||||
import { AppCategoryId, AppSubcategoryId } from '@expo/apple-utils';
|
||||
|
||||
import { AppleConfigReader } from '../reader';
|
||||
import { leastRestrictiveAdvisory, mostRestrictiveAdvisory } from './fixtures/ageRatingDeclaration';
|
||||
|
||||
describe('getCategories', () => {
|
||||
it('ignores categories when not set', () => {
|
||||
const reader = new AppleConfigReader({ categories: undefined });
|
||||
expect(reader.getCategories()).toBeNull();
|
||||
});
|
||||
|
||||
it('returns primary category only', () => {
|
||||
const reader = new AppleConfigReader({ categories: [AppCategoryId.ENTERTAINMENT] });
|
||||
expect(reader.getCategories()).toMatchObject({
|
||||
primaryCategory: AppCategoryId.ENTERTAINMENT,
|
||||
secondaryCategory: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('returns primary and secondary categories', () => {
|
||||
const reader = new AppleConfigReader({
|
||||
categories: [AppCategoryId.ENTERTAINMENT, AppCategoryId.FOOD_AND_DRINK],
|
||||
});
|
||||
expect(reader.getCategories()).toMatchObject({
|
||||
primaryCategory: AppCategoryId.ENTERTAINMENT,
|
||||
secondaryCategory: AppCategoryId.FOOD_AND_DRINK,
|
||||
});
|
||||
});
|
||||
|
||||
it('returns primary category without subcategory', () => {
|
||||
const reader = new AppleConfigReader({ categories: [AppCategoryId.GAMES] });
|
||||
expect(reader.getCategories()).toMatchObject({
|
||||
primaryCategory: AppCategoryId.GAMES,
|
||||
secondaryCategory: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('returns primary category with two subcategories', () => {
|
||||
const reader = new AppleConfigReader({
|
||||
categories: [
|
||||
[AppCategoryId.GAMES, AppSubcategoryId.GAMES_CARD, AppSubcategoryId.GAMES_ADVENTURE],
|
||||
],
|
||||
});
|
||||
expect(reader.getCategories()).toMatchObject({
|
||||
primaryCategory: AppCategoryId.GAMES,
|
||||
primarySubcategoryOne: AppSubcategoryId.GAMES_CARD,
|
||||
primarySubcategoryTwo: AppSubcategoryId.GAMES_ADVENTURE,
|
||||
secondaryCategory: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('returns primary and secondary categories with two subcategories', () => {
|
||||
const reader = new AppleConfigReader({
|
||||
categories: [
|
||||
AppCategoryId.ENTERTAINMENT,
|
||||
[AppCategoryId.GAMES, AppSubcategoryId.GAMES_CARD, AppSubcategoryId.GAMES_ADVENTURE],
|
||||
],
|
||||
});
|
||||
expect(reader.getCategories()).toMatchObject({
|
||||
primaryCategory: AppCategoryId.ENTERTAINMENT,
|
||||
secondaryCategory: AppCategoryId.GAMES,
|
||||
secondarySubcategoryOne: AppSubcategoryId.GAMES_CARD,
|
||||
secondarySubcategoryTwo: AppSubcategoryId.GAMES_ADVENTURE,
|
||||
});
|
||||
expect(reader.getCategories()).not.toHaveProperty('primarySubcategoryOne');
|
||||
expect(reader.getCategories()).not.toHaveProperty('primarySubcategoryTwo');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getAgeRating', () => {
|
||||
describe('setAgeRating', () => {
|
||||
it('ignores advisory when not set', () => {
|
||||
const reader = new AppleConfigReader({ advisory: undefined });
|
||||
expect(reader.getAgeRating()).toBeNull();
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { AppCategoryId, AppSubcategoryId } from '@expo/apple-utils';
|
||||
|
||||
import { AppleConfigWriter } from '../writer';
|
||||
import {
|
||||
emptyAdvisory,
|
||||
@@ -7,7 +5,7 @@ import {
|
||||
leastRestrictiveAdvisory,
|
||||
mostRestrictiveAdvisory,
|
||||
} from './fixtures/ageRatingDeclaration';
|
||||
import { makeCategoryInfo } from './fixtures/appInfo';
|
||||
import { primaryAndSecondaryCategory, secondaryOnlyCategory } from './fixtures/appInfo';
|
||||
import { dutchInfo, englishInfo } from './fixtures/appInfoLocalization';
|
||||
import { nameAndDemoReviewDetails, nameOnlyReviewDetails } from './fixtures/appStoreReviewDetail';
|
||||
import { automaticRelease, manualRelease, scheduledRelease } from './fixtures/appStoreVersion';
|
||||
@@ -75,109 +73,22 @@ describe('setInfoLocale', () => {
|
||||
});
|
||||
|
||||
describe('setCategories', () => {
|
||||
it('modifies the categories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(primaryAndSecondaryCategory as any);
|
||||
expect(writer.schema.categories).toHaveLength(2);
|
||||
expect((writer.schema.categories as any)[0]).toBe(
|
||||
primaryAndSecondaryCategory.primaryCategory?.id
|
||||
);
|
||||
expect((writer.schema.categories as any)[1]).toBe(
|
||||
primaryAndSecondaryCategory.secondaryCategory?.id
|
||||
);
|
||||
});
|
||||
|
||||
it('skips secondary category without primary category', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(makeCategoryInfo({}));
|
||||
expect(writer.schema.categories).toBeUndefined();
|
||||
});
|
||||
|
||||
it('removes existing values when undefined', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(makeCategoryInfo({ primaryCategory: AppCategoryId.BUSINESS }));
|
||||
writer.setCategories(makeCategoryInfo({}));
|
||||
expect(writer.schema.categories).toBeUndefined();
|
||||
});
|
||||
|
||||
it('modifies primary category only', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(makeCategoryInfo({ primaryCategory: AppCategoryId.ENTERTAINMENT }));
|
||||
expect(writer.schema.categories).toEqual([AppCategoryId.ENTERTAINMENT]);
|
||||
});
|
||||
|
||||
it('modifies primary and secondary categories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(
|
||||
makeCategoryInfo({
|
||||
primaryCategory: AppCategoryId.ENTERTAINMENT,
|
||||
secondaryCategory: AppCategoryId.FOOD_AND_DRINK,
|
||||
})
|
||||
);
|
||||
expect(writer.schema.categories).toEqual([
|
||||
AppCategoryId.ENTERTAINMENT,
|
||||
AppCategoryId.FOOD_AND_DRINK,
|
||||
]);
|
||||
});
|
||||
|
||||
it('modifies primary category without subcategories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(makeCategoryInfo({ primaryCategory: AppCategoryId.GAMES }));
|
||||
expect(writer.schema.categories).toEqual([AppCategoryId.GAMES]);
|
||||
});
|
||||
|
||||
it('modifies primary category with one subcategories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(
|
||||
makeCategoryInfo({
|
||||
primaryCategory: AppCategoryId.GAMES,
|
||||
primarySubcategoryOne: AppSubcategoryId.GAMES_CARD,
|
||||
})
|
||||
);
|
||||
expect(writer.schema.categories).toEqual([[AppCategoryId.GAMES, AppSubcategoryId.GAMES_CARD]]);
|
||||
// We need to filter the lists to avoid writing `[GAMES, GAMES_CARD, null]`
|
||||
expect(writer.schema.categories![0]).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('modifies primary category with two subcategories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(
|
||||
makeCategoryInfo({
|
||||
primaryCategory: AppCategoryId.GAMES,
|
||||
primarySubcategoryOne: AppSubcategoryId.GAMES_CARD,
|
||||
primarySubcategoryTwo: AppSubcategoryId.GAMES_ADVENTURE,
|
||||
})
|
||||
);
|
||||
expect(writer.schema.categories).toEqual([
|
||||
[AppCategoryId.GAMES, AppSubcategoryId.GAMES_CARD, AppSubcategoryId.GAMES_ADVENTURE],
|
||||
]);
|
||||
});
|
||||
|
||||
it('modifies primary and secondary categories with one subcategories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(
|
||||
makeCategoryInfo({
|
||||
primaryCategory: AppCategoryId.ENTERTAINMENT,
|
||||
secondaryCategory: AppCategoryId.GAMES,
|
||||
secondarySubcategoryOne: AppSubcategoryId.GAMES_CARD,
|
||||
})
|
||||
);
|
||||
expect(writer.schema.categories).toEqual([
|
||||
AppCategoryId.ENTERTAINMENT,
|
||||
[AppCategoryId.GAMES, AppSubcategoryId.GAMES_CARD],
|
||||
]);
|
||||
// We need to filter the lists to avoid writing `[GAMES, GAMES_CARD, null]`
|
||||
expect(writer.schema.categories![1]).toHaveLength(2);
|
||||
});
|
||||
|
||||
it('modifies primary and secondary categories with two subcategories', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(
|
||||
makeCategoryInfo({
|
||||
primaryCategory: AppCategoryId.ENTERTAINMENT,
|
||||
secondaryCategory: AppCategoryId.GAMES,
|
||||
secondarySubcategoryOne: AppSubcategoryId.GAMES_CARD,
|
||||
secondarySubcategoryTwo: AppSubcategoryId.GAMES_ADVENTURE,
|
||||
})
|
||||
);
|
||||
expect(writer.schema.categories).toEqual([
|
||||
AppCategoryId.ENTERTAINMENT,
|
||||
[AppCategoryId.GAMES, AppSubcategoryId.GAMES_CARD, AppSubcategoryId.GAMES_ADVENTURE],
|
||||
]);
|
||||
});
|
||||
|
||||
it('modifies secondary category without primary', () => {
|
||||
const writer = new AppleConfigWriter();
|
||||
writer.setCategories(makeCategoryInfo({ secondaryCategory: AppCategoryId.GAMES }));
|
||||
expect(writer.schema.categories).toEqual(['', AppCategoryId.GAMES]);
|
||||
writer.setCategories(secondaryOnlyCategory as any);
|
||||
expect(writer.schema.categories).toHaveLength(0);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -78,33 +78,14 @@ export class AppleConfigReader {
|
||||
}
|
||||
|
||||
public getCategories(): CategoryIds | null {
|
||||
const { categories } = this.schema;
|
||||
if (!categories || categories.length <= 0) {
|
||||
return null;
|
||||
if (Array.isArray(this.schema.categories) && this.schema.categories.length > 0) {
|
||||
return {
|
||||
primaryCategory: this.schema.categories[0],
|
||||
secondaryCategory: this.schema.categories[1],
|
||||
};
|
||||
}
|
||||
|
||||
// We validate the categories based on enums, but they will still be strings here.
|
||||
const categoryIds: Partial<Record<keyof CategoryIds, string>> = {};
|
||||
|
||||
if (Array.isArray(categories[0])) {
|
||||
categoryIds.primaryCategory = categories[0][0];
|
||||
categoryIds.primarySubcategoryOne = categories[0][1];
|
||||
categoryIds.primarySubcategoryTwo = categories[0][2];
|
||||
} else {
|
||||
categoryIds.primaryCategory = categories[0];
|
||||
}
|
||||
|
||||
if (Array.isArray(categories[1])) {
|
||||
categoryIds.secondaryCategory = categories[1][0];
|
||||
categoryIds.secondarySubcategoryOne = categories[1][1];
|
||||
categoryIds.secondarySubcategoryTwo = categories[1][2];
|
||||
} else {
|
||||
categoryIds.secondaryCategory = categories[1];
|
||||
}
|
||||
|
||||
// Because we handle categories as normal strings,
|
||||
// the type doesn't match with the actual CategoryIds types.
|
||||
return categoryIds as CategoryIds;
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Get the `AppStoreVersion` object. */
|
||||
|
||||
@@ -64,44 +64,15 @@ export class AppleConfigWriter {
|
||||
};
|
||||
}
|
||||
|
||||
public setCategories(
|
||||
attributes: Pick<
|
||||
AttributesOf<AppInfo>,
|
||||
| 'primaryCategory'
|
||||
| 'primarySubcategoryOne'
|
||||
| 'primarySubcategoryTwo'
|
||||
| 'secondaryCategory'
|
||||
| 'secondarySubcategoryOne'
|
||||
| 'secondarySubcategoryTwo'
|
||||
>
|
||||
): void {
|
||||
this.schema.categories = undefined;
|
||||
if (!attributes.primaryCategory && !attributes.secondaryCategory) {
|
||||
return;
|
||||
}
|
||||
|
||||
public setCategories({ primaryCategory, secondaryCategory }: AttributesOf<AppInfo>): void {
|
||||
this.schema.categories = [];
|
||||
|
||||
if (attributes.primaryCategory && attributes.primarySubcategoryOne) {
|
||||
this.schema.categories[0] = [
|
||||
attributes.primaryCategory.id,
|
||||
attributes.primarySubcategoryOne?.id,
|
||||
attributes.primarySubcategoryTwo?.id,
|
||||
].filter(Boolean) as string[];
|
||||
} else {
|
||||
// If only the secondaryCategory was provided,
|
||||
// autofill with an empty string and cause a store config error.
|
||||
this.schema.categories[0] = attributes.primaryCategory?.id ?? '';
|
||||
}
|
||||
|
||||
if (attributes.secondaryCategory && attributes.secondarySubcategoryOne) {
|
||||
this.schema.categories[1] = [
|
||||
attributes.secondaryCategory.id,
|
||||
attributes.secondarySubcategoryOne?.id,
|
||||
attributes.secondarySubcategoryTwo?.id,
|
||||
].filter(Boolean) as string[];
|
||||
} else if (attributes.secondaryCategory) {
|
||||
this.schema.categories[1] = attributes.secondaryCategory.id;
|
||||
// TODO: see why these types are conflicting
|
||||
if (primaryCategory) {
|
||||
this.schema.categories.push(primaryCategory.id as any);
|
||||
if (secondaryCategory) {
|
||||
this.schema.categories.push(secondaryCategory.id as any);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import type { AgeRatingDeclarationProps } from '@expo/apple-utils';
|
||||
import type { AgeRatingDeclarationProps, AppCategoryId, AppSubcategoryId } from '@expo/apple-utils';
|
||||
|
||||
export type AppleLocale = string;
|
||||
|
||||
export interface AppleMetadata {
|
||||
copyright?: string;
|
||||
info?: Record<AppleLocale, AppleInfo>;
|
||||
categories?: AppleCategory;
|
||||
categories?: AppCategoryId[] | AppleCategory;
|
||||
release?: AppleRelease;
|
||||
advisory?: AppleAdvisory;
|
||||
preview?: Record<string, string[]>;
|
||||
@@ -14,8 +14,10 @@ export interface AppleMetadata {
|
||||
|
||||
export type AppleAdvisory = Partial<AgeRatingDeclarationProps>;
|
||||
|
||||
/** Apps can define up to two categories, or categories with up to two subcategories */
|
||||
export type AppleCategory = (string | string[])[];
|
||||
export interface AppleCategory {
|
||||
category: AppCategoryId;
|
||||
subcategory?: AppSubcategoryId[];
|
||||
}
|
||||
|
||||
export interface AppleRelease {
|
||||
isPhasedReleaseEnabled?: boolean;
|
||||
|
||||
@@ -9,6 +9,7 @@ import { PublishMutation } from '../../graphql/mutations/PublishMutation';
|
||||
import { PublishQuery } from '../../graphql/queries/PublishQuery';
|
||||
import {
|
||||
MetadataJoi,
|
||||
TIMEOUT_LIMIT,
|
||||
buildUnsortedUpdateInfoGroupAsync,
|
||||
collectAssetsAsync,
|
||||
convertAssetToUpdateInfoGroupFormatAsync,
|
||||
@@ -411,6 +412,38 @@ describe(uploadAssetsAsync, () => {
|
||||
return { specifications: ['{}', '{}', '{}'] };
|
||||
});
|
||||
|
||||
// beforeEach(() => {
|
||||
// jest.useFakeTimers();
|
||||
// });
|
||||
it('throws an error if the upload exceeds TIMEOUT_LIMIT', async () => {
|
||||
jest.spyOn(PublishQuery, 'getAssetMetadataAsync').mockImplementation(async () => {
|
||||
const status = AssetMetadataStatus.DoesNotExist;
|
||||
mockdate.set(Date.now() + TIMEOUT_LIMIT + 1);
|
||||
jest.runAllTimers();
|
||||
return [
|
||||
{
|
||||
storageKey: 'qbgckgkgfdjnNuf9dQd7FDTWUmlEEzg7l1m1sKzQaq0',
|
||||
status,
|
||||
__typename: 'AssetMetadataResult',
|
||||
}, // userDefinedAsset
|
||||
{
|
||||
storageKey: 'bbjgXFSIXtjviGwkaPFY0HG4dVVIGiXHAboRFQEqVa4',
|
||||
status,
|
||||
__typename: 'AssetMetadataResult',
|
||||
}, // android.code
|
||||
{
|
||||
storageKey: 'dP-nC8EJXKz42XKh_Rc9tYxiGAT-ilpkRltEi6HIKeQ',
|
||||
status,
|
||||
__typename: 'AssetMetadataResult',
|
||||
}, // ios.code
|
||||
];
|
||||
});
|
||||
|
||||
mockdate.set(0);
|
||||
await expect(uploadAssetsAsync(assetsForUpdateInfoGroup)).rejects.toThrow(
|
||||
'Asset upload timed out. Please try again.'
|
||||
);
|
||||
});
|
||||
it('resolves if the assets are already uploaded', async () => {
|
||||
jest.spyOn(PublishQuery, 'getAssetMetadataAsync').mockImplementation(async () => {
|
||||
const status = AssetMetadataStatus.Exists;
|
||||
@@ -497,15 +530,15 @@ describe(uploadAssetsAsync, () => {
|
||||
}, // ios.code
|
||||
];
|
||||
});
|
||||
const updateSpinnerFn = jest.fn((_totalAssets, _missingAssets) => {});
|
||||
const updateSpinnerFn = jest.fn(_text => {});
|
||||
|
||||
mockdate.set(0);
|
||||
await uploadAssetsAsync(assetsForUpdateInfoGroup, updateSpinnerFn);
|
||||
const calls = updateSpinnerFn.mock.calls;
|
||||
expect(calls).toEqual([
|
||||
[3, 3],
|
||||
[3, 2],
|
||||
[3, 0],
|
||||
['6 assets present'],
|
||||
['3 unique assets found'],
|
||||
['2 new assets uploading'],
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -7,7 +7,6 @@ import fs from 'fs-extra';
|
||||
import nullthrows from 'nullthrows';
|
||||
|
||||
import { readAppJson } from '../../build/utils/appJson';
|
||||
import env from '../../env';
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { getProjectConfigDescription, getUsername } from '../../project/projectUtils';
|
||||
import { promptAsync } from '../../prompts';
|
||||
@@ -44,9 +43,6 @@ export async function getApplicationIdFromBareAsync(
|
||||
projectDir: string,
|
||||
gradleContext?: GradleBuildContext
|
||||
): Promise<string> {
|
||||
if (env.overrideAndroidApplicationId) {
|
||||
return env.overrideAndroidApplicationId;
|
||||
}
|
||||
const errorMessage = 'Could not read applicationId from Android project.';
|
||||
|
||||
if (gradleContext) {
|
||||
|
||||
@@ -15,6 +15,8 @@ import { uploadWithPresignedPostAsync } from '../uploads';
|
||||
import { expoCommandAsync } from '../utils/expoCli';
|
||||
import uniqBy from '../utils/expodash/uniqBy';
|
||||
|
||||
export const TIMEOUT_LIMIT = 60_000; // 1 minute
|
||||
|
||||
export type PublishPlatform = Extract<'android' | 'ios', Platform>;
|
||||
type Metadata = {
|
||||
version: number;
|
||||
@@ -253,7 +255,7 @@ type AssetUploadResult = {
|
||||
|
||||
export async function uploadAssetsAsync(
|
||||
assetsForUpdateInfoGroup: CollectedAssets,
|
||||
updateSpinnerText?: (totalAssets: number, missingAssets: number) => void
|
||||
updateSpinnerText?: (updatedText: string) => void
|
||||
): Promise<AssetUploadResult> {
|
||||
let assets: RawAsset[] = [];
|
||||
let platform: keyof CollectedAssets;
|
||||
@@ -264,6 +266,7 @@ export async function uploadAssetsAsync(
|
||||
...assetsForUpdateInfoGroup[platform]!.assets,
|
||||
];
|
||||
}
|
||||
updateSpinnerText?.(`${assets.length} ${assets.length === 1 ? 'asset' : 'assets'} present`);
|
||||
|
||||
const assetsWithStorageKey = await Promise.all(
|
||||
assets.map(async asset => {
|
||||
@@ -278,10 +281,9 @@ export async function uploadAssetsAsync(
|
||||
storageKey: string;
|
||||
}
|
||||
>(assetsWithStorageKey, asset => asset.storageKey);
|
||||
|
||||
const totalAssets = uniqueAssets.length;
|
||||
|
||||
updateSpinnerText?.(totalAssets, totalAssets);
|
||||
updateSpinnerText?.(
|
||||
`${uniqueAssets.length} unique ${uniqueAssets.length === 1 ? 'asset' : 'assets'} found`
|
||||
);
|
||||
|
||||
let missingAssets = await filterOutAssetsThatAlreadyExistAsync(uniqueAssets);
|
||||
const uniqueUploadedAssetCount = missingAssets.length;
|
||||
@@ -289,28 +291,32 @@ export async function uploadAssetsAsync(
|
||||
missingAssets.map(ma => ma.contentType)
|
||||
);
|
||||
|
||||
updateSpinnerText?.(totalAssets, missingAssets.length);
|
||||
|
||||
const assetUploadPromiseLimit = promiseLimit(15);
|
||||
|
||||
await Promise.all(
|
||||
missingAssets.map((missingAsset, i) => {
|
||||
assetUploadPromiseLimit(async () => {
|
||||
const presignedPost: PresignedPost = JSON.parse(specifications[i]);
|
||||
await uploadWithPresignedPostAsync(missingAsset.path, presignedPost);
|
||||
return uploadWithPresignedPostAsync(missingAsset.path, presignedPost);
|
||||
});
|
||||
})
|
||||
);
|
||||
|
||||
updateSpinnerText?.(
|
||||
`${missingAssets.length} new ${missingAssets.length === 1 ? 'asset' : 'assets'} uploading`
|
||||
);
|
||||
// Wait up to TIMEOUT_LIMIT for assets to be uploaded and processed
|
||||
const start = Date.now();
|
||||
let timeout = 1;
|
||||
while (missingAssets.length > 0) {
|
||||
const timeoutPromise = new Promise(resolve =>
|
||||
setTimeout(resolve, Math.min(timeout * 1000, 5000))
|
||||
); // linear backoff
|
||||
const timeoutPromise = new Promise(resolve => setTimeout(resolve, timeout * 1000)); // linear backoff
|
||||
missingAssets = await filterOutAssetsThatAlreadyExistAsync(missingAssets);
|
||||
await timeoutPromise; // await after filterOutAssetsThatAlreadyExistAsync for easy mocking with jest.runAllTimers
|
||||
timeout += 1;
|
||||
updateSpinnerText?.(totalAssets, missingAssets.length);
|
||||
|
||||
if (Date.now() - start > TIMEOUT_LIMIT) {
|
||||
throw new Error('Asset upload timed out. Please try again.');
|
||||
}
|
||||
}
|
||||
return {
|
||||
assetCount: assets.length,
|
||||
|
||||
@@ -9,26 +9,23 @@ export async function resolveWorkflowAsync(
|
||||
projectDir: string,
|
||||
platform: Platform
|
||||
): Promise<Workflow> {
|
||||
let platformWorkflowMarkers: string[];
|
||||
let platformWorkflowMarker;
|
||||
try {
|
||||
platformWorkflowMarkers =
|
||||
platformWorkflowMarker =
|
||||
platform === Platform.ANDROID
|
||||
? [
|
||||
path.join(projectDir, 'android/app/build.gradle'),
|
||||
await AndroidConfig.Paths.getAndroidManifestAsync(projectDir),
|
||||
]
|
||||
: [IOSConfig.Paths.getPBXProjectPath(projectDir)];
|
||||
? await AndroidConfig.Paths.getAndroidManifestAsync(projectDir)
|
||||
: IOSConfig.Paths.getPBXProjectPath(projectDir);
|
||||
} catch {
|
||||
return Workflow.MANAGED;
|
||||
}
|
||||
|
||||
for (const marker of platformWorkflowMarkers) {
|
||||
if (
|
||||
(await fs.pathExists(marker)) &&
|
||||
!(await getVcsClient().isFileIgnoredAsync(path.relative(projectDir, marker)))
|
||||
) {
|
||||
return Workflow.GENERIC;
|
||||
}
|
||||
if (await fs.pathExists(platformWorkflowMarker)) {
|
||||
return (await getVcsClient().isFileIgnoredAsync(
|
||||
path.relative(projectDir, platformWorkflowMarker)
|
||||
))
|
||||
? Workflow.MANAGED
|
||||
: Workflow.GENERIC;
|
||||
} else {
|
||||
return Workflow.MANAGED;
|
||||
}
|
||||
return Workflow.MANAGED;
|
||||
}
|
||||
@@ -242,7 +242,6 @@ describe(getArchiveAsync, () => {
|
||||
it('handles path source', async () => {
|
||||
const path = '/archive.apk';
|
||||
await fs.writeFile(path, 'some content');
|
||||
|
||||
jest.mocked(uploadAsync).mockResolvedValueOnce({ url: ARCHIVE_URL, bucketKey: 'wat' });
|
||||
|
||||
const archive = await getArchiveAsync({
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
import {
|
||||
AppUpdateObject,
|
||||
PublishPlatformFlag,
|
||||
ensureBranchExistsAsync,
|
||||
getUpdatesToRepublishInteractiveAsync,
|
||||
getUpdatesToRepublishAsync,
|
||||
truncatePublishUpdateMessage,
|
||||
} from '../../commands/update';
|
||||
import { graphqlClient } from '../../graphql/client';
|
||||
import { ViewBranchUpdatesQuery } from '../../graphql/generated';
|
||||
import { viewBranchUpdatesQueryUpdateLimit } from '../../graphql/queries/UpdateQuery';
|
||||
import Log from '../../log';
|
||||
import { selectAsync } from '../../prompts';
|
||||
|
||||
@@ -22,7 +22,6 @@ jest.mock('../../graphql/queries/UpdateQuery', () => {
|
||||
const actual = jest.requireActual('../../graphql/queries/UpdateQuery');
|
||||
return {
|
||||
...actual,
|
||||
getViewBranchUpdatesQueryUpdateLimit: jest.fn(actual.getViewBranchUpdatesQueryUpdateLimit),
|
||||
};
|
||||
});
|
||||
jest.mock('../../prompts', () => ({
|
||||
@@ -33,7 +32,7 @@ jest.mock('../../commands/update', () => {
|
||||
return {
|
||||
...actual,
|
||||
ensureBranchExistsAsync: jest.fn(actual.ensureBranchExistsAsync),
|
||||
getUpdatesToRepublishInteractiveAsync: jest.fn(actual.getUpdatesToRepublishInteractiveAsync),
|
||||
getUpdatesToRepublishAsync: jest.fn(actual.getUpdatesToRepublishAsync),
|
||||
};
|
||||
});
|
||||
const updatesToResolve = jest.fn(
|
||||
@@ -97,14 +96,8 @@ function createMockUpdates(
|
||||
updateCount: 1,
|
||||
platformFlag: 'all',
|
||||
}
|
||||
): Exclude<
|
||||
Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'] {
|
||||
let updates: Exclude<
|
||||
Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'],
|
||||
null | undefined
|
||||
>['updates'] = [];
|
||||
): AppUpdateObject[] {
|
||||
let updates: Partial<AppUpdateObject>[] = [];
|
||||
if (platformFlag === 'all') {
|
||||
updateCount = Math.ceil(updateCount / 2);
|
||||
}
|
||||
@@ -145,7 +138,7 @@ function createMockUpdates(
|
||||
break;
|
||||
}
|
||||
}
|
||||
return updates;
|
||||
return updates as AppUpdateObject[];
|
||||
}
|
||||
|
||||
describe('UpdatePublish', () => {
|
||||
@@ -155,18 +148,6 @@ describe('UpdatePublish', () => {
|
||||
jest.mocked(graphqlClient.mutation).mockClear();
|
||||
});
|
||||
|
||||
it('defaults limit to viewBranchUpdatesQueryUpdateLimit and offset to 0 when none are provided', async () => {
|
||||
await ensureBranchExistsAsync({ appId, name: appName });
|
||||
const [[, bindings]] = jest.mocked(graphqlClient.query).mock.calls;
|
||||
|
||||
expect(bindings).toEqual({
|
||||
appId,
|
||||
name: appName,
|
||||
limit: viewBranchUpdatesQueryUpdateLimit,
|
||||
offset: 0,
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
[0, 0],
|
||||
[10, 50],
|
||||
@@ -185,19 +166,20 @@ describe('UpdatePublish', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('getUpdatesToRepublishInteractiveAsync', () => {
|
||||
describe('getUpdatesToRepublishAsync', () => {
|
||||
const pageSize = 50;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.mocked(graphqlClient.query).mockClear();
|
||||
jest.mocked(graphqlClient.mutation).mockClear();
|
||||
jest.mocked(getUpdatesToRepublishInteractiveAsync).mockClear();
|
||||
jest.mocked(getUpdatesToRepublishAsync).mockClear();
|
||||
jest.mocked(selectAsync).mockClear();
|
||||
});
|
||||
|
||||
it('throws when there are no updates', async () => {
|
||||
const platformFlag = 'all';
|
||||
await expect(
|
||||
async () =>
|
||||
await getUpdatesToRepublishInteractiveAsync(projectName, branchName, platformFlag, 50)
|
||||
async () => await getUpdatesToRepublishAsync(projectName, branchName, platformFlag)
|
||||
).rejects.toThrow(
|
||||
`There are no updates on branch "${branchName}" published for the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`
|
||||
);
|
||||
@@ -205,7 +187,6 @@ describe('UpdatePublish', () => {
|
||||
|
||||
it('fetches multiple pages of updates and can select an update from the most recent page', async () => {
|
||||
const mockSelectedGroupId = uuidv4();
|
||||
const pageSize = 2;
|
||||
updatesToResolve
|
||||
.mockReturnValueOnce(createMockUpdates({ updateCount: pageSize + 1 }))
|
||||
.mockReturnValueOnce(
|
||||
@@ -216,18 +197,12 @@ describe('UpdatePublish', () => {
|
||||
.mockResolvedValueOnce('_fetchMore')
|
||||
.mockResolvedValueOnce(mockSelectedGroupId);
|
||||
|
||||
const selectedUpdates = await getUpdatesToRepublishInteractiveAsync(
|
||||
projectName,
|
||||
branchName,
|
||||
'all',
|
||||
pageSize
|
||||
);
|
||||
const selectedUpdates = await getUpdatesToRepublishAsync(projectName, branchName, 'all');
|
||||
expect(selectedUpdates.every(update => update.group === mockSelectedGroupId)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('fetches multiple pages of updates and can return an update from a previous page', async () => {
|
||||
const mockSelectedGroupId = uuidv4();
|
||||
const pageSize = 5;
|
||||
updatesToResolve
|
||||
.mockReturnValueOnce(
|
||||
createMockUpdates({ updateCount: pageSize + 1, groupId: mockSelectedGroupId })
|
||||
@@ -238,18 +213,12 @@ describe('UpdatePublish', () => {
|
||||
.mockResolvedValueOnce('_fetchMore')
|
||||
.mockResolvedValueOnce(mockSelectedGroupId);
|
||||
|
||||
const selectedUpdates = await getUpdatesToRepublishInteractiveAsync(
|
||||
projectName,
|
||||
branchName,
|
||||
'all',
|
||||
pageSize
|
||||
);
|
||||
const selectedUpdates = await getUpdatesToRepublishAsync(projectName, branchName, 'all');
|
||||
expect(selectedUpdates.every(update => update.group === mockSelectedGroupId)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('displays the option to fetch more pages as long as there are unfetched updates left', async () => {
|
||||
const mockSelectedGroupId = uuidv4();
|
||||
const pageSize = 10;
|
||||
updatesToResolve
|
||||
.mockReturnValueOnce(
|
||||
createMockUpdates({ updateCount: pageSize + 1, groupId: mockSelectedGroupId })
|
||||
@@ -262,7 +231,7 @@ describe('UpdatePublish', () => {
|
||||
.mockResolvedValueOnce('_fetchMore')
|
||||
.mockResolvedValueOnce(mockSelectedGroupId);
|
||||
|
||||
await getUpdatesToRepublishInteractiveAsync(projectName, branchName, 'all', pageSize);
|
||||
await getUpdatesToRepublishAsync(projectName, branchName, 'all');
|
||||
const { calls } = jest.mocked(selectAsync).mock;
|
||||
expect(calls.length).toEqual(3);
|
||||
const [[, firstOptions], [, secondOptions], [, thirdOptions]] = calls;
|
||||
@@ -277,7 +246,6 @@ describe('UpdatePublish', () => {
|
||||
|
||||
it('paginates update requests as expected', async () => {
|
||||
const mockSelectedGroupId = uuidv4();
|
||||
const pageSize = 50;
|
||||
updatesToResolve
|
||||
.mockReturnValueOnce(
|
||||
createMockUpdates({ updateCount: pageSize + 1, groupId: mockSelectedGroupId })
|
||||
@@ -292,7 +260,7 @@ describe('UpdatePublish', () => {
|
||||
.mockResolvedValueOnce('_fetchMore')
|
||||
.mockResolvedValueOnce(mockSelectedGroupId);
|
||||
|
||||
await getUpdatesToRepublishInteractiveAsync(projectName, branchName, 'all', pageSize);
|
||||
await getUpdatesToRepublishAsync(projectName, branchName, 'all');
|
||||
const gqlBindings = jest.mocked(graphqlClient.query).mock.calls.map(call => call[1]);
|
||||
expect(gqlBindings).toEqual([
|
||||
expect.objectContaining({ limit: pageSize + 1, offset: pageSize * 0 }),
|
||||
|
||||
@@ -36,11 +36,18 @@ export function getPlatformsForGroup({
|
||||
.join(', ');
|
||||
}
|
||||
|
||||
export const truncateUpdateMessage = (originalMessage: string, length: number = 512): string => {
|
||||
if (originalMessage.length > length) {
|
||||
return originalMessage.substring(0, length - 3) + '...';
|
||||
}
|
||||
return originalMessage;
|
||||
};
|
||||
|
||||
export function formatUpdate(update: FormatUpdateParameter): string {
|
||||
if (!update) {
|
||||
return 'N/A';
|
||||
}
|
||||
const message = update.message ? `"${update.message}" ` : '';
|
||||
const message = update.message ? `"${truncateUpdateMessage(update.message)}" ` : '';
|
||||
return `${message}(${format(update.createdAt, 'en_US')} by ${getActorDisplayName(
|
||||
update.actor as any
|
||||
)})`;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import assert from 'assert';
|
||||
import FormData from 'form-data';
|
||||
import fs from 'fs-extra';
|
||||
import { Response } from 'node-fetch';
|
||||
import nullthrows from 'nullthrows';
|
||||
import { URL } from 'url';
|
||||
|
||||
import fetch from './fetch';
|
||||
@@ -16,14 +14,8 @@ export async function uploadAsync(
|
||||
handleProgressEvent: ProgressHandler
|
||||
): Promise<{ url: string; bucketKey: string }> {
|
||||
const presignedPost = await UploadSessionMutation.createUploadSessionAsync(type);
|
||||
const url = await uploadWithPresignedPostAsync(path, presignedPost, handleProgressEvent);
|
||||
assert(presignedPost.fields.key, 'key is not specified in in presigned post');
|
||||
|
||||
const response = await uploadWithPresignedPostAsync(path, presignedPost, handleProgressEvent);
|
||||
const location = nullthrows(
|
||||
response.headers.get('location'),
|
||||
`location does not exist in response headers (make sure you're uploading to AWS S3)`
|
||||
);
|
||||
const url = fixS3Url(location);
|
||||
return { url, bucketKey: presignedPost.fields.key };
|
||||
}
|
||||
|
||||
@@ -31,7 +23,7 @@ export async function uploadWithPresignedPostAsync(
|
||||
file: string,
|
||||
presignedPost: PresignedPost,
|
||||
handleProgressEvent?: ProgressHandler
|
||||
): Promise<Response> {
|
||||
): Promise<string> {
|
||||
const fileStat = await fs.stat(file);
|
||||
const fileSize = fileStat.size;
|
||||
const form = new FormData();
|
||||
@@ -63,13 +55,14 @@ export async function uploadWithPresignedPostAsync(
|
||||
try {
|
||||
const response = await uploadPromise;
|
||||
handleProgressEvent({ isComplete: true });
|
||||
return response;
|
||||
return fixArchiveUrl(String(response.headers.get('location')));
|
||||
} catch (error: any) {
|
||||
handleProgressEvent({ isComplete: true, error });
|
||||
throw error;
|
||||
}
|
||||
} else {
|
||||
return await uploadPromise;
|
||||
const response = await uploadPromise;
|
||||
return fixArchiveUrl(String(response.headers.get('location')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +71,7 @@ export async function uploadWithPresignedPostAsync(
|
||||
* https://submission-service-archives.s3.amazonaws.com/production%2Fdc98ca84-1473-4cb3-ae81-8c7b291cb27e%2F4424aa95-b985-4e2f-8755-9507b1037c1c
|
||||
* This function replaces %2F with /.
|
||||
*/
|
||||
export function fixS3Url(archiveUrl: string): string {
|
||||
export function fixArchiveUrl(archiveUrl: string): string {
|
||||
const parsed = new URL(archiveUrl);
|
||||
parsed.pathname = decodeURIComponent(parsed.pathname);
|
||||
return parsed.toString();
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
import { confirmAsync, selectAsync } from '../prompts';
|
||||
import uniqBy from './expodash/uniqBy';
|
||||
|
||||
export type PaginatedQueryResponse<QueryReturnType extends Record<string, any>> = {
|
||||
queryResponse: QueryReturnType[];
|
||||
queryResponseRawLength: number;
|
||||
};
|
||||
|
||||
export type PromptSelectionListItem = {
|
||||
title: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type PaginatedQueryArguments<QueryReturnType extends Record<string, any>> = {
|
||||
pageSize: number;
|
||||
offset: number;
|
||||
queryToPerform: (
|
||||
pageSize: number,
|
||||
offset: number
|
||||
) => Promise<PaginatedQueryResponse<QueryReturnType>>;
|
||||
promptOptions: PaginatedQueryPromptOptions<QueryReturnType>;
|
||||
};
|
||||
|
||||
export interface PaginatedQuerySelectPrompt<QueryReturnType extends Record<string, any>> {
|
||||
readonly title: string;
|
||||
readonly type: 'select';
|
||||
createDisplayTextForSelectionPromptListItem: (queryItem: QueryReturnType) => string;
|
||||
getIdentifierForQueryItem: (queryItem: QueryReturnType) => string;
|
||||
}
|
||||
|
||||
export interface PaginatedQueryConfirmPrompt<QueryReturnType extends Record<string, any>> {
|
||||
readonly type: 'confirm';
|
||||
readonly title: string;
|
||||
renderListItems: (currentPage: QueryReturnType[]) => void;
|
||||
}
|
||||
|
||||
type PaginatedQueryPromptOptions<QueryReturnType extends Record<string, any>> =
|
||||
| PaginatedQueryConfirmPrompt<QueryReturnType>
|
||||
| PaginatedQuerySelectPrompt<QueryReturnType>;
|
||||
|
||||
/**
|
||||
* Return an empty array when the promptOptions type is PaginatedQueryConfirmPrompt
|
||||
* Returns an array of the selected items when the promptOptions type is PaginatedQuerySelectPrompt
|
||||
*/
|
||||
export async function performPaginatedQueryAsync<QueryReturnType extends Record<string, any>>(
|
||||
{ pageSize, offset, queryToPerform, promptOptions }: PaginatedQueryArguments<QueryReturnType>,
|
||||
accumulator?: QueryReturnType[]
|
||||
): Promise<QueryReturnType[]> {
|
||||
const fetchMoreValue = '_fetchMore';
|
||||
|
||||
// query an extra item to determine if there are more pages left
|
||||
const { queryResponse: items, queryResponseRawLength } = await queryToPerform(
|
||||
pageSize + 1,
|
||||
offset
|
||||
);
|
||||
const areMorePagesAvailable = queryResponseRawLength > pageSize;
|
||||
// drop that extra item used for pagination from our render logic when extra pages are available
|
||||
const currentPage = items.slice(0, areMorePagesAvailable ? items.length - 1 : undefined);
|
||||
accumulator = [...(accumulator ?? []), ...currentPage];
|
||||
|
||||
let valueOfUserSelectedListItem = '';
|
||||
|
||||
if (promptOptions.type === 'confirm') {
|
||||
promptOptions.renderListItems(currentPage);
|
||||
if (areMorePagesAvailable) {
|
||||
valueOfUserSelectedListItem = (await confirmAsync({ message: promptOptions.title }))
|
||||
? fetchMoreValue
|
||||
: '';
|
||||
}
|
||||
} else {
|
||||
const selectionPromptListItems = uniqBy(accumulator, queryItem =>
|
||||
promptOptions.getIdentifierForQueryItem(queryItem)
|
||||
).map(queryItem => ({
|
||||
title: promptOptions.createDisplayTextForSelectionPromptListItem(queryItem),
|
||||
value: promptOptions.getIdentifierForQueryItem(queryItem),
|
||||
}));
|
||||
if (areMorePagesAvailable) {
|
||||
selectionPromptListItems.push({ title: 'Next page...', value: fetchMoreValue });
|
||||
}
|
||||
if (selectionPromptListItems.length) {
|
||||
valueOfUserSelectedListItem = await selectAsync<string>(
|
||||
promptOptions.title,
|
||||
selectionPromptListItems
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (valueOfUserSelectedListItem === fetchMoreValue) {
|
||||
return await performPaginatedQueryAsync(
|
||||
{
|
||||
pageSize,
|
||||
offset: offset + pageSize,
|
||||
queryToPerform,
|
||||
promptOptions,
|
||||
},
|
||||
accumulator
|
||||
);
|
||||
}
|
||||
|
||||
if (promptOptions.type === 'select') {
|
||||
return accumulator.filter(
|
||||
update => promptOptions.getIdentifierForQueryItem(update) === valueOfUserSelectedListItem
|
||||
);
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@expo/eas-json",
|
||||
"description": "A library for interacting with eas.json",
|
||||
"version": "0.55.0",
|
||||
"version": "0.54.0",
|
||||
"author": "Expo <[email protected]>",
|
||||
"bugs": "https://github.com/expo/eas-cli/issues",
|
||||
"dependencies": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"memfs": "3.4.3",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "4.6.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
|
||||
@@ -34,7 +34,7 @@ function resolveProfile({
|
||||
profileName: string;
|
||||
depth?: number;
|
||||
}): EasJsonBuildProfileResolved {
|
||||
if (depth >= 5) {
|
||||
if (depth >= 2) {
|
||||
throw new Error(
|
||||
'Too long chain of profile extensions, make sure "extends" keys do not make a cycle'
|
||||
);
|
||||
|
||||
File renamed without changes.
@@ -1,34 +1,33 @@
|
||||
{
|
||||
"name": "scripts",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "0.31.0",
|
||||
"scripts": {
|
||||
"changelog-entry": "ts-node-esm src/changelogEntry.ts",
|
||||
"release-changelog": "ts-node-esm src/releaseChangelog.ts",
|
||||
"update-local-plugin": "./src/updateLocalPlugin.sh",
|
||||
"typecheck": "tsc"
|
||||
"changelog-entry": "ts-node src/changelogEntry.ts",
|
||||
"release-changelog": "ts-node src/releaseChangelog.ts",
|
||||
"update-local-plugin": "./src/updateLocalPlugin.sh"
|
||||
},
|
||||
"author": "Expo <[email protected]>",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
"node": ">=14.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"dateformat": "4.5.1",
|
||||
"fs-extra": "10.1.0",
|
||||
"lodash-es": "4.17.21",
|
||||
"lodash": "4.17.21",
|
||||
"marked": "3.0.4",
|
||||
"nullthrows": "1.1.1",
|
||||
"semver": "7.3.7",
|
||||
"tslib": "2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/dateformat": "3.0.1",
|
||||
"@types/fs-extra": "9.0.13",
|
||||
"@types/lodash-es": "4.17.6",
|
||||
"@types/lodash": "4.14.182",
|
||||
"@types/node": "17.0.32",
|
||||
"@types/semver": "7.3.9",
|
||||
"ts-node": "10.7.0",
|
||||
"typescript": "4.7.4"
|
||||
"typescript": "4.6.4"
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { URL } from 'node:url';
|
||||
import path from 'path';
|
||||
|
||||
export enum EntryCategory {
|
||||
BreakingChange = 'breaking-change',
|
||||
@@ -7,7 +7,7 @@ export enum EntryCategory {
|
||||
Chore = 'chore',
|
||||
}
|
||||
|
||||
export const CHANGELOG_PATH = new URL('../../../CHANGELOG.md', import.meta.url);
|
||||
export const CHANGELOG_PATH = path.join(__dirname, '../../../CHANGELOG.md');
|
||||
|
||||
export const CATEGORY_HEADERS: Record<EntryCategory, string> = {
|
||||
[EntryCategory.BreakingChange]: '🛠 Breaking changes',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import * as markdown from '../markdown.js';
|
||||
import { CHANGELOG_PATH } from './consts.js';
|
||||
import * as markdown from '../markdown';
|
||||
import { CHANGELOG_PATH } from './consts';
|
||||
|
||||
export async function readAndParseChangelogAsync(): Promise<markdown.Tokens> {
|
||||
const contents = await fs.readFile(CHANGELOG_PATH, 'utf8');
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { CATEGORY_HEADERS, EntryCategory } from './changelog/consts.js';
|
||||
import { readAndParseChangelogAsync, writeChangelogAsync } from './changelog/file.js';
|
||||
import * as markdown from './markdown.js';
|
||||
import { nullthrows } from './nullthrows.js';
|
||||
import nullthrows from 'nullthrows';
|
||||
|
||||
import { CATEGORY_HEADERS, EntryCategory } from './changelog/consts';
|
||||
import { readAndParseChangelogAsync, writeChangelogAsync } from './changelog/file';
|
||||
import * as markdown from './markdown';
|
||||
|
||||
const [rawCategory, ...rest] = process.argv.slice(2);
|
||||
const message = rest.join(' ');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// this is mostly copy-pasted from https://github.com/expo/expo/blob/master/tools/src/Markdown.ts
|
||||
|
||||
import { unescape } from 'lodash-es';
|
||||
import { unescape } from 'lodash';
|
||||
import marked from 'marked';
|
||||
|
||||
export enum TokenType {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
export function nullthrows<T>(value: T | null | undefined, message?: string): T {
|
||||
if (value !== null && value !== undefined) {
|
||||
return value;
|
||||
}
|
||||
|
||||
const error = new Error(message !== undefined ? message : `Got unexpected ${value}`);
|
||||
(error as any).framesToPop = 1; // Skip nullthrows's own stack frame.
|
||||
throw error;
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
import dateFormat from 'dateformat';
|
||||
import semver from 'semver';
|
||||
|
||||
import { CATEGORY_HEADERS } from './changelog/consts.js';
|
||||
import { readAndParseChangelogAsync, writeChangelogAsync } from './changelog/file.js';
|
||||
import * as markdown from './markdown.js';
|
||||
import { CATEGORY_HEADERS } from './changelog/consts';
|
||||
import { readAndParseChangelogAsync, writeChangelogAsync } from './changelog/file';
|
||||
import * as markdown from './markdown';
|
||||
|
||||
const MAIN_CATEGORIES = Object.values(CATEGORY_HEADERS).map(text =>
|
||||
markdown.createHeadingToken(text, 3)
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"module": "node16",
|
||||
"moduleResolution": "node16",
|
||||
"importHelpers": true,
|
||||
"module": "commonjs",
|
||||
"esModuleInterop": true,
|
||||
"noImplicitReturns": true,
|
||||
"strict": true,
|
||||
"target": "ES2020",
|
||||
"target": "ES2019",
|
||||
"outDir": "build",
|
||||
"rootDir": "src",
|
||||
"typeRoots": [
|
||||
|
||||
Generated
+13
-15
@@ -46,14 +46,7 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/lodash-es@4.17.6":
|
||||
version "4.17.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.6.tgz#c2ed4c8320ffa6f11b43eb89e9eaeec65966a0a0"
|
||||
integrity sha512-R+zTeVUKDdfoRxpAryaQNRKk3105Rrgx2CFRClIgRGaqDTdjsm8h6IYA8ir584W3ePzkZfst5xIgDwYrlh9HLg==
|
||||
dependencies:
|
||||
"@types/lodash" "*"
|
||||
|
||||
"@types/lodash@*":
|
||||
"@types/[email protected]4.182":
|
||||
version "4.14.182"
|
||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2"
|
||||
integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==
|
||||
@@ -126,10 +119,10 @@ jsonfile@^6.0.1:
|
||||
optionalDependencies:
|
||||
graceful-fs "^4.1.6"
|
||||
|
||||
lodash-es@4.17.21:
|
||||
[email protected]:
|
||||
version "4.17.21"
|
||||
resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.21.tgz#43e626c46e6591b7750beb2b50117390c609e3ee"
|
||||
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==
|
||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||
|
||||
lru-cache@^6.0.0:
|
||||
version "6.0.0"
|
||||
@@ -148,6 +141,11 @@ [email protected]:
|
||||
resolved "https://registry.yarnpkg.com/marked/-/marked-3.0.4.tgz#b8a1539e5e05c6ea9e93f15c0bad1d54ce890406"
|
||||
integrity sha512-jBo8AOayNaEcvBhNobg6/BLhdsK3NvnKWJg33MAAPbvTWiG4QBn9gpW1+7RssrKu4K1dKlN+0goVQwV41xEfOA==
|
||||
|
||||
[email protected]:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/nullthrows/-/nullthrows-1.1.1.tgz#7818258843856ae971eae4208ad7d7eb19a431b1"
|
||||
integrity sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==
|
||||
|
||||
[email protected]:
|
||||
version "7.3.7"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
|
||||
@@ -179,10 +177,10 @@ [email protected]:
|
||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
|
||||
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==
|
||||
|
||||
typescript@4.7.4:
|
||||
version "4.7.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
|
||||
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
|
||||
typescript@4.6.4:
|
||||
version "4.6.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
|
||||
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==
|
||||
|
||||
universalify@^2.0.0:
|
||||
version "2.0.0"
|
||||
|
||||
@@ -12288,10 +12288,10 @@ typedarray@^0.0.6:
|
||||
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||
|
||||
typescript@4.7.4:
|
||||
version "4.7.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.4.tgz#1a88596d1cf47d59507a1bcdfb5b9dfe4d488235"
|
||||
integrity sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==
|
||||
typescript@4.6.4:
|
||||
version "4.6.4"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
|
||||
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==
|
||||
|
||||
ua-parser-js@^0.7.30:
|
||||
version "0.7.31"
|
||||
|
||||
Reference in new issue
Block a user