eas-cli
eas-cli copied to clipboard
[eas-cli] Update: improve DX on first run, correct error message
Checklist
- [x] I've added an entry to CHANGELOG.md if necessary. You can comment this pull request with
/changelog-entry [breaking-change|new-feature|bug-fix|chore] [message]and CHANGELOG.md will be updated automatically.
Why
Fixes ENG-6013 Fixes ENG-6014
How
This changeset adds the prompt for the user when there is no runtime version specified, which asks if setup the updates automatically for them (via eas update:configure).
If user do not want this the CLI exits as before.
If user selects "Yes", we are programmatically running eas update:configure, and then re-reading the modified config, so the process can continue without the interruption or command exit.
As always, the copy/messages content probably can be written better. 😉
Test Plan
The changes have been tested locally in few project by running dev bin of EAS CLI.
Preview
ENG-6013 `eas update` should run `eas update:configure` for you if you haven't yet
This is resolved if you run eas update:configure before eas update.
ENG-6014 Improve error message when unable to determine runtime version
- it should read "Android" instead of "android" (needs to be capitalized. likely need to change equivalent for iOS as well)
- link to a docs page with more information about this, possibly also suggest a solution in-line or prompt to initialize a runtime version automatically for you.
(this issue is related to ENG-6013)
Size Change: +111 kB (0%)
Total Size: 41.2 MB
| Filename | Size | Change |
|---|---|---|
./packages/eas-cli/dist/eas-linux-x64.tar.gz |
41.2 MB | +111 kB (0%) |
/changelog-entry new-feature Update: Ask user to run eas update:configure automatically, if runtimeVersion is missing.
/changelog-entry chore Update: Improve the error message if runtimeVersion is missing.
Codecov Report
Merging #1427 (0a9e3ee) into main (9201af5) will decrease coverage by
0.61%. The diff coverage is22.00%.
@@ Coverage Diff @@
## main #1427 +/- ##
==========================================
- Coverage 51.80% 51.19% -0.60%
==========================================
Files 425 450 +25
Lines 14676 15476 +800
Branches 3061 3037 -24
==========================================
+ Hits 7601 7922 +321
- Misses 7062 7541 +479
Partials 13 13
| Impacted Files | Coverage Δ | |
|---|---|---|
| packages/eas-cli/src/log.ts | 84.22% <0.00%> (-3.06%) |
:arrow_down: |
| packages/eas-cli/src/commands/update/configure.ts | 17.06% <15.00%> (+1.06%) |
:arrow_up: |
| packages/eas-cli/src/commands/update/index.ts | 16.67% <16.67%> (-0.45%) |
:arrow_down: |
| packages/eas-cli/src/project/workflow.ts | 100.00% <100.00%> (ø) |
|
| packages/eas-cli/src/commands/project/init.ts | 84.42% <0.00%> (-10.58%) |
:arrow_down: |
| packages/eas-cli/src/build/queries.ts | 27.91% <0.00%> (-2.86%) |
:arrow_down: |
| .../eas-cli/src/devices/actions/create/inputMethod.ts | 76.12% <0.00%> (-2.54%) |
:arrow_down: |
| .../eas-cli/src/credentials/manager/SelectPlatform.ts | 28.58% <0.00%> (-2.19%) |
:arrow_down: |
| packages/eas-cli/src/commands/metadata/pull.ts | 50.00% <0.00%> (-1.85%) |
:arrow_down: |
| packages/eas-cli/src/commands/metadata/push.ts | 48.28% <0.00%> (-1.72%) |
:arrow_down: |
| ... and 77 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
- Nice catch, addressed.
- Public config is now passed from the transform method, and updated if needed. There is no need to refetch the private config, since it's only used once, before the transform method call.
- I was still able to trigger this warning when using
--non-interactiveflag in the first version of this PR, but now, after refactor, we only call theeas.jsonedit part, so this is definitely still needed.
Calling only the eas.json part of config seems to clarify a few things and allow us to reduce the amount of unwanted changes or mutation, but I'm not sure if this was the @brentvatne intent, while crating this issue (we can always call the native method too, as a separate question after the performed refactor, if needed).
@jonsamp Last commit added after your comment should fix those issues, as we discussed, it would be great if you can confirm that the problem with runtime policy no longer occurs.
We talked about this feature in a meeting for awhile. @brentvatne put together a summary:
should eas update run eas update:configure automatically if not yet configured? imo yes -> but let people know afterwards that the update may not apply to any existing builds.
should eas update and eas build run eas init automatically if not yet configured? imo yes -> similar to trying to access an authenticated portion of a sign before signing in. i think it's a bad first time experience for a user to run a command and have it fail and tell them to run another command manually
should we configure eas update and build in eas init? yes, we should prompt people for this
should we configure eas update when you run eas build? yes, we should use the same sort of prompt we use around push notifications to let people say yes/no/don't ask me again
I think that we should prompt people on EAS Update and as the first one says "let people know afterwards that the update may not apply to any existing builds". Developers can still view published updates in Expo Go and development builds even if they did not have EAS Update configured until they published.
@wschurman, the underlying premise of this PR is right to me. If you agree, and you think the code is good, we should approve this one.
I would like to get this merged whenever you have a chance @Simek. This PR is in a good spot and I'd love to see it in production sooner than later. I really appreciate your work on this and your responses to all the comments.